xref: /isa-l_crypto/include/aes_keyexp_internal.h (revision cb5bcf4bd97d613e01e46f9941ec2cff2fa58a33)
1*cb5bcf4bSMarcel Cornu /**********************************************************************
2*cb5bcf4bSMarcel Cornu   Copyright(c) 2024 Intel Corporation All rights reserved.
3*cb5bcf4bSMarcel Cornu 
4*cb5bcf4bSMarcel Cornu   Redistribution and use in source and binary forms, with or without
5*cb5bcf4bSMarcel Cornu   modification, are permitted provided that the following conditions
6*cb5bcf4bSMarcel Cornu   are met:
7*cb5bcf4bSMarcel Cornu     * Redistributions of source code must retain the above copyright
8*cb5bcf4bSMarcel Cornu       notice, this list of conditions and the following disclaimer.
9*cb5bcf4bSMarcel Cornu     * Redistributions in binary form must reproduce the above copyright
10*cb5bcf4bSMarcel Cornu       notice, this list of conditions and the following disclaimer in
11*cb5bcf4bSMarcel Cornu       the documentation and/or other materials provided with the
12*cb5bcf4bSMarcel Cornu       distribution.
13*cb5bcf4bSMarcel Cornu     * Neither the name of Intel Corporation nor the names of its
14*cb5bcf4bSMarcel Cornu       contributors may be used to endorse or promote products derived
15*cb5bcf4bSMarcel Cornu       from this software without specific prior written permission.
16*cb5bcf4bSMarcel Cornu 
17*cb5bcf4bSMarcel Cornu   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18*cb5bcf4bSMarcel Cornu   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19*cb5bcf4bSMarcel Cornu   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20*cb5bcf4bSMarcel Cornu   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21*cb5bcf4bSMarcel Cornu   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22*cb5bcf4bSMarcel Cornu   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23*cb5bcf4bSMarcel Cornu   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24*cb5bcf4bSMarcel Cornu   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25*cb5bcf4bSMarcel Cornu   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26*cb5bcf4bSMarcel Cornu   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27*cb5bcf4bSMarcel Cornu   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*cb5bcf4bSMarcel Cornu **********************************************************************/
29*cb5bcf4bSMarcel Cornu 
30*cb5bcf4bSMarcel Cornu #ifndef _AES_KEYEXP_INTERNAL_H
31*cb5bcf4bSMarcel Cornu #define _AES_KEYEXP_INTERNAL_H
32*cb5bcf4bSMarcel Cornu 
33*cb5bcf4bSMarcel Cornu #include <stdint.h>
34*cb5bcf4bSMarcel Cornu 
35*cb5bcf4bSMarcel Cornu #ifdef __cplusplus
36*cb5bcf4bSMarcel Cornu extern "C" {
37*cb5bcf4bSMarcel Cornu #endif
38*cb5bcf4bSMarcel Cornu 
39*cb5bcf4bSMarcel Cornu void
40*cb5bcf4bSMarcel Cornu _aes_keyexp_128(const uint8_t *key,   //!< input key for AES-128, 16 bytes
41*cb5bcf4bSMarcel Cornu                 uint8_t *exp_key_enc, //!< expanded encryption keys, 16*11 bytes
42*cb5bcf4bSMarcel Cornu                 uint8_t *exp_key_dec  //!< expanded decryption keys, 16*11 bytes
43*cb5bcf4bSMarcel Cornu );
44*cb5bcf4bSMarcel Cornu 
45*cb5bcf4bSMarcel Cornu void
46*cb5bcf4bSMarcel Cornu _aes_keyexp_192(const uint8_t *key,   //!< input key for AES-192, 16*1.5 bytes
47*cb5bcf4bSMarcel Cornu                 uint8_t *exp_key_enc, //!< expanded encryption keys, 16*13 bytes
48*cb5bcf4bSMarcel Cornu                 uint8_t *exp_key_dec  //!< expanded decryption keys, 16*13 bytes
49*cb5bcf4bSMarcel Cornu );
50*cb5bcf4bSMarcel Cornu 
51*cb5bcf4bSMarcel Cornu void
52*cb5bcf4bSMarcel Cornu _aes_keyexp_256(const uint8_t *key,   //!< input key for AES-256, 16*2 bytes
53*cb5bcf4bSMarcel Cornu                 uint8_t *exp_key_enc, //!< expanded encryption keys, 16*15 bytes
54*cb5bcf4bSMarcel Cornu                 uint8_t *exp_key_dec  //!< expanded decryption keys, 16*15 bytes
55*cb5bcf4bSMarcel Cornu );
56*cb5bcf4bSMarcel Cornu 
57*cb5bcf4bSMarcel Cornu #ifdef __cplusplus
58*cb5bcf4bSMarcel Cornu }
59*cb5bcf4bSMarcel Cornu #endif //__cplusplus
60*cb5bcf4bSMarcel Cornu #endif // ifndef _AES_KEYEXP_INTERNAL_H
61