diff options
Diffstat (limited to 'src/lib/libcrypto/chacha/chacha-merged.c')
| -rw-r--r-- | src/lib/libcrypto/chacha/chacha-merged.c | 15 |
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 | /* |
| 3 | chacha-merged.c version 20080118 | 3 | chacha-merged.c version 20080118 |
| 4 | D. J. Bernstein | 4 | D. 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 | ||
| 75 | static const char sigma[16] = "expand 32-byte k"; | 75 | /* Initialise with "expand 32-byte k". */ |
| 76 | static const char tau[16] = "expand 16-byte k"; | 76 | static 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". */ | ||
| 82 | static 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 | ||
| 78 | static inline void | 87 | static inline void |
| 79 | chacha_keysetup(chacha_ctx *x, const u8 *k, u32 kbits) | 88 | chacha_keysetup(chacha_ctx *x, const u8 *k, u32 kbits) |
