您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

40 行
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 */