Reference implementations of PQC
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.
 
 
 
 

40 rivejä
881 B

  1. #ifndef NISTSEEDEXPANDER_H
  2. #define NISTSEEDEXPANDER_H
  3. //
  4. // rng.h
  5. //
  6. // Created by Bassham, Lawrence E (Fed) on 8/29/17.
  7. // Copyright © 2017 Bassham, Lawrence E (Fed). All rights reserved.
  8. // Modified for PQClean by Sebastian Verschoor
  9. //
  10. #include <stddef.h>
  11. #include <stdint.h>
  12. #define NISTSEEDEXPANDER_SEED_LEN 32
  13. #define RNG_SUCCESS ( 0)
  14. #define RNG_BAD_MAXLEN (-1)
  15. #define RNG_BAD_OUTBUF (-2)
  16. #define RNG_BAD_REQ_LEN (-3)
  17. typedef struct {
  18. uint8_t buffer[16];
  19. size_t buffer_pos;
  20. size_t length_remaining;
  21. uint8_t key[NISTSEEDEXPANDER_SEED_LEN];
  22. uint8_t ctr[16];
  23. } AES_XOF_struct;
  24. int
  25. seedexpander_init(AES_XOF_struct *ctx,
  26. const uint8_t *seed,
  27. const uint8_t *diversifier,
  28. size_t maxlen);
  29. int
  30. seedexpander(AES_XOF_struct *ctx, uint8_t *x, size_t xlen);
  31. #endif /* NISTSEEDEXPANDER_H */