mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-02 05:32:30 +02:00
Add eddsa from ref10 implementation (with some modifications).
This commit is contained in:
parent
2fcc91a755
commit
93d60152d5
84 changed files with 5798 additions and 567 deletions
14
core/crypto/ed25519/ge_tobytes.cpp
Normal file
14
core/crypto/ed25519/ge_tobytes.cpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include "ge.h"
|
||||
|
||||
void ge_tobytes(unsigned char *s,const ge_p2 *h)
|
||||
{
|
||||
fe recip;
|
||||
fe x;
|
||||
fe y;
|
||||
|
||||
fe_invert(recip,h->Z);
|
||||
fe_mul(x,h->X,recip);
|
||||
fe_mul(y,h->Y,recip);
|
||||
fe_tobytes(s,y);
|
||||
s[31] ^= fe_isnegative(x) << 7;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue