diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-01 22:05:50 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-01 22:05:50 +0200 |
commit | 715f2e467f1c8990bb6a80652b1ad98d0369ff51 (patch) | |
tree | c920bb6967bc13c571859b893aca61279c45669c /src | |
parent | 181715c5bc6e74f87fe284b063ca301a300ad098 (diff) | |
download | fastd-715f2e467f1c8990bb6a80652b1ad98d0369ff51.tar fastd-715f2e467f1c8990bb6a80652b1ad98d0369ff51.zip |
Add missing docs to secure_memequal and block_equal
Diffstat (limited to 'src')
-rw-r--r-- | src/crypto.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crypto.h b/src/crypto.h index 561eb27..c55e931 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -96,6 +96,7 @@ static inline void secure_memzero(void *s, size_t n) { __asm__ volatile("" : : "m"(s)); } +/** Checks if two blocks of memory are equal in constant time */ static inline bool secure_memequal(const void *s1, const void *s2, size_t n) { uint8_t v = 0; const uint8_t *i1 = s1, *i2 = s2; @@ -107,6 +108,7 @@ static inline bool secure_memequal(const void *s1, const void *s2, size_t n) { return (v == 0); } +/** Checks if two 128bit blocks are equal in constant time */ static inline bool block_equal(const fastd_block128_t *a, const fastd_block128_t *b) { uint32_t v = 0; |