-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elligator map/inverse-map seems wrong #2
Comments
hyggy2019
changed the title
Elligator map/Reverse-map seems wrong
Elligator map/inverse-map seems wrong
Feb 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, there,
I've tested Elligator map/inverse-map with the code below. pk should be equal to pk2, however they often get different. Any help?
int Elligator_Test(){
std::cout << "Elligator_Test\n";
unsigned char pk[crypto_core_ristretto255_BYTES] = {};
unsigned char pk2[crypto_core_ristretto255_BYTES] = {};
unsigned char representative[crypto_core_ristretto255_BYTES] = {};
unsigned char* a = new unsigned char[crypto_core_ristretto255_SCALARBYTES];
bool success;
do {
crypto_core_ristretto255_scalar_random(a);
success = ScalarBaseMult2(pk, representative, a);
//ristretto_ropoGroup2Field(g_sum, buffs, mfe25519_one);
} while (!success);
std::cout << " pk = " << toBlock(pk) << " " << toBlock(pk + sizeof(block)) << "\n";
std::cout << " representative= " << toBlock(representative) << " " << toBlock(representative + sizeof(block)) << "\n";
std::cout << " a = " << toBlock(a) << " " << toBlock(a + sizeof(block)) << "\n";
RepresentativeToPublicKey2(pk2, representative);
std::cout << " After RepresentativeToPublicKey2, pk = " << toBlock(pk2) << " " << toBlock(pk2 + sizeof(block)) << "\n";
return 0;
}
The text was updated successfully, but these errors were encountered: