summaryrefslogtreecommitdiffstats
path: root/src/crypto.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-01 22:05:50 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-01 22:05:50 +0200
commit715f2e467f1c8990bb6a80652b1ad98d0369ff51 (patch)
treec920bb6967bc13c571859b893aca61279c45669c /src/crypto.h
parent181715c5bc6e74f87fe284b063ca301a300ad098 (diff)
downloadfastd-715f2e467f1c8990bb6a80652b1ad98d0369ff51.tar
fastd-715f2e467f1c8990bb6a80652b1ad98d0369ff51.zip
Add missing docs to secure_memequal and block_equal
Diffstat (limited to 'src/crypto.h')
-rw-r--r--src/crypto.h2
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;