summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/chacha/chacha.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/chacha/chacha.c')
-rw-r--r--src/lib/libcrypto/chacha/chacha.c7
1 files changed, 6 insertions, 1 deletions
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}
30LCRYPTO_ALIAS(ChaCha_set_key);
30 31
31void 32void
32ChaCha_set_iv(ChaCha_ctx *ctx, const unsigned char *iv, 33ChaCha_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}
39LCRYPTO_ALIAS(ChaCha_set_iv);
38 40
39void 41void
40ChaCha(ChaCha_ctx *ctx, unsigned char *out, const unsigned char *in, size_t len) 42ChaCha(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}
69LCRYPTO_ALIAS(ChaCha);
67 70
68void 71void
69CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, 72CRYPTO_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}
101LCRYPTO_ALIAS(CRYPTO_chacha_20);
98 102
99void 103void
100CRYPTO_xchacha_20(unsigned char *out, const unsigned char *in, size_t len, 104CRYPTO_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}
112LCRYPTO_ALIAS(CRYPTO_xchacha_20);