52 static const uint8_t one[] = { 1 };
71 point ) != 0, file, line );
79 bigint_done ( &temp.scalar, scalar, sizeof ( scalar ) );
82 okx (
memcmp ( point, curve->
base, pointsize ) == 0, file, line );
93 const char *file,
unsigned int line ) {
111 if (
test->expected_len ) {
112 okx (
rc == 0, file, line );
114 okx (
rc != 0, file, line );
130 const char *file,
unsigned int line ) {
144 if (
test->expected_len ) {
145 okx (
rc == 0, file, line );
147 okx (
rc != 0, file, line );
struct arbelprm_rc_send_wqe rc
static int elliptic_multiply(struct elliptic_curve *curve, const void *base, const void *scalar, void *result)
const void * order
Order of the generator (if prime)
An elliptic curve point multiplication test.
void elliptic_multiply_okx(struct elliptic_multiply_test *test, const char *file, unsigned int line)
Report elliptic curve point multiplication test result.
#define bigint_init(value, data, len)
Initialise big integer.
Self-test infrastructure.
#define okx(success, file, line)
Report test result.
#define bigint_done(value, out, len)
Finalise big integer.
size_t keysize
Scalar (and private key) size.
#define bigint_required_size(len)
Determine number of elements required for a big-integer type.
An elliptic curve point addition test.
u16 keysize
Length of encryption key to be used, network byte order.
void elliptic_add_okx(struct elliptic_add_test *test, const char *file, unsigned int line)
Report elliptic curve point addition test result.
static int elliptic_add(struct elliptic_curve *curve, const void *addend, const void *augend, void *result)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
const void * base
Generator base point.
size_t pointsize
Point (and public key) size.
void elliptic_curve_okx(struct elliptic_curve *curve, const char *file, unsigned int line)
Report elliptic curve sanity test result.
#define bigint_add(addend, value)
Add big integers.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
typedef bigint_t(X25519_SIZE) x25519_t
An X25519 unsigned big integer used in internal calculations.