diff options
| author | Simon Rettberg | 2023-04-04 15:12:41 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2023-04-04 15:12:41 +0200 |
| commit | 5ba496dce11d10198a0eae0c8440dccb256fbf32 (patch) | |
| tree | 549903f1dab893870335a6e4767a4530444d2e83 /src/crypto/aes.c | |
| parent | [vesafb] Map Unicode characters to CP437 if possible (diff) | |
| parent | [tls] Handle fragmented handshake records (diff) | |
| download | ipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.tar.gz ipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.tar.xz ipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.zip | |
Merge branch 'master' into openslx
Diffstat (limited to 'src/crypto/aes.c')
| -rw-r--r-- | src/crypto/aes.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/crypto/aes.c b/src/crypto/aes.c index b9e206bfb..5200e7760 100644 --- a/src/crypto/aes.c +++ b/src/crypto/aes.c @@ -38,6 +38,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <ipxe/crypto.h> #include <ipxe/ecb.h> #include <ipxe/cbc.h> +#include <ipxe/gcm.h> #include <ipxe/aes.h> /** AES strides @@ -778,25 +779,18 @@ static int aes_setkey ( void *ctx, const void *key, size_t keylen ) { return 0; } -/** - * Set initialisation vector - * - * @v ctx Context - * @v iv Initialisation vector - */ -static void aes_setiv ( void *ctx __unused, const void *iv __unused ) { - /* Nothing to do */ -} - /** Basic AES algorithm */ struct cipher_algorithm aes_algorithm = { .name = "aes", .ctxsize = sizeof ( struct aes_context ), .blocksize = AES_BLOCKSIZE, + .alignsize = 0, + .authsize = 0, .setkey = aes_setkey, - .setiv = aes_setiv, + .setiv = cipher_null_setiv, .encrypt = aes_encrypt, .decrypt = aes_decrypt, + .auth = cipher_null_auth, }; /* AES in Electronic Codebook mode */ @@ -806,3 +800,7 @@ ECB_CIPHER ( aes_ecb, aes_ecb_algorithm, /* AES in Cipher Block Chaining mode */ CBC_CIPHER ( aes_cbc, aes_cbc_algorithm, aes_algorithm, struct aes_context, AES_BLOCKSIZE ); + +/* AES in Galois/Counter mode */ +GCM_CIPHER ( aes_gcm, aes_gcm_algorithm, + aes_algorithm, struct aes_context, AES_BLOCKSIZE ); |
