mirror of
https://github.com/sheumann/65816-crypto.git
synced 2024-11-21 01:31:14 +00:00
Make AES-CMAC context slightly smaller.
Since AES-CMAC is based on AES-128, the state specific to AES-CMAC can overlap the latter parts of the AES context structure, which are used only by AES-192 or AES-256.
This commit is contained in:
parent
6a1eeb40ea
commit
e1ea84f11a
13
aes.h
13
aes.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Stephen Heumann
|
||||
* Copyright (c) 2017,2024 Stephen Heumann
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -22,9 +22,14 @@ struct aes_context {
|
||||
};
|
||||
|
||||
struct aes_cmac_context {
|
||||
struct aes_context ctx;
|
||||
unsigned char k1[16];
|
||||
unsigned char k2[16];
|
||||
union {
|
||||
struct aes_context ctx;
|
||||
struct {
|
||||
unsigned char padding[16+17+32+16*9];
|
||||
unsigned char k1[16];
|
||||
unsigned char k2[16];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user