Refactored keccak interface

This commit is contained in:
SChernykh
2023-11-24 14:20:11 +01:00
parent 65d83aa09c
commit 1bf594d9e2
4 changed files with 22 additions and 24 deletions

View File

@@ -36,7 +36,7 @@ static const uint64_t keccakf_rndc[24] =
0x8000000000008080, 0x0000000080000001, 0x8000000080008008
};
NOINLINE void keccakf(uint64_t (&st)[25])
NOINLINE void keccakf(std::array<uint64_t, 25>& st)
{
for (int round = 0; round < KeccakParams::ROUNDS; ++round) {
uint64_t bc[5];
@@ -115,7 +115,7 @@ NOINLINE void keccakf(uint64_t (&st)[25])
}
}
NOINLINE void keccak_step(const uint8_t* &in, int &inlen, uint64_t (&st)[25])
NOINLINE void keccak_step(const uint8_t* &in, int &inlen, std::array<uint64_t, 25>& st)
{
constexpr int rsiz = KeccakParams::HASH_DATA_AREA;
constexpr int rsizw = rsiz / 8;
@@ -128,7 +128,7 @@ NOINLINE void keccak_step(const uint8_t* &in, int &inlen, uint64_t (&st)[25])
}
}
NOINLINE void keccak_finish(const uint8_t* in, int inlen, uint64_t (&st)[25])
NOINLINE void keccak_finish(const uint8_t* in, int inlen, std::array<uint64_t, 25>& st)
{
constexpr int rsiz = KeccakParams::HASH_DATA_AREA;
constexpr int rsizw = rsiz / 8;