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.

31 lines
781 B

  1. #include "../params.h"
  2. #include "../xmss.h"
  3. #include <stdio.h>
  4. #include <stdint.h>
  5. int main(int argc, char **argv)
  6. {
  7. xmss_params params;
  8. uint32_t oid;
  9. if (argc != 2) {
  10. fprintf(stderr, "Expected parameter string (e.g. 'XMSS-SHA2_10_256')"
  11. " as only parameter.\n"
  12. "The keypair is written to stdout.\n");
  13. return -1;
  14. }
  15. xmss_str_to_oid(&oid, argv[1]);
  16. xmss_parse_oid(&params, oid);
  17. unsigned char pk[XMSS_OID_LEN + params.publickey_bytes];
  18. unsigned char sk[XMSS_OID_LEN + params.privatekey_bytes];
  19. xmss_keypair(pk, sk, oid);
  20. fwrite(pk, 1, XMSS_OID_LEN + params.publickey_bytes, stdout);
  21. fwrite(sk, 1, XMSS_OID_LEN + params.privatekey_bytes, stdout);
  22. fclose(stdout);
  23. }