Add aesni_crypt_ecb() and use it

This commit is contained in:
Manuel Pégourié-Gonnard 2013-12-18 11:45:21 +01:00
parent 92ac76f9db
commit 5b685653ef
4 changed files with 70 additions and 1 deletions

View file

@ -38,12 +38,27 @@
#if defined(POLARSSL_HAVE_X86_64)
/**
* \brief AES_NI detection routine
* \brief AES-NI detection routine
*
* \return 1 if CPU supports AES-NI, 0 otherwise
*/
int aesni_supported( void );
/**
* \brief AES-NI AES-ECB block en(de)cryption
*
* \param ctx AES context
* \param mode AES_ENCRYPT or AES_DECRYPT
* \param input 16-byte input block
* \param output 16-byte output block
*
* \return 0 if success, 1 if operation failed
*/
int aesni_crypt_ecb( aes_context *ctx,
int mode,
const unsigned char input[16],
unsigned char output[16] );
#endif /* POLARSSL_HAVE_X86_64 */
#endif /* POLARSSL_AESNI_H */