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.

28 lines
704 B

  1. #define TEST_NAME "box_seed"
  2. #include "cmptest.h"
  3. unsigned char seed[32]
  4. = { 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1,
  5. 0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0,
  6. 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a };
  7. int main(void)
  8. {
  9. int i;
  10. unsigned char sk[32];
  11. unsigned char pk[32];
  12. crypto_box_seed_keypair(pk, sk, seed);
  13. for (i = 0; i < 32; ++i) {
  14. printf(",0x%02x", (unsigned int)pk[i]);
  15. if (i % 8 == 7)
  16. printf("\n");
  17. }
  18. for (i = 0; i < 32; ++i) {
  19. printf(",0x%02x", (unsigned int)sk[i]);
  20. if (i % 8 == 7)
  21. printf("\n");
  22. }
  23. return 0;
  24. }