scalar.h 829 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * File: dclxvi-20130329/scalar.h
  3. * Author: Ruben Niederhagen, Peter Schwabe
  4. * Public Domain
  5. */
  6. #ifndef SCALAR_H
  7. #define SCALAR_H
  8. #include <stdio.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. typedef unsigned long long scalar_t[4] ;
  13. void scalar_sub_nored(scalar_t r, scalar_t x, scalar_t y);
  14. void scalar_setrandom(scalar_t rop, const scalar_t bound);
  15. void scalar_set_lluarray(scalar_t rop, unsigned long long v[4]);
  16. int scalar_getbit(const scalar_t s, unsigned int pos);
  17. // Returns the position of the most significant set bit
  18. int scalar_scanb(const scalar_t s);
  19. int scalar_iszero_vartime(const scalar_t s);
  20. void scalar_window4(signed char r[64], const scalar_t s);
  21. int scalar_lt_vartime(const scalar_t a, const scalar_t b);
  22. void scalar_print(FILE *fh, const scalar_t t);
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif