1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-26 17:31:38 +00:00

another vs warning

This commit is contained in:
Matthias J. Kannwischer 2019-06-18 12:07:48 +02:00
parent ef0ad8e752
commit 03596d4705
2 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,7 @@ Vadim Lyubashevsky, John M. Schanck, Peter Schwabe & Damien stehle
#include <stdint.h> #include <stdint.h>
/* returns 0 for equal strings, 1 for non-equal strings */ /* returns 0 for equal strings, 1 for non-equal strings */
int PQCLEAN_SABER_CLEAN_verify(const unsigned char *a, const unsigned char *b, size_t len) { unsigned char PQCLEAN_SABER_CLEAN_verify(const unsigned char *a, const unsigned char *b, size_t len) {
uint64_t r; uint64_t r;
size_t i; size_t i;
r = 0; r = 0;
@ -19,7 +19,7 @@ int PQCLEAN_SABER_CLEAN_verify(const unsigned char *a, const unsigned char *b, s
} }
r = (-r) >> 63; r = (-r) >> 63;
return r; return (unsigned char) r;
} }
/* b = 1 means mov, b = 0 means don't mov*/ /* b = 1 means mov, b = 0 means don't mov*/

View File

@ -9,9 +9,10 @@ Vadim Lyubashevsky, John M. Schanck, Peter Schwabe & Damien stehle
#define VERIFY_H #define VERIFY_H
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
/* returns 0 for equal strings, 1 for non-equal strings */ /* returns 0 for equal strings, 1 for non-equal strings */
int PQCLEAN_SABER_CLEAN_verify(const unsigned char *a, const unsigned char *b, size_t len); unsigned char PQCLEAN_SABER_CLEAN_verify(const unsigned char *a, const unsigned char *b, size_t len);
/* b = 1 means mov, b = 0 means don't mov*/ /* b = 1 means mov, b = 0 means don't mov*/
void PQCLEAN_SABER_CLEAN_cmov(unsigned char *r, const unsigned char *x, size_t len, unsigned char b); void PQCLEAN_SABER_CLEAN_cmov(unsigned char *r, const unsigned char *x, size_t len, unsigned char b);