mirror of
https://github.com/ipxe/ipxe
synced 2026-02-28 03:11:18 +03:00
[crypto] Make AES context size and algorithm structure externally available
This is required to support modes of AES beyond cipher-block chaining. Signed-off-by: Marty Connor <mdc@etherboot.org>
This commit is contained in:
committed by
Marty Connor
parent
ff4d61de96
commit
2dfe4c414a
@@ -32,17 +32,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Basic AES blocksize */
|
|
||||||
#define AES_BLOCKSIZE 16
|
|
||||||
|
|
||||||
/** AES context */
|
|
||||||
struct aes_context {
|
|
||||||
/** AES context for AXTLS */
|
|
||||||
AES_CTX axtls_ctx;
|
|
||||||
/** Cipher is being used for decrypting */
|
|
||||||
int decrypting;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set key
|
* Set key
|
||||||
*
|
*
|
||||||
@@ -154,7 +143,7 @@ static void aes_decrypt ( void *ctx, const void *src, void *dst,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Basic AES algorithm */
|
/** Basic AES algorithm */
|
||||||
static struct cipher_algorithm aes_algorithm = {
|
struct cipher_algorithm aes_algorithm = {
|
||||||
.name = "aes",
|
.name = "aes",
|
||||||
.ctxsize = sizeof ( struct aes_context ),
|
.ctxsize = sizeof ( struct aes_context ),
|
||||||
.blocksize = AES_BLOCKSIZE,
|
.blocksize = AES_BLOCKSIZE,
|
||||||
|
|||||||
@@ -5,6 +5,23 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
|||||||
|
|
||||||
struct cipher_algorithm;
|
struct cipher_algorithm;
|
||||||
|
|
||||||
|
/** Basic AES blocksize */
|
||||||
|
#define AES_BLOCKSIZE 16
|
||||||
|
|
||||||
|
#include "crypto/axtls/crypto.h"
|
||||||
|
|
||||||
|
/** AES context */
|
||||||
|
struct aes_context {
|
||||||
|
/** AES context for AXTLS */
|
||||||
|
AES_CTX axtls_ctx;
|
||||||
|
/** Cipher is being used for decrypting */
|
||||||
|
int decrypting;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** AES context size */
|
||||||
|
#define AES_CTX_SIZE sizeof ( struct aes_context )
|
||||||
|
|
||||||
|
extern struct cipher_algorithm aes_algorithm;
|
||||||
extern struct cipher_algorithm aes_cbc_algorithm;
|
extern struct cipher_algorithm aes_cbc_algorithm;
|
||||||
|
|
||||||
#endif /* _GPXE_AES_H */
|
#endif /* _GPXE_AES_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user