I'd like to create LSAG in C and now I need to calculate ciKi as element in L. Then, I try an example with MiniNero like below:
K = "210330a31c3caab4087c19fbe770514e5e6b80eda552d1e5f8becabd12c4540e"
c = "30837c72f9e0034f5669d5b122a200565666f6d31ba9a4c707ebfd0860303988"
print(MiniNero.scalarmultKey(K, c))
And I got the answer:
4581d73d76f00df2724d15bca43b4b9d2fe43132e3357449fd61d8d961e36b33
However, I got a different result with my C version...
from_hex(c, 32, "30837c72f9e0034f5669d5b122a200565666f6d31ba9a4c707ebfd0860303988");
from_hex(K, 32, "210330a31c3caab4087c19fbe770514e5e6b80eda552d1e5f8becabd12c4540e");
scalarmultKey((const unsigned char *) K, (const unsigned char *)c, (unsigned char *)result);
for(i=0; i<32; i++){
printf("%02x",result[i]);
I got the result:
454c7252631ea5dfd757df7048796fef1b5c235191897791afb84417b82f9c7a
where the content of scalarmultKey is:
void scalarmultKey(const unsigned char *P, const unsigned char *a, unsigned char *aP)
{
ge_p3 *A = malloc(sizeof(ge_p3));
ge_p2 *R = malloc(sizeof(ge_p2));
ge_frombytes_vartime(A, P);
ge_scalarmult(R, a, A);
ge_tobytes(aP, R);
}
Is there difference between scalarmultKeys in MiniNero with monero-project's.
Please help on this problem.. Many thanks!