chacha20.h 601 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Common values for the ChaCha20 algorithm
  3. */
  4. #ifndef _CRYPTO_CHACHA20_H
  5. #define _CRYPTO_CHACHA20_H
  6. #include <crypto/skcipher.h>
  7. #include <linux/types.h>
  8. #include <linux/crypto.h>
  9. #define CHACHA20_IV_SIZE 16
  10. #define CHACHA20_KEY_SIZE 32
  11. #define CHACHA20_BLOCK_SIZE 64
  12. struct chacha20_ctx {
  13. u32 key[8];
  14. };
  15. void chacha20_block(u32 *state, void *stream);
  16. void crypto_chacha20_init(u32 *state, struct chacha20_ctx *ctx, u8 *iv);
  17. int crypto_chacha20_setkey(struct crypto_skcipher *tfm, const u8 *key,
  18. unsigned int keysize);
  19. int crypto_chacha20_crypt(struct skcipher_request *req);
  20. #endif