summaryrefslogtreecommitdiff
path: root/toxcore/crypto_core.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-04-18 13:13:29 -0400
committerirungentoo <irungentoo@gmail.com>2015-04-18 13:13:29 -0400
commitb4fc0809a7b42ba5d104793e909aecf85951f100 (patch)
tree0e56a65760b37fc5f2323df512f8d21818e1e0c6 /toxcore/crypto_core.h
parent453548f18149594af977dc63c8a1924d8a6bb2e6 (diff)
The only secure compare function currently needed is one to compare 2 public keys.
Diffstat (limited to 'toxcore/crypto_core.h')
-rw-r--r--toxcore/crypto_core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/crypto_core.h b/toxcore/crypto_core.h
index decc7fb9..d7306a8a 100644
--- a/toxcore/crypto_core.h
+++ b/toxcore/crypto_core.h
@@ -40,10 +40,10 @@
40 40
41#define crypto_box_KEYBYTES (crypto_box_BEFORENMBYTES) 41#define crypto_box_KEYBYTES (crypto_box_BEFORENMBYTES)
42 42
43/* Use this instead of memcmp; not vulnerable to timing attacks. 43/* compare 2 public keys of length crypto_box_PUBLICKEYBYTES, not vulnerable to timing attacks.
44 returns 0 if both mem locations of length are equal, 44 returns 0 if both mem locations of length are equal,
45 return -1 if they are not. */ 45 return -1 if they are not. */
46int crypto_cmp(const uint8_t *mem1, const uint8_t *mem2, size_t length); 46int public_key_cmp(const uint8_t *pk1, const uint8_t *pk2);
47 47
48/* return a random number. 48/* return a random number.
49 * 49 *