Skip to content

Commit

Permalink
Remove aes::ghash in favour of GhashState
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Dec 1, 2024
1 parent f24e409 commit e79adc7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
13 changes: 0 additions & 13 deletions soup/aes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,19 +932,6 @@ NAMESPACE_SOUP
}
}

void aes::ghash(uint8_t res[16], const uint8_t h[16], const uint8_t x[], size_t x_bytes) noexcept
{
memset(res, 0, 16);
const auto x_blocks = (x_bytes / 16);
uint8_t tmp[16];
for (size_t i = 0; i != x_blocks; ++i)
{
xorBlocks(res, &x[i * 16]);
memcpy(tmp, res, 16);
mulBlocks(res, tmp, h);
}
}

void aes::calcH(uint8_t h[16], uint8_t roundKeys[240], const int Nr) noexcept
{
memset(h, 0, 16);
Expand Down
1 change: 0 additions & 1 deletion soup/aes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ NAMESPACE_SOUP

static SOUP_FORCEINLINE void rshiftBlock(uint8_t block[16]) noexcept;
static void mulBlocks(uint8_t res[16], const uint8_t x[16], const uint8_t y[16]) noexcept;
static void ghash(uint8_t res[16], const uint8_t h[16], const uint8_t x[], size_t x_bytes) noexcept;
static void calcH(uint8_t h[16], uint8_t roundKeys[240], const int Nr) noexcept;
static void calcJ0(uint8_t j0[16], const uint8_t h[16], const uint8_t* iv, size_t iv_len) noexcept;
static void inc32(uint8_t block[16]) noexcept;
Expand Down

0 comments on commit e79adc7

Please sign in to comment.