Eric Biggers | eb772f3 | 2018-01-05 11:09:58 -0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Common values for the Salsa20 algorithm |
| 4 | */ |
| 5 | |
| 6 | #ifndef _CRYPTO_SALSA20_H |
| 7 | #define _CRYPTO_SALSA20_H |
| 8 | |
| 9 | #include <linux/types.h> |
| 10 | |
| 11 | #define SALSA20_IV_SIZE 8 |
| 12 | #define SALSA20_MIN_KEY_SIZE 16 |
| 13 | #define SALSA20_MAX_KEY_SIZE 32 |
| 14 | #define SALSA20_BLOCK_SIZE 64 |
| 15 | |
| 16 | struct crypto_skcipher; |
| 17 | |
| 18 | struct salsa20_ctx { |
| 19 | u32 initial_state[16]; |
| 20 | }; |
| 21 | |
| 22 | void crypto_salsa20_init(u32 *state, const struct salsa20_ctx *ctx, |
| 23 | const u8 *iv); |
| 24 | int crypto_salsa20_setkey(struct crypto_skcipher *tfm, const u8 *key, |
| 25 | unsigned int keysize); |
| 26 | |
| 27 | #endif /* _CRYPTO_SALSA20_H */ |