Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

38 rader
1.2 KiB

  1. #ifndef XMSS_WOTS_H
  2. #define XMSS_WOTS_H
  3. #include <stdint.h>
  4. #include "params.h"
  5. /**
  6. * WOTS key generation. Takes a 32 byte seed for the secret key, expands it to
  7. * a full WOTS secret key and computes the corresponding public key.
  8. * It requires the seed pub_seed (used to generate bitmasks and hash keys)
  9. * and the address of this WOTS key pair.
  10. *
  11. * Writes the computed public key to 'pk'.
  12. */
  13. void wots_pkgen(const xmss_params *params,
  14. unsigned char *pk, const unsigned char *sk,
  15. const unsigned char *pub_seed, uint32_t addr[8]);
  16. /**
  17. * Takes a m-byte message and the 32-byte seed for the secret key to compute a
  18. * signature that is placed at 'sig'.
  19. */
  20. void wots_sign(const xmss_params *params,
  21. unsigned char *sig, const unsigned char *msg,
  22. const unsigned char *sk, const unsigned char *pub_seed,
  23. uint32_t addr[8]);
  24. /**
  25. * Takes a WOTS signature and an m-byte message, computes a WOTS public key.
  26. *
  27. * Writes the computed public key to 'pk'.
  28. */
  29. void wots_pk_from_sig(const xmss_params *params, unsigned char *pk,
  30. const unsigned char *sig, const unsigned char *msg,
  31. const unsigned char *pub_seed, uint32_t addr[8]);
  32. #endif