ED25519 compatibility #1213
Unanswered
CodeAndWeb
asked this question in
Q&A
Replies: 2 comments 4 replies
-
This creates a signature using your library and verifies it with libsodium. Works as expected. int main()
{
unsigned char seed[32];
unsigned char sig[64];
unsigned char pk[32], sk[32];
ed25519_create_seed(seed);
ed25519_create_keypair(pk, sk, seed);
ed25519_sign(sig, (const void *) "test", 4, pk, sk);
if (sodium_init() != 0) {
return 1;
}
if (crypto_sign_verify_detached(sig, (const void *) "test", 4, pk) != 0) {
return 1;
}
puts("OK");
return 0;
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
The format of the secret key is That's what virtually all implementations do, including libsodium. Storing the seed, not its hash, is also what's documented in the RFC. The library you used appears to return |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I used this implementation of ED25519 for signing software updates - which seems to be reasonably well. https://github.com/orlp/ed25519
I now decided to switch to php's ED25519 implementation which uses libsodium for signing. The issue now is that it seems that signing the same message delivers different signatures even so the keys are identical.
I wonder why it is like that. Both algorithms claim to be based on SUPERCOP "ref10" - but why am I not getting them to match?
Is there a way to get libsodium to emulate the same behavior as the other implementation? As I said: I am using this to validate software updated by signing new versions of my programs. The implementation is already in the field and I can't take that back. So the only way would be to make PHP behave in the same way.
Does this mean that I have to pad the original input to make the buffer size divisible by 64?
When looking at the signing code, it seems that the difference between sodium and the other implementation is that sodium calls
See https://github.com/orlp/ed25519/blob/master/src/sign.c vs https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_sign/ed25519/ref10/sign.c
Is this maybe the reason for the difference?
Best
Andreas
Beta Was this translation helpful? Give feedback.
All reactions