kyber512r3_params.h 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "pq-crypto/s2n_pq_asm.h"
  3. /* All kyber512r3 functions and global variables in the pq-crypto/kyber_r3 directory
  4. * should be defined using the namespace macro to avoid symbol collisions. For example,
  5. * in foo.h, declare a function as follows:
  6. *
  7. * #define foo_function S2N_KYBER_512_R3_NAMESPACE(foo_function)
  8. * int foo_function(int foo_argument); */
  9. #define S2N_KYBER_512_R3_NAMESPACE(s) s2n_kyber_512_r3_##s
  10. #define S2N_KYBER_512_R3_K 2
  11. #define S2N_KYBER_512_R3_N 256
  12. #define S2N_KYBER_512_R3_Q 3329
  13. #define S2N_KYBER_512_R3_SYMBYTES 32 /* size in bytes of hashes, and seeds */
  14. #define S2N_KYBER_512_R3_SSBYTES 32 /* size in bytes of shared key */
  15. #define S2N_KYBER_512_R3_POLYBYTES 384
  16. #define S2N_KYBER_512_R3_POLYVECBYTES (S2N_KYBER_512_R3_K * S2N_KYBER_512_R3_POLYBYTES)
  17. #define S2N_KYBER_512_R3_ETA1 3
  18. #define S2N_KYBER_512_R3_POLYCOMPRESSEDBYTES 128
  19. #define S2N_KYBER_512_R3_POLYVECCOMPRESSEDBYTES 640
  20. #define S2N_KYBER_512_R3_ETA2 2
  21. #define S2N_KYBER_512_R3_INDCPA_MSGBYTES S2N_KYBER_512_R3_SYMBYTES
  22. #define S2N_KYBER_512_R3_INDCPA_PUBLICKEYBYTES (S2N_KYBER_512_R3_POLYVECBYTES + S2N_KYBER_512_R3_SYMBYTES)
  23. #define S2N_KYBER_512_R3_INDCPA_SECRETKEYBYTES (S2N_KYBER_512_R3_POLYVECBYTES)
  24. #define S2N_KYBER_512_R3_INDCPA_BYTES (S2N_KYBER_512_R3_POLYVECCOMPRESSEDBYTES + S2N_KYBER_512_R3_POLYCOMPRESSEDBYTES)