diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-10-14 00:20:14 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-10-14 00:20:14 +0200 |
commit | 6a7eabbfee8c8df1a21f3da6e0fd5643c40ee607 (patch) | |
tree | 4977b44281abe1554a985dea00302c1608df8e7b /aes.c | |
parent | e7bacdee090f62937eba802647b08f1a2657c7d9 (diff) |
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'aes.c')
-rw-r--r-- | aes.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -41,11 +41,10 @@ typedef struct { void aes_init(); aes_ctx_t *aes_alloc_ctx(unsigned char *key, size_t keyLen); -inline unsigned long aes_subword(unsigned long w); -inline unsigned long aes_rotword(unsigned long w); +unsigned long aes_subword(unsigned long w); +unsigned long aes_rotword(unsigned long w); void aes_keyexpansion(aes_ctx_t *ctx); - -inline unsigned char aes_mul_manual(unsigned char a, unsigned char b); // use aes_mul instead +unsigned char aes_mul_manual(unsigned char a, unsigned char b); // use aes_mul instead void aes_subbytes(aes_ctx_t *ctx); void aes_shiftrows(aes_ctx_t *ctx); @@ -204,7 +203,7 @@ aes_ctx_t *aes_alloc_ctx(unsigned char *key, size_t keyLen) return ctx; } -inline unsigned long aes_subword(unsigned long w) +unsigned long aes_subword(unsigned long w) { return g_aes_sbox[w & 0x000000ff] | (g_aes_sbox[(w & 0x0000ff00) >> 8] << 8) | @@ -212,7 +211,7 @@ inline unsigned long aes_subword(unsigned long w) (g_aes_sbox[(w & 0xff000000) >> 24] << 24); } -inline unsigned long aes_rotword(unsigned long w) +unsigned long aes_rotword(unsigned long w) { // May seem a bit different from the spec // It was changed because unsigned long is represented with little-endian convention on x86 @@ -241,7 +240,7 @@ void aes_keyexpansion(aes_ctx_t *ctx) } } -inline unsigned char aes_mul_manual(unsigned char a, unsigned char b) +unsigned char aes_mul_manual(unsigned char a, unsigned char b) { register unsigned short ac; register unsigned char ret; |