keygeneration.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * keygeneration.h
  3. *
  4. * Created on: May 3, 2018
  5. * Author: Gustavo Banegas
  6. */
  7. #ifndef SRC_KEYGENERATION_H_
  8. #define SRC_KEYGENERATION_H_
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <sys/resource.h>
  12. #include <sodium.h>
  13. #include "../include/parameters/param.h"
  14. #include "../include/definitions.h"
  15. #include "structures/matrix_operations.h"
  16. #include "gf/gf.h"
  17. #include "util/util.h"
  18. /**
  19. * @brief Key pair generation
  20. * @param pk string that will be stored the public key
  21. * @param sk string that will be stored the secret key
  22. *
  23. * @return It will back 0 if it was possible to generate both keys
  24. * and it will return != 0 if it wasn't possible to generate keys.
  25. *
  26. */
  27. extern int key_pair_generation(unsigned char *pk, unsigned char *sk);
  28. extern void key_gen(gf *v, gf *y, matrix *G);
  29. extern int build_dyadic_signature(gf *dyadic_signature);
  30. extern void build_support(gf *signature_h, gf *u, gf *v, gf *elements);
  31. extern void build_cauchy_matrix(gf *u, gf *v, matrix *H_cauchy);
  32. extern int build_trapdoor(const matrix* restrict H_cauchy, const gf* restrict v,
  33. const gf* restrict u, gf* restrict y, matrix* restrict H) ;
  34. extern void project_H_on_F_q(const matrix *H, matrix *Hbase);
  35. extern int generate_public_key(const matrix *Hbase, matrix *G);
  36. #endif /* SRC_KEYGENERATION_H_ */