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 lines
1.3 KiB

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