17dcee0f8SGreg Tucker /********************************************************************** 27dcee0f8SGreg Tucker Copyright(c) 2011-2016 Intel Corporation All rights reserved. 37dcee0f8SGreg Tucker 47dcee0f8SGreg Tucker Redistribution and use in source and binary forms, with or without 57dcee0f8SGreg Tucker modification, are permitted provided that the following conditions 67dcee0f8SGreg Tucker are met: 77dcee0f8SGreg Tucker * Redistributions of source code must retain the above copyright 87dcee0f8SGreg Tucker notice, this list of conditions and the following disclaimer. 97dcee0f8SGreg Tucker * Redistributions in binary form must reproduce the above copyright 107dcee0f8SGreg Tucker notice, this list of conditions and the following disclaimer in 117dcee0f8SGreg Tucker the documentation and/or other materials provided with the 127dcee0f8SGreg Tucker distribution. 137dcee0f8SGreg Tucker * Neither the name of Intel Corporation nor the names of its 147dcee0f8SGreg Tucker contributors may be used to endorse or promote products derived 157dcee0f8SGreg Tucker from this software without specific prior written permission. 167dcee0f8SGreg Tucker 177dcee0f8SGreg Tucker THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 187dcee0f8SGreg Tucker "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 197dcee0f8SGreg Tucker LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 207dcee0f8SGreg Tucker A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 217dcee0f8SGreg Tucker OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 227dcee0f8SGreg Tucker SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 237dcee0f8SGreg Tucker LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 247dcee0f8SGreg Tucker DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 257dcee0f8SGreg Tucker THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 267dcee0f8SGreg Tucker (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 277dcee0f8SGreg Tucker OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 287dcee0f8SGreg Tucker **********************************************************************/ 297dcee0f8SGreg Tucker 307dcee0f8SGreg Tucker #ifndef _KEYEXP_128_H 317dcee0f8SGreg Tucker #define _KEYEXP_128_H 327dcee0f8SGreg Tucker 337dcee0f8SGreg Tucker /** 347dcee0f8SGreg Tucker * @file aes_keyexp.h 357dcee0f8SGreg Tucker * @brief AES key expansion functions 367dcee0f8SGreg Tucker * 377dcee0f8SGreg Tucker * This defines the interface to key expansion functions. 387dcee0f8SGreg Tucker */ 397dcee0f8SGreg Tucker 407dcee0f8SGreg Tucker #include <stdint.h> 41*cb5bcf4bSMarcel Cornu #include "types.h" 427dcee0f8SGreg Tucker 437dcee0f8SGreg Tucker #ifdef __cplusplus 447dcee0f8SGreg Tucker extern "C" { 457dcee0f8SGreg Tucker #endif 467dcee0f8SGreg Tucker 477dcee0f8SGreg Tucker /** @brief AES key expansion 128 bit 48*cb5bcf4bSMarcel Cornu * 497dcee0f8SGreg Tucker * @requires SSE4.1 50*cb5bcf4bSMarcel Cornu * @deprecated Please use isal_aes_keyexp_128() instead. 517dcee0f8SGreg Tucker */ 52*cb5bcf4bSMarcel Cornu ISAL_DEPRECATED("Please use isal_aes_keyexp_128() instead") 531de5344dSMarcel Cornu void 541de5344dSMarcel Cornu aes_keyexp_128(const uint8_t *key, //!< input key for AES-128, 16 bytes 557dcee0f8SGreg Tucker uint8_t *exp_key_enc, //!< expanded encryption keys, 16*11 bytes 567dcee0f8SGreg Tucker uint8_t *exp_key_dec //!< expanded decryption keys, 16*11 bytes 577dcee0f8SGreg Tucker ); 587dcee0f8SGreg Tucker 597dcee0f8SGreg Tucker /** @brief AES key expansion 192 bit 60*cb5bcf4bSMarcel Cornu * 617dcee0f8SGreg Tucker * @requires SSE4.1 62*cb5bcf4bSMarcel Cornu * @deprecated Please use isal_aes_keyexp_192() instead. 637dcee0f8SGreg Tucker */ 64*cb5bcf4bSMarcel Cornu ISAL_DEPRECATED("Please use isal_aes_keyexp_192() instead") 651de5344dSMarcel Cornu void 661de5344dSMarcel Cornu aes_keyexp_192(const uint8_t *key, //!< input key for AES-192, 16*1.5 bytes 677dcee0f8SGreg Tucker uint8_t *exp_key_enc, //!< expanded encryption keys, 16*13 bytes 687dcee0f8SGreg Tucker uint8_t *exp_key_dec //!< expanded decryption keys, 16*13 bytes 697dcee0f8SGreg Tucker ); 707dcee0f8SGreg Tucker 717dcee0f8SGreg Tucker /** @brief AES key expansion 256 bit 72*cb5bcf4bSMarcel Cornu * 737dcee0f8SGreg Tucker * @requires SSE4.1 74*cb5bcf4bSMarcel Cornu * @deprecated Please use isal_aes_keyexp_256() instead. 757dcee0f8SGreg Tucker */ 76*cb5bcf4bSMarcel Cornu ISAL_DEPRECATED("Please use isal_aes_keyexp_256() instead") 771de5344dSMarcel Cornu void 781de5344dSMarcel Cornu aes_keyexp_256(const uint8_t *key, //!< input key for AES-256, 16*2 bytes 797dcee0f8SGreg Tucker uint8_t *exp_key_enc, //!< expanded encryption keys, 16*15 bytes 807dcee0f8SGreg Tucker uint8_t *exp_key_dec //!< expanded decryption keys, 16*15 bytes 817dcee0f8SGreg Tucker ); 827dcee0f8SGreg Tucker 837080fff2SMarcel Cornu /** 847080fff2SMarcel Cornu * @brief AES key expansion 128 bit 857080fff2SMarcel Cornu * @requires AES extensions and SSE4.1 for x86 or ASIMD for ARM 867080fff2SMarcel Cornu * @return Operation status 877080fff2SMarcel Cornu * @retval 0 on success 887080fff2SMarcel Cornu * @retval Non-zero \a ISAL_CRYPTO_ERR on failure 897080fff2SMarcel Cornu */ 901de5344dSMarcel Cornu int 911de5344dSMarcel Cornu isal_aes_keyexp_128(const uint8_t *key, //!< input key for AES-128, 16 bytes 927080fff2SMarcel Cornu uint8_t *exp_key_enc, //!< expanded encryption keys, 16*11 bytes 937080fff2SMarcel Cornu uint8_t *exp_key_dec //!< expanded decryption keys, 16*11 bytes 947080fff2SMarcel Cornu ); 957080fff2SMarcel Cornu 967080fff2SMarcel Cornu /** 977080fff2SMarcel Cornu * @brief AES key expansion 192 bit 987080fff2SMarcel Cornu * @requires AES extensions and SSE4.1 for x86 or ASIMD for ARM 997080fff2SMarcel Cornu * @return Operation status 1007080fff2SMarcel Cornu * @retval 0 on success 1017080fff2SMarcel Cornu * @retval Non-zero \a ISAL_CRYPTO_ERR on failure 1027080fff2SMarcel Cornu */ 1031de5344dSMarcel Cornu int 1041de5344dSMarcel Cornu isal_aes_keyexp_192(const uint8_t *key, //!< input key for AES-192, 24 bytes 1057080fff2SMarcel Cornu uint8_t *exp_key_enc, //!< expanded encryption keys, 16*13 bytes 1067080fff2SMarcel Cornu uint8_t *exp_key_dec //!< expanded decryption keys, 16*13 bytes 1077080fff2SMarcel Cornu ); 1087080fff2SMarcel Cornu 1097080fff2SMarcel Cornu /** 1107080fff2SMarcel Cornu * @brief AES key expansion 256 bit 1117080fff2SMarcel Cornu * @requires AES extensions and SSE4.1 for x86 or ASIMD for ARM 1127080fff2SMarcel Cornu * @return Operation status 1137080fff2SMarcel Cornu * @retval 0 on success 1147080fff2SMarcel Cornu * @retval Non-zero \a ISAL_CRYPTO_ERR on failure 1157080fff2SMarcel Cornu */ 1161de5344dSMarcel Cornu int 1171de5344dSMarcel Cornu isal_aes_keyexp_256(const uint8_t *key, //!< input key for AES-256, 32 bytes 1187080fff2SMarcel Cornu uint8_t *exp_key_enc, //!< expanded encryption keys, 16*15 bytes 1197080fff2SMarcel Cornu uint8_t *exp_key_dec //!< expanded decryption keys, 16*15 bytes 1207080fff2SMarcel Cornu ); 1217080fff2SMarcel Cornu 1227dcee0f8SGreg Tucker #ifdef __cplusplus 1237dcee0f8SGreg Tucker } 1247dcee0f8SGreg Tucker #endif //__cplusplus 1257dcee0f8SGreg Tucker #endif // ifndef _KEYEXP_128_H 126