salsa20.h 582 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Common values for the Salsa20 algorithm
  4. */
  5. #ifndef _CRYPTO_SALSA20_H
  6. #define _CRYPTO_SALSA20_H
  7. #include <linux/types.h>
  8. #define SALSA20_IV_SIZE 8
  9. #define SALSA20_MIN_KEY_SIZE 16
  10. #define SALSA20_MAX_KEY_SIZE 32
  11. #define SALSA20_BLOCK_SIZE 64
  12. struct crypto_skcipher;
  13. struct salsa20_ctx {
  14. u32 initial_state[16];
  15. };
  16. void crypto_salsa20_init(u32 *state, const struct salsa20_ctx *ctx,
  17. const u8 *iv);
  18. int crypto_salsa20_setkey(struct crypto_skcipher *tfm, const u8 *key,
  19. unsigned int keysize);
  20. #endif /* _CRYPTO_SALSA20_H */