25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

54 satır
2.0 KiB

  1. /*
  2. xmss.h version 20160722
  3. Andreas Hülsing
  4. Joost Rijneveld
  5. Public domain.
  6. */
  7. #include "wots.h"
  8. #ifndef XMSS_CORE_H
  9. #define XMSS_CORE_H
  10. /**
  11. * Generates a XMSS key pair for a given parameter set.
  12. * Format sk: [(32bit) idx || SK_SEED || SK_PRF || PUB_SEED || root]
  13. * Format pk: [root || PUB_SEED] omitting algo oid.
  14. */
  15. int xmss_core_keypair(const xmss_params *params, unsigned char *pk, unsigned char *sk);
  16. /**
  17. * Signs a message.
  18. * Returns
  19. * 1. an array containing the signature followed by the message AND
  20. * 2. an updated secret key!
  21. *
  22. */
  23. int xmss_core_sign(const xmss_params *params, unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig_msg_len, const unsigned char *msg, unsigned long long msglen);
  24. /**
  25. * Verifies a given message signature pair under a given public key.
  26. *
  27. * Note: msg and msglen are pure outputs which carry the message in case verification succeeds. The (input) message is assumed to be within sig_msg which has the form (sig||msg).
  28. */
  29. int xmss_core_sign_open(const xmss_params *params, unsigned char *msg, unsigned long long *msglen, const unsigned char *sig_msg, unsigned long long sig_msg_len, const unsigned char *pk);
  30. /*
  31. * Generates a XMSSMT key pair for a given parameter set.
  32. * Format sk: [(ceil(h/8) bit) idx || SK_SEED || SK_PRF || PUB_SEED || root]
  33. * Format pk: [root || PUB_SEED] omitting algo oid.
  34. */
  35. int xmssmt_core_keypair(const xmss_params *params, unsigned char *pk, unsigned char *sk);
  36. /**
  37. * Signs a message.
  38. * Returns
  39. * 1. an array containing the signature followed by the message AND
  40. * 2. an updated secret key!
  41. *
  42. */
  43. int xmssmt_core_sign(const xmss_params *params, unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig_msg_len, const unsigned char *msg, unsigned long long msglen);
  44. /**
  45. * Verifies a given message signature pair under a given public key.
  46. */
  47. int xmssmt_core_sign_open(const xmss_params *params, unsigned char *msg, unsigned long long *msglen, const unsigned char *sig_msg, unsigned long long sig_msg_len, const unsigned char *pk);
  48. #endif