diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/chacha/chacha.c | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/hidden/openssl/chacha.h | 31 |
3 files changed, 43 insertions, 1 deletions
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index 4320731af3..faee727cfd 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
| @@ -889,3 +889,9 @@ _libre_X509v3_addr_validate_path | |||
| 889 | _libre_X509v3_asid_validate_resource_set | 889 | _libre_X509v3_asid_validate_resource_set |
| 890 | _libre_X509v3_addr_validate_resource_set | 890 | _libre_X509v3_addr_validate_resource_set |
| 891 | _libre_ERR_load_X509V3_strings | 891 | _libre_ERR_load_X509V3_strings |
| 892 | _libre_ChaCha_set_key | ||
| 893 | _libre_ChaCha_set_iv | ||
| 894 | _libre_ChaCha | ||
| 895 | _libre_CRYPTO_chacha_20 | ||
| 896 | _libre_CRYPTO_xchacha_20 | ||
| 897 | _libre_CRYPTO_hchacha_20 | ||
diff --git a/src/lib/libcrypto/chacha/chacha.c b/src/lib/libcrypto/chacha/chacha.c index 0ce4545186..b60e3c4f27 100644 --- a/src/lib/libcrypto/chacha/chacha.c +++ b/src/lib/libcrypto/chacha/chacha.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: chacha.c,v 1.9 2022/08/20 18:44:58 jsing Exp $ */ | 1 | /* $OpenBSD: chacha.c,v 1.10 2023/07/05 16:17:20 beck Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -27,6 +27,7 @@ ChaCha_set_key(ChaCha_ctx *ctx, const unsigned char *key, uint32_t keybits) | |||
| 27 | chacha_keysetup((chacha_ctx *)ctx, key, keybits); | 27 | chacha_keysetup((chacha_ctx *)ctx, key, keybits); |
| 28 | ctx->unused = 0; | 28 | ctx->unused = 0; |
| 29 | } | 29 | } |
| 30 | LCRYPTO_ALIAS(ChaCha_set_key); | ||
| 30 | 31 | ||
| 31 | void | 32 | void |
| 32 | ChaCha_set_iv(ChaCha_ctx *ctx, const unsigned char *iv, | 33 | ChaCha_set_iv(ChaCha_ctx *ctx, const unsigned char *iv, |
| @@ -35,6 +36,7 @@ ChaCha_set_iv(ChaCha_ctx *ctx, const unsigned char *iv, | |||
| 35 | chacha_ivsetup((chacha_ctx *)ctx, iv, counter); | 36 | chacha_ivsetup((chacha_ctx *)ctx, iv, counter); |
| 36 | ctx->unused = 0; | 37 | ctx->unused = 0; |
| 37 | } | 38 | } |
| 39 | LCRYPTO_ALIAS(ChaCha_set_iv); | ||
| 38 | 40 | ||
| 39 | void | 41 | void |
| 40 | ChaCha(ChaCha_ctx *ctx, unsigned char *out, const unsigned char *in, size_t len) | 42 | ChaCha(ChaCha_ctx *ctx, unsigned char *out, const unsigned char *in, size_t len) |
| @@ -64,6 +66,7 @@ ChaCha(ChaCha_ctx *ctx, unsigned char *out, const unsigned char *in, size_t len) | |||
| 64 | len -= n; | 66 | len -= n; |
| 65 | } | 67 | } |
| 66 | } | 68 | } |
| 69 | LCRYPTO_ALIAS(ChaCha); | ||
| 67 | 70 | ||
| 68 | void | 71 | void |
| 69 | CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, | 72 | CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, |
| @@ -95,6 +98,7 @@ CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, | |||
| 95 | len -= n; | 98 | len -= n; |
| 96 | } | 99 | } |
| 97 | } | 100 | } |
| 101 | LCRYPTO_ALIAS(CRYPTO_chacha_20); | ||
| 98 | 102 | ||
| 99 | void | 103 | void |
| 100 | CRYPTO_xchacha_20(unsigned char *out, const unsigned char *in, size_t len, | 104 | CRYPTO_xchacha_20(unsigned char *out, const unsigned char *in, size_t len, |
| @@ -105,3 +109,4 @@ CRYPTO_xchacha_20(unsigned char *out, const unsigned char *in, size_t len, | |||
| 105 | CRYPTO_hchacha_20(subkey, key, iv); | 109 | CRYPTO_hchacha_20(subkey, key, iv); |
| 106 | CRYPTO_chacha_20(out, in, len, subkey, iv + 16, 0); | 110 | CRYPTO_chacha_20(out, in, len, subkey, iv + 16, 0); |
| 107 | } | 111 | } |
| 112 | LCRYPTO_ALIAS(CRYPTO_xchacha_20); | ||
diff --git a/src/lib/libcrypto/hidden/openssl/chacha.h b/src/lib/libcrypto/hidden/openssl/chacha.h new file mode 100644 index 0000000000..7b2f50baef --- /dev/null +++ b/src/lib/libcrypto/hidden/openssl/chacha.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* $OpenBSD: chacha.h,v 1.1 2023/07/05 16:17:20 beck Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | ||
| 4 | * | ||
| 5 | * Permission to use, copy, modify, and distribute this software for any | ||
| 6 | * purpose with or without fee is hereby granted, provided that the above | ||
| 7 | * copyright notice and this permission notice appear in all copies. | ||
| 8 | * | ||
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef _LIBCRYPTO_CHACHA_H | ||
| 19 | #define _LIBCRYPTO_CHACHA_H | ||
| 20 | |||
| 21 | #include_next <openssl/chacha.h> | ||
| 22 | #include "crypto_namespace.h" | ||
| 23 | |||
| 24 | LCRYPTO_USED(ChaCha_set_key); | ||
| 25 | LCRYPTO_USED(ChaCha_set_iv); | ||
| 26 | LCRYPTO_USED(ChaCha); | ||
| 27 | LCRYPTO_USED(CRYPTO_chacha_20); | ||
| 28 | LCRYPTO_USED(CRYPTO_xchacha_20); | ||
| 29 | LCRYPTO_USED(CRYPTO_hchacha_20); | ||
| 30 | |||
| 31 | #endif /* _LIBCRYPTO_CHACHA_H */ | ||
