mirror of
https://github.com/sheumann/65816-crypto.git
synced 2024-11-21 16:31:11 +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
7
aes.h
7
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,10 +22,15 @@ struct aes_context {
|
||||
};
|
||||
|
||||
struct aes_cmac_context {
|
||||
union {
|
||||
struct aes_context ctx;
|
||||
struct {
|
||||
unsigned char padding[16+17+32+16*9];
|
||||
unsigned char k1[16];
|
||||
unsigned char k2[16];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* The context structure must be in bank 0, preferably page-aligned.
|
||||
|
Loading…
Reference in New Issue
Block a user