diff options
author | Mattias Andrée <maandree@kth.se> | 2022-01-21 18:29:26 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-01-21 18:29:26 +0100 |
commit | 839a3d17d257e73be9bc99dfa90e56c0824050ba (patch) | |
tree | 6bb010351447edbb0ae8d910948b01837d2de9e5 /libblake_internal_blake2s_compress.c | |
parent | Fix memory corruption bug in test.c and simplify message byte-length calculation (diff) | |
download | libblake-839a3d17d257e73be9bc99dfa90e56c0824050ba.tar.gz libblake-839a3d17d257e73be9bc99dfa90e56c0824050ba.tar.bz2 libblake-839a3d17d257e73be9bc99dfa90e56c0824050ba.tar.xz |
Initial work on optimising compression function; mm128 version is slower, mm256 version is barely faster
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libblake_internal_blake2s_compress.c')
-rw-r--r-- | libblake_internal_blake2s_compress.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libblake_internal_blake2s_compress.c b/libblake_internal_blake2s_compress.c index 37a61eb..c41876a 100644 --- a/libblake_internal_blake2s_compress.c +++ b/libblake_internal_blake2s_compress.c @@ -4,6 +4,7 @@ static uint_least32_t decode_uint32_le(const unsigned char *data) { + /* This is perfectly optimised by the compiler */ return (((uint_least32_t)(data[0] & 255)) << 0) | (((uint_least32_t)(data[1] & 255)) << 8) | (((uint_least32_t)(data[2] & 255)) << 16) | @@ -13,6 +14,7 @@ decode_uint32_le(const unsigned char *data) static uint_least32_t rotate_right(uint_least32_t x, int n) { + /* This is perfectly optimised by the compiler */ return ((x >> n) | (x << (32 - n))) & UINT_LEAST32_C(0xFFFFffff); } |