serpent.h 712 B

1234567891011121314151617181920212223242526272829
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Common values for serpent algorithms
  4. */
  5. #ifndef _CRYPTO_SERPENT_H
  6. #define _CRYPTO_SERPENT_H
  7. #include <linux/types.h>
  8. #include <linux/crypto.h>
  9. #define SERPENT_MIN_KEY_SIZE 0
  10. #define SERPENT_MAX_KEY_SIZE 32
  11. #define SERPENT_EXPKEY_WORDS 132
  12. #define SERPENT_BLOCK_SIZE 16
  13. struct serpent_ctx {
  14. u32 expkey[SERPENT_EXPKEY_WORDS];
  15. };
  16. int __serpent_setkey(struct serpent_ctx *ctx, const u8 *key,
  17. unsigned int keylen);
  18. int serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen);
  19. void __serpent_encrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src);
  20. void __serpent_decrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src);
  21. #endif