Co-authored-by: Jorge Chavez-Saab <jorgechavezsaab@gmail.com> Co-authored-by: Maria Corte-Real Santos <36373796+mariascrs@users.noreply.github.com> Co-authored-by: Luca De Feo <github@defeo.lu> Co-authored-by: Jonathan Komada Eriksen <jonathan.eriksen97@gmail.com> Co-authored-by: Basil Hess <bhe@zurich.ibm.com> Co-authored-by: Antonin Leroux <18654258+tonioecto@users.noreply.github.com> Co-authored-by: Patrick Longa <plonga@microsoft.com> Co-authored-by: Lorenz Panny <lorenz@yx7.cc> Co-authored-by: Francisco Rodríguez-Henríquez <francisco.rodriguez@tii.ae> Co-authored-by: Sina Schaeffler <108983332+syndrakon@users.noreply.github.com> Co-authored-by: Benjamin Wesolowski <19474926+Calodeon@users.noreply.github.com>
29 lines
717 B
C
Executable File
29 lines
717 B
C
Executable File
|
|
#ifndef TEST_EXTRAS_H
|
|
#define TEST_EXTRAS_H
|
|
|
|
#include <time.h>
|
|
#include <stdlib.h>
|
|
#include <fp.h>
|
|
#include <fp2.h>
|
|
#include <curve_extras.h>
|
|
|
|
#define PASSED 0
|
|
#define FAILED 1
|
|
|
|
// Access system counter for benchmarking
|
|
//int64_t cpucycles(void);
|
|
|
|
// Comparing "nword" elements, a=b? : (1) a!=b, (0) a=b
|
|
int compare_words(digit_t* a, digit_t* b, unsigned int nwords);
|
|
|
|
// Multiprecision subtraction for testing, assumes a > b
|
|
void sub_test(digit_t* out, digit_t* a, digit_t* b, unsigned int nwords);
|
|
|
|
// Generating a pseudo-random field element in [0, p-1]
|
|
void fprandom_test(digit_t* a);
|
|
|
|
// Generating a pseudo-random element in GF(p^2)
|
|
void fp2random_test(fp2_t* a);
|
|
|
|
#endif |