summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/chacha/chacha-merged.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/libcrypto/chacha/chacha-merged.c b/src/lib/libcrypto/chacha/chacha-merged.c
index 557dfd5b56..08511ed273 100644
--- a/src/lib/libcrypto/chacha/chacha-merged.c
+++ b/src/lib/libcrypto/chacha/chacha-merged.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: chacha-merged.c,v 1.7 2014/07/11 08:47:47 bcook Exp $ */ 1/* $OpenBSD: chacha-merged.c,v 1.8 2017/08/13 16:55:31 jsing Exp $ */
2/* 2/*
3chacha-merged.c version 20080118 3chacha-merged.c version 20080118
4D. J. Bernstein 4D. J. Bernstein
@@ -72,8 +72,17 @@ typedef struct chacha_ctx chacha_ctx;
72 a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); \ 72 a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); \
73 c = PLUS(c,d); b = ROTATE(XOR(b,c), 7); 73 c = PLUS(c,d); b = ROTATE(XOR(b,c), 7);
74 74
75static const char sigma[16] = "expand 32-byte k"; 75/* Initialise with "expand 32-byte k". */
76static const char tau[16] = "expand 16-byte k"; 76static const char sigma[16] = {
77 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33,
78 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b,
79};
80
81/* Initialise with "expand 16-byte k". */
82static const char tau[16] = {
83 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x31,
84 0x36, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b,
85};
77 86
78static inline void 87static inline void
79chacha_keysetup(chacha_ctx *x, const u8 *k, u32 kbits) 88chacha_keysetup(chacha_ctx *x, const u8 *k, u32 kbits)