1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2014, STMicroelectronics International N.V. 4 * All rights reserved. 5 */ 6 7 #ifndef AES_IMPL_H 8 #define AES_IMPL_H 9 10 int rijndaelSetupEncrypt(unsigned long *rk, const unsigned char *key, 11 int keybits); 12 13 int rijndaelSetupDecrypt(unsigned long *rk, const unsigned char *key, 14 int keybits); 15 16 void rijndaelEncrypt(const unsigned long *rk, int nrounds, 17 const unsigned char plaintext[16], 18 unsigned char ciphertext[16]); 19 20 void rijndaelDecrypt(const unsigned long *rk, int nrounds, 21 const unsigned char ciphertext[16], 22 unsigned char plaintext[16]); 23 24 #define AES_BLOCK_SIZE 128 25 26 #define AES_128 128 27 #define AES_192 192 28 #define AES_256 256 29 30 #define KEYLENGTH(keybits) ((keybits)/8) 31 #define RKLENGTH(keybits) ((keybits)/8+28) 32 #define NROUNDS(keybits) ((keybits)/32+6) 33 34 #endif 35