From 715f2e467f1c8990bb6a80652b1ad98d0369ff51 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 1 Sep 2014 22:05:50 +0200 Subject: Add missing docs to secure_memequal and block_equal --- src/crypto.h | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3