wrapper-keypair.cpp 320 B

123456789101112
  1. #include <string>
  2. using std::string;
  3. #include "crypto_box.h"
  4. string crypto_box_keypair(string *sk_string)
  5. {
  6. unsigned char pk[crypto_box_PUBLICKEYBYTES];
  7. unsigned char sk[crypto_box_SECRETKEYBYTES];
  8. crypto_box_keypair(pk,sk);
  9. *sk_string = string((char *) sk,sizeof sk);
  10. return string((char *) pk,sizeof pk);
  11. }