From b4fc0809a7b42ba5d104793e909aecf85951f100 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 18 Apr 2015 13:13:29 -0400 Subject: The only secure compare function currently needed is one to compare 2 public keys. --- toxcore/crypto_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toxcore/crypto_core.h') 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 @@ #define crypto_box_KEYBYTES (crypto_box_BEFORENMBYTES) -/* Use this instead of memcmp; not vulnerable to timing attacks. +/* compare 2 public keys of length crypto_box_PUBLICKEYBYTES, not vulnerable to timing attacks. returns 0 if both mem locations of length are equal, return -1 if they are not. */ -int crypto_cmp(const uint8_t *mem1, const uint8_t *mem2, size_t length); +int public_key_cmp(const uint8_t *pk1, const uint8_t *pk2); /* return a random number. * -- cgit v1.2.3