123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #ifndef FPE_H
- #define FPE_H
- #include <stdio.h>
- #include "mydouble.h"
- #ifdef BENCH
- unsigned long long int multpcycles; unsigned long long int nummultp;
- unsigned long long int nummultzerop;
- unsigned long long int nummultonep;
- unsigned long long int sqpcycles; unsigned long long int numsqp;
- unsigned long long invpcycles; unsigned long long numinvp;
- #endif
- typedef struct fpe_struct fpe_struct_t;
- struct fpe_struct
- {
- mydouble v[12];
- } __attribute__ ((aligned (16)));
- typedef fpe_struct_t fpe_t[1];
- void fpe_short_coeffred(fpe_t rop);
- void fpe_set(fpe_t rop, const fpe_t op);
- void fpe_isreduced(fpe_t rop);
- void fpe_set_bytearray(fpe_t rop, const unsigned char *op, size_t oplen);
- void fpe_set_doublearray(fpe_t rop, const mydouble op[12]);
- void fpe_setone(fpe_t rop);
- void fpe_setzero(fpe_t rop);
- int fpe_iseq(const fpe_t op1, const fpe_t op2);
- int fpe_isone(const fpe_t op);
- int fpe_iszero(const fpe_t op);
- void fpe_neg(fpe_t rop, const fpe_t op);
- void fpe_double(fpe_t rop, const fpe_t op);
- void fpe_triple(fpe_t rop, const fpe_t op);
- void fpe_add(fpe_t rop, const fpe_t op1, const fpe_t op2);
- void fpe_sub(fpe_t rop, const fpe_t op1, const fpe_t op2);
- #ifdef QHASM
- #define fpe_mul fpe_mul_qhasm
- #else
- #define fpe_mul fpe_mul_c
- #endif
- void fpe_mul(fpe_t rop, const fpe_t op1, const fpe_t op2);
- void fpe_square(fpe_t rop, const fpe_t op);
- void fpe_invert(fpe_t rop, const fpe_t op1);
- void fpe_print(FILE * outfile, const fpe_t op);
- void fpe_to_bytearray(unsigned char * rop, const fpe_t op);
- #endif
|