-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtest_extras.h
40 lines (27 loc) · 1.11 KB
/
test_extras.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/***********************************************************************************
* FourQlib: a high-performance crypto library based on the elliptic curve FourQ
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* Abstract: utility header file for tests
************************************************************************************/
#ifndef __TEST_EXTRAS_H__
#define __TEST_EXTRAS_H__
// For C++
#ifdef __cplusplus
extern "C" {
#endif
// Access system counter for benchmarking
int64_t cpu_nseconds(void);
// Comparing uint64_t digits of two quadratic extension field elements, ai=bi? : (0) equal, (1) unequal
int fp2compare64(uint64_t* a, uint64_t* b);
// Generating a pseudo-random scalar value in [0, 2^256-1]
void random_scalar_test(uint64_t* a);
// Generating a pseudo-random GF(p^2) element a+b*i, where a,b in [0, 2^127-1]
void fp2random1271_test(f2elm_t a);
// Verification of the mLSB-set's recoding algorithm used in fixed-base scalar multiplication
bool verify_mLSB_recoding(uint64_t* scalar, int* digits);
#ifdef __cplusplus
}
#endif
#endif