mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +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];
|
byte i[AES_BLOCK_SIZE];
|
||||||
|
|
||||||
XMEMSET(i, 0, AES_BLOCK_SIZE);
|
XMEMSET(i, 0, AES_BLOCK_SIZE);
|
||||||
|
#ifdef BIG_ENDIAN_ORDER
|
||||||
|
sector = ByteReverseWord64(sector);
|
||||||
|
#endif
|
||||||
pt = (byte*)§or;
|
pt = (byte*)§or;
|
||||||
XMEMCPY(i, pt, sizeof(word64));
|
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];
|
byte i[AES_BLOCK_SIZE];
|
||||||
|
|
||||||
XMEMSET(i, 0, AES_BLOCK_SIZE);
|
XMEMSET(i, 0, AES_BLOCK_SIZE);
|
||||||
|
#ifdef BIG_ENDIAN_ORDER
|
||||||
|
sector = ByteReverseWord64(sector);
|
||||||
|
#endif
|
||||||
pt = (byte*)§or;
|
pt = (byte*)§or;
|
||||||
XMEMCPY(i, pt, sizeof(word64));
|
XMEMCPY(i, pt, sizeof(word64));
|
||||||
|
|
||||||
|
@@ -110,11 +110,11 @@ typedef struct Aes {
|
|||||||
word32 key_init[8];
|
word32 key_init[8];
|
||||||
word32 kup;
|
word32 kup;
|
||||||
#endif
|
#endif
|
||||||
|
void* heap; /* memory hint to use */
|
||||||
#ifdef WOLFSSL_AES_XTS
|
#ifdef WOLFSSL_AES_XTS
|
||||||
byte type; /* adds the ability to do a sanity check on key for
|
byte type; /* adds the ability to do a sanity check on key for
|
||||||
* encrypt/decrypt */
|
* encrypt/decrypt */
|
||||||
#endif
|
#endif
|
||||||
void* heap; /* memory hint to use */
|
|
||||||
} Aes;
|
} Aes;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user