From: joshua Date: Sat, 30 Mar 2024 04:58:12 +0000 (+0000) Subject: Hide symbols in camellia X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=47091a923918cded78f28bc4d824e89bed947f2d;p=openbsd Hide symbols in camellia ok tb --- diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 21f24c9ef52..5862beeeb04 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -2604,3 +2604,13 @@ _libre_WHIRLPOOL_Update _libre_WHIRLPOOL_BitUpdate _libre_WHIRLPOOL_Final _libre_WHIRLPOOL +_libre_Camellia_set_key +_libre_Camellia_encrypt +_libre_Camellia_decrypt +_libre_Camellia_ecb_encrypt +_libre_Camellia_cbc_encrypt +_libre_Camellia_cfb128_encrypt +_libre_Camellia_cfb1_encrypt +_libre_Camellia_cfb8_encrypt +_libre_Camellia_ofb128_encrypt +_libre_Camellia_ctr128_encrypt diff --git a/lib/libcrypto/camellia/camellia.c b/lib/libcrypto/camellia/camellia.c index af6b85ff8e4..94e81a47737 100644 --- a/lib/libcrypto/camellia/camellia.c +++ b/lib/libcrypto/camellia/camellia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: camellia.c,v 1.13 2024/03/29 07:26:21 jsing Exp $ */ +/* $OpenBSD: camellia.c,v 1.14 2024/03/30 04:58:12 joshua Exp $ */ /* ==================================================================== * Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) . * ALL RIGHTS RESERVED. @@ -591,6 +591,7 @@ Camellia_set_key(const unsigned char *userKey, const int bits, key->grand_rounds = Camellia_Ekeygen(bits, userKey, key->u.rd_key); return 0; } +LCRYPTO_ALIAS(Camellia_set_key); void Camellia_encrypt(const unsigned char *in, unsigned char *out, @@ -598,6 +599,7 @@ Camellia_encrypt(const unsigned char *in, unsigned char *out, { Camellia_EncryptBlock_Rounds(key->grand_rounds, in, key->u.rd_key, out); } +LCRYPTO_ALIAS(Camellia_encrypt); void Camellia_decrypt(const unsigned char *in, unsigned char *out, @@ -605,6 +607,7 @@ Camellia_decrypt(const unsigned char *in, unsigned char *out, { Camellia_DecryptBlock_Rounds(key->grand_rounds, in, key->u.rd_key, out); } +LCRYPTO_ALIAS(Camellia_decrypt); void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, @@ -617,6 +620,7 @@ Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, CRYPTO_cbc128_decrypt(in, out, len, key, ivec, (block128_f)Camellia_decrypt); } +LCRYPTO_ALIAS(Camellia_cbc_encrypt); /* * The input and output encrypted as though 128bit cfb mode is being @@ -632,6 +636,7 @@ Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, CRYPTO_cfb128_encrypt(in, out, length, key, ivec, num, enc, (block128_f)Camellia_encrypt); } +LCRYPTO_ALIAS(Camellia_cfb128_encrypt); /* N.B. This expects the input to be packed, MS bit first */ void @@ -642,6 +647,7 @@ Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, CRYPTO_cfb128_1_encrypt(in, out, length, key, ivec, num, enc, (block128_f)Camellia_encrypt); } +LCRYPTO_ALIAS(Camellia_cfb1_encrypt); void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, @@ -651,6 +657,7 @@ Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, CRYPTO_cfb128_8_encrypt(in, out, length, key, ivec, num, enc, (block128_f)Camellia_encrypt); } +LCRYPTO_ALIAS(Camellia_cfb8_encrypt); void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, @@ -661,6 +668,7 @@ Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, CRYPTO_ctr128_encrypt(in, out, length, key, ivec, ecount_buf, num, (block128_f)Camellia_encrypt); } +LCRYPTO_ALIAS(Camellia_ctr128_encrypt); void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, @@ -671,6 +679,7 @@ Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, else Camellia_decrypt(in, out, key); } +LCRYPTO_ALIAS(Camellia_ecb_encrypt); /* * The input and output encrypted as though 128bit ofb mode is being @@ -684,3 +693,4 @@ Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, CRYPTO_ofb128_encrypt(in, out, length, key, ivec, num, (block128_f)Camellia_encrypt); } +LCRYPTO_ALIAS(Camellia_ofb128_encrypt); diff --git a/lib/libcrypto/hidden/openssl/camellia.h b/lib/libcrypto/hidden/openssl/camellia.h new file mode 100644 index 00000000000..bf7f43b1b37 --- /dev/null +++ b/lib/libcrypto/hidden/openssl/camellia.h @@ -0,0 +1,39 @@ +/* $OpenBSD: camellia.h,v 1.1 2024/03/30 04:58:12 joshua Exp $ */ +/* + * Copyright (c) 2024 Joshua Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBCRYPTO_CAMELLIA_H +#define _LIBCRYPTO_CAMELLIA_H + +#ifndef _MSC_VER +#include_next +#else +#include "../include/openssl/camellia.h" +#endif +#include "crypto_namespace.h" + +LCRYPTO_USED(Camellia_set_key); +LCRYPTO_USED(Camellia_encrypt); +LCRYPTO_USED(Camellia_decrypt); +LCRYPTO_USED(Camellia_ecb_encrypt); +LCRYPTO_USED(Camellia_cbc_encrypt); +LCRYPTO_USED(Camellia_cfb128_encrypt); +LCRYPTO_USED(Camellia_cfb1_encrypt); +LCRYPTO_USED(Camellia_cfb8_encrypt); +LCRYPTO_USED(Camellia_ofb128_encrypt); +LCRYPTO_USED(Camellia_ctr128_encrypt); + +#endif /* _LIBCRYPTO_CAMELLIA_H */