You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
773 B

  1. #ifndef SYMMETRIC_H
  2. #define SYMMETRIC_H
  3. #include "params.h"
  4. #include "aes256ctr.h"
  5. #include "sha2.h"
  6. #define hash_h(OUT, IN, INBYTES) sha256((OUT), (IN), (INBYTES))
  7. #define hash_g(OUT, IN, INBYTES) sha512((OUT), (IN), (INBYTES))
  8. #define xof_absorb(STATE, IN, X, Y) PQCLEAN_KYBER76890S_AVX2_aes256ctr_init((STATE), (IN), (Y) + ((uint16_t)(X) << 8))
  9. #define xof_squeezeblocks(OUT, OUTBLOCKS, STATE) PQCLEAN_KYBER76890S_AVX2_aes256ctr_squeezeblocks((OUT), (OUTBLOCKS), (STATE))
  10. #define xof_ctx_release(STATE)
  11. #define prf(OUT, OUTBYTES, KEY, NONCE) PQCLEAN_KYBER76890S_AVX2_aes256ctr_prf((OUT), (OUTBYTES), (KEY), (NONCE))
  12. #define kdf(OUT, IN, INBYTES) sha256((OUT), (IN), (INBYTES))
  13. #define XOF_BLOCKBYTES 128
  14. typedef aes256ctr_ctx xof_state;
  15. #endif /* SYMMETRIC_H */