aesp8-ppc.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <linux/types.h>
  3. #include <crypto/aes.h>
  4. struct aes_key {
  5. u8 key[AES_MAX_KEYLENGTH];
  6. int rounds;
  7. };
  8. extern struct shash_alg p8_ghash_alg;
  9. extern struct crypto_alg p8_aes_alg;
  10. extern struct skcipher_alg p8_aes_cbc_alg;
  11. extern struct skcipher_alg p8_aes_ctr_alg;
  12. extern struct skcipher_alg p8_aes_xts_alg;
  13. int aes_p8_set_encrypt_key(const u8 *userKey, const int bits,
  14. struct aes_key *key);
  15. int aes_p8_set_decrypt_key(const u8 *userKey, const int bits,
  16. struct aes_key *key);
  17. void aes_p8_encrypt(const u8 *in, u8 *out, const struct aes_key *key);
  18. void aes_p8_decrypt(const u8 *in, u8 *out, const struct aes_key *key);
  19. void aes_p8_cbc_encrypt(const u8 *in, u8 *out, size_t len,
  20. const struct aes_key *key, u8 *iv, const int enc);
  21. void aes_p8_ctr32_encrypt_blocks(const u8 *in, u8 *out,
  22. size_t len, const struct aes_key *key,
  23. const u8 *iv);
  24. void aes_p8_xts_encrypt(const u8 *in, u8 *out, size_t len,
  25. const struct aes_key *key1, const struct aes_key *key2, u8 *iv);
  26. void aes_p8_xts_decrypt(const u8 *in, u8 *out, size_t len,
  27. const struct aes_key *key1, const struct aes_key *key2, u8 *iv);