aboutsummaryrefslogtreecommitdiffstats
path: root/libblake.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-01-19 20:28:55 +0100
committerMattias Andrée <maandree@kth.se>2022-01-19 20:28:55 +0100
commit5d77a0178349ecac6536e0374cf689500efa22bc (patch)
treef6fcb38cd39e8f4240537233a08fdbb5c0284798 /libblake.h
parentImprove portability (diff)
downloadlibblake-5d77a0178349ecac6536e0374cf689500efa22bc.tar.gz
libblake-5d77a0178349ecac6536e0374cf689500efa22bc.tar.bz2
libblake-5d77a0178349ecac6536e0374cf689500efa22bc.tar.xz
Optimisation for amd64
Increased major number as the ABI was broken by insertion of padding into the BLAKE2 parameter structures (except for BLAKE2Xs) Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libblake.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libblake.h b/libblake.h
index 70b5a09..48c2ca1 100644
--- a/libblake.h
+++ b/libblake.h
@@ -86,6 +86,7 @@ struct libblake_blake2s_params {
uint_least64_t node_offset; /* (48-bits) normally 0 */
uint_least8_t node_depth; /* normally 0 */
uint_least8_t inner_len; /* normally 0 */
+ uint_least8_t _padding[2]; /* to keep .salt and .pepper aligned as uint_least32_t */
uint_least8_t salt[8];
uint_least8_t pepper[8];
};
@@ -99,6 +100,7 @@ struct libblake_blake2b_params {
uint_least64_t node_offset; /* normally 0 */
uint_least8_t node_depth; /* normally 0 */
uint_least8_t inner_len; /* normally 0 */
+ uint_least8_t _padding[6]; /* to keep .salt and .pepper aligned as uint_least64_t */
uint_least8_t salt[16];
uint_least8_t pepper[16];
};
@@ -127,6 +129,7 @@ struct libblake_blake2xb_params {
uint_least32_t xof_len; /* max if not known in advance */
uint_least8_t node_depth; /* normally 0 */
uint_least8_t inner_len; /* normally 0 */
+ uint_least8_t _padding[2]; /* to keep .salt and .pepper aligned as uint_least32_t */
uint_least8_t salt[16];
uint_least8_t pepper[16];
};