Co-authored-by: Marius A. Aardal <marius.andre.aardal@gmail.com> Co-authored-by: Gora Adj <gora.adj@tii.ae> Co-authored-by: Diego F. Aranha <dfaranha@cs.au.dk> Co-authored-by: Andrea Basso <sqisign@andreabasso.com> Co-authored-by: Isaac Andrés Canales Martínez <icanalesm0500@gmail.com> Co-authored-by: Jorge Chávez-Saab <jorgechavezsaab@gmail.com> Co-authored-by: Maria Corte-Real Santos <mariascrsantos98@gmail.com> Co-authored-by: Luca De Feo <github@defeo.lu> Co-authored-by: Max Duparc <max.duparc@epfl.ch> Co-authored-by: Jonathan Komada Eriksen <jonathan.eriksen97@gmail.com> Co-authored-by: Décio Luiz Gazzoni Filho <decio@decpp.net> Co-authored-by: Basil Hess <bhe@zurich.ibm.com> Co-authored-by: Antonin Leroux <antonin.leroux@polytechnique.org> Co-authored-by: Patrick Longa <plonga@microsoft.com> Co-authored-by: Luciano Maino <mainoluciano.96@gmail.com> Co-authored-by: Michael Meyer <michael@random-oracles.org> Co-authored-by: Hiroshi Onuki <onuki@mist.i.u-tokyo.ac.jp> Co-authored-by: Lorenz Panny <lorenz@yx7.cc> Co-authored-by: Giacomo Pope <giacomopope@gmail.com> Co-authored-by: Krijn Reijnders <reijnderskrijn@gmail.com> Co-authored-by: Damien Robert <damien.robert@inria.fr> Co-authored-by: Francisco Rodríguez-Henriquez <francisco.rodriguez@tii.ae> Co-authored-by: Sina Schaeffler <sschaeffle@student.ethz.ch> Co-authored-by: Benjamin Wesolowski <benjamin.wesolowski@ens-lyon.fr>
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
|
|
#ifndef TEST_EXTRAS_H
|
|
#define TEST_EXTRAS_H
|
|
|
|
#include <assert.h>
|
|
#include <time.h>
|
|
#include <stdlib.h>
|
|
#include <encoded_sizes.h>
|
|
#include <ec.h>
|
|
#include <fp.h>
|
|
#include <fp2.h>
|
|
|
|
#define PASSED 0
|
|
#define FAILED 1
|
|
|
|
// Generating a pseudo-random field element in [0, p-1]
|
|
void fp_random_test(fp_t *a);
|
|
|
|
// Generating a pseudo-random element in GF(p^2)
|
|
void fp2_random_test(fp2_t *a);
|
|
|
|
// Generating a random projective x-only point
|
|
void ec_random_test(ec_point_t *P, const ec_curve_t *curve);
|
|
|
|
// Generating a random projective x-only point and normalizing it
|
|
void ec_random_normalized_test(ec_point_t *P, const ec_curve_t *curve);
|
|
|
|
// Point difference
|
|
void projective_difference_point(ec_point_t *PQ, const ec_point_t *P, const ec_point_t *Q, const ec_curve_t *curve);
|
|
|
|
// xDBL
|
|
void xDBL(ec_point_t *Q, const ec_point_t *P, const ec_point_t *AC);
|
|
|
|
// Double-and-add
|
|
extern void xDBLADD(ec_point_t *R,
|
|
ec_point_t *S,
|
|
const ec_point_t *P,
|
|
const ec_point_t *Q,
|
|
const ec_point_t *PQ,
|
|
const ec_point_t *A24,
|
|
const bool A24_normalized);
|
|
|
|
#endif
|