10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
12 #include <ipxe/crypto.h>
15 #define AES_BLOCKSIZE 16
17 /** Maximum number of AES rounds */
18 #define AES_MAX_ROUNDS 15
22 /** Viewed as an array of bytes */
24 /** Viewed as an array of four-byte columns */
26 } __attribute__ (( packed ));
29 struct aes_round_keys {
31 union aes_matrix key[AES_MAX_ROUNDS];
36 /** Encryption keys */
37 struct aes_round_keys encrypt;
38 /** Decryption keys */
39 struct aes_round_keys decrypt;
40 /** Number of rounds */
44 /** AES context size */
45 #define AES_CTX_SIZE sizeof ( struct aes_context )
47 extern struct cipher_algorithm aes_algorithm;
48 extern struct cipher_algorithm aes_ecb_algorithm;
49 extern struct cipher_algorithm aes_cbc_algorithm;
51 int aes_wrap ( const void *kek, const void *src, void *dest, int nblk );
52 int aes_unwrap ( const void *kek, const void *src, void *dest, int nblk );
54 #endif /* _IPXE_AES_H */