Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

xmss_commons.h 1.6 KiB

vor 9 Jahren
vor 9 Jahren
123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef XMSS_COMMONS_H
  2. #define XMSS_COMMONS_H
  3. #include <stdint.h>
  4. #include "params.h"
  5. /**
  6. * Computes the leaf at a given address. First generates the WOTS key pair,
  7. * then computes leaf using l_tree. As this happens position independent, we
  8. * only require that addr encodes the right ltree-address.
  9. */
  10. void gen_leaf_wots(const xmss_params *params, unsigned char *leaf,
  11. const unsigned char *sk_seed, const unsigned char *pub_seed,
  12. uint32_t ltree_addr[8], uint32_t ots_addr[8]);
  13. /**
  14. * Used for pseudo-random key generation.
  15. * Generates the seed for the WOTS key pair at address 'addr'.
  16. *
  17. * Takes n-byte sk_seed and returns n-byte seed using 32 byte address 'addr'.
  18. */
  19. void get_seed(const xmss_params *params, unsigned char *seed,
  20. const unsigned char *sk_seed, uint32_t addr[8]);
  21. /**
  22. * Verifies a given message signature pair under a given public key.
  23. * Note that this assumes a pk without an OID, i.e. [root || PUB_SEED]
  24. */
  25. int xmss_core_sign_open(const xmss_params *params,
  26. unsigned char *m, unsigned long long *mlen,
  27. const unsigned char *sm, unsigned long long smlen,
  28. const unsigned char *pk);
  29. /**
  30. * Verifies a given message signature pair under a given public key.
  31. * Note that this assumes a pk without an OID, i.e. [root || PUB_SEED]
  32. */
  33. int xmssmt_core_sign_open(const xmss_params *params,
  34. unsigned char *m, unsigned long long *mlen,
  35. const unsigned char *sm, unsigned long long smlen,
  36. const unsigned char *pk);
  37. #endif