mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
big endian testing and packing Aes struct
This commit is contained in:
@@ -8100,6 +8100,9 @@ int wc_AesXtsEncryptSector(Aes* tweak, Aes* aes, byte* out, const byte* in,
|
||||
byte i[AES_BLOCK_SIZE];
|
||||
|
||||
XMEMSET(i, 0, AES_BLOCK_SIZE);
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
sector = ByteReverseWord64(sector);
|
||||
#endif
|
||||
pt = (byte*)§or;
|
||||
XMEMCPY(i, pt, sizeof(word64));
|
||||
|
||||
@@ -8127,6 +8130,9 @@ int wc_AesXtsDecryptSector(Aes* tweak, Aes* aes, byte* out, const byte* in, word
|
||||
byte i[AES_BLOCK_SIZE];
|
||||
|
||||
XMEMSET(i, 0, AES_BLOCK_SIZE);
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
sector = ByteReverseWord64(sector);
|
||||
#endif
|
||||
pt = (byte*)§or;
|
||||
XMEMCPY(i, pt, sizeof(word64));
|
||||
|
||||
|
@@ -110,11 +110,11 @@ typedef struct Aes {
|
||||
word32 key_init[8];
|
||||
word32 kup;
|
||||
#endif
|
||||
void* heap; /* memory hint to use */
|
||||
#ifdef WOLFSSL_AES_XTS
|
||||
byte type; /* adds the ability to do a sanity check on key for
|
||||
* encrypt/decrypt */
|
||||
#endif
|
||||
void* heap; /* memory hint to use */
|
||||
} Aes;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user