3 #include "crypto_scalarmult.h"
5 string
crypto_scalarmult(const string
&n
,const string
&p
)
7 unsigned char q
[crypto_scalarmult_BYTES
];
8 if (n
.size() != crypto_scalarmult_SCALARBYTES
) throw "incorrect scalar length";
9 if (p
.size() != crypto_scalarmult_BYTES
) throw "incorrect element length";
10 crypto_scalarmult(q
,(const unsigned char *) n
.c_str(),(const unsigned char *) p
.c_str());
11 return string((char *) q
,sizeof q
);