diff options
author | Marcelo H. Cerri <mhcerri@linux.vnet.ibm.com> | 2015-02-06 14:57:22 -0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-02-28 23:13:44 +1300 |
commit | 8676590a159320a9de2a1818df14a3bac3f065a1 (patch) | |
tree | 810578e162f667820a59093f2086f31673c27cca /drivers/crypto/vmx/aesp8-ppc.h | |
parent | 20a26faa7e623fd1344bc39d201a27ea440b2ad2 (diff) | |
download | linux-8676590a159320a9de2a1818df14a3bac3f065a1.tar.bz2 |
crypto: vmx - Adding AES routines for VMX module
This patch adds AES routines to VMX module in order to
make use of VMX cryptographic acceleration instructions
on Power 8 CPU.
Signed-off-by: Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/vmx/aesp8-ppc.h')
-rw-r--r-- | drivers/crypto/vmx/aesp8-ppc.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/crypto/vmx/aesp8-ppc.h b/drivers/crypto/vmx/aesp8-ppc.h new file mode 100644 index 000000000000..e963945a83e1 --- /dev/null +++ b/drivers/crypto/vmx/aesp8-ppc.h @@ -0,0 +1,20 @@ +#include <linux/types.h> +#include <crypto/aes.h> + +#define AES_BLOCK_MASK (~(AES_BLOCK_SIZE-1)) + +struct aes_key { + u8 key[AES_MAX_KEYLENGTH]; + int rounds; +}; + +int aes_p8_set_encrypt_key(const u8 *userKey, const int bits, + struct aes_key *key); +int aes_p8_set_decrypt_key(const u8 *userKey, const int bits, + struct aes_key *key); +void aes_p8_encrypt(const u8 *in, u8 *out, const struct aes_key *key); +void aes_p8_decrypt(const u8 *in, u8 *out,const struct aes_key *key); +void aes_p8_cbc_encrypt(const u8 *in, u8 *out, size_t len, + const struct aes_key *key, u8 *iv, const int enc); +void aes_p8_ctr32_encrypt_blocks(const u8 *in, u8 *out, + size_t len, const struct aes_key *key, const u8 *iv); |