0001
0002 #include <linux/types.h>
0003 #include <crypto/aes.h>
0004
0005 struct aes_key {
0006 u8 key[AES_MAX_KEYLENGTH];
0007 int rounds;
0008 };
0009
0010 extern struct shash_alg p8_ghash_alg;
0011 extern struct crypto_alg p8_aes_alg;
0012 extern struct skcipher_alg p8_aes_cbc_alg;
0013 extern struct skcipher_alg p8_aes_ctr_alg;
0014 extern struct skcipher_alg p8_aes_xts_alg;
0015
0016 int aes_p8_set_encrypt_key(const u8 *userKey, const int bits,
0017 struct aes_key *key);
0018 int aes_p8_set_decrypt_key(const u8 *userKey, const int bits,
0019 struct aes_key *key);
0020 void aes_p8_encrypt(const u8 *in, u8 *out, const struct aes_key *key);
0021 void aes_p8_decrypt(const u8 *in, u8 *out, const struct aes_key *key);
0022 void aes_p8_cbc_encrypt(const u8 *in, u8 *out, size_t len,
0023 const struct aes_key *key, u8 *iv, const int enc);
0024 void aes_p8_ctr32_encrypt_blocks(const u8 *in, u8 *out,
0025 size_t len, const struct aes_key *key,
0026 const u8 *iv);
0027 void aes_p8_xts_encrypt(const u8 *in, u8 *out, size_t len,
0028 const struct aes_key *key1, const struct aes_key *key2, u8 *iv);
0029 void aes_p8_xts_decrypt(const u8 *in, u8 *out, size_t len,
0030 const struct aes_key *key1, const struct aes_key *key2, u8 *iv);