5 #define CONFIG "config.h"
17 //#define AES_ROUNDS (10)
18 #define AES_KEY_BYTES (16) // 128 Bits
19 #define AES_BLOCK_BYTES (16)
20 #define AES_BLOCK_WORDS (AES_BLOCK_BYTES / sizeof(DWORD))
21 #define AES_KEY_DWORDS (AES_KEY_BYTES / sizeof(DWORD))
22 //#define V4_ROUNDS (11)
23 #define V4_KEY_BYTES (20) // 160 Bits
25 #define ROR32(v, n) ( (v) << (32 - n) | (v) >> n )
27 void XorBlock(const BYTE
*const in
, const BYTE
*out
);
29 void AesCmacV4(BYTE
*data
, size_t len
, BYTE
*hash
);
31 extern const BYTE AesKeyV5
[];
32 extern const BYTE AesKeyV6
[];
35 DWORD Key
[48]; // Supports a maximum of 160 key bits!
39 void AesInitKey(AesCtx
*Ctx
, const BYTE
*Key
, int_fast8_t IsV6
, int AesKeyBytes
);
40 void AesEncryptBlock(const AesCtx
*const Ctx
, BYTE
*block
);
41 void AesDecryptBlock(const AesCtx
*const Ctx
, BYTE
*block
);
42 void AesEncryptCbc(const AesCtx
*const Ctx
, BYTE
*iv
, BYTE
*data
, size_t *len
);
43 void AesDecryptCbc(const AesCtx
*const Ctx
, BYTE
*iv
, BYTE
*data
, size_t len
);
44 void MixColumnsR(BYTE
*restrict state
);
46 #if defined(_CRYPTO_OPENSSL)
47 #include "crypto_openssl.h"
49 #elif defined(_CRYPTO_POLARSSL)
50 #include "crypto_polarssl.h"
52 #elif defined(_CRYPTO_WINDOWS)
53 #include "crypto_windows.h"
56 #include "crypto_internal.h"