wrapper-base.cpp 347 B

1234567891011
  1. #include <string>
  2. using std::string;
  3. #include "crypto_scalarmult.h"
  4. string crypto_scalarmult_base(const string &n)
  5. {
  6. unsigned char q[crypto_scalarmult_BYTES];
  7. if (n.size() != crypto_scalarmult_SCALARBYTES) throw "incorrect scalar length";
  8. crypto_scalarmult_base(q,(const unsigned char *) n.c_str());
  9. return string((char *) q,sizeof q);
  10. }