diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-08-24 19:34:10 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-10-26 18:00:53 +0200 |
commit | bb0c161e7d4bff0e70b59c2f4267da96f34742af (patch) | |
tree | 6218bba2ad3cdaa4a8c0be027587db736a2cc946 /src/crypto/shen_ed25519_ref/ref10/ge_frombytes.c | |
parent | Merge pull request #448 (diff) | |
download | monero-bb0c161e7d4bff0e70b59c2f4267da96f34742af.tar.xz |
renamed folder
Diffstat (limited to 'src/crypto/shen_ed25519_ref/ref10/ge_frombytes.c')
-rw-r--r-- | src/crypto/shen_ed25519_ref/ref10/ge_frombytes.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/crypto/shen_ed25519_ref/ref10/ge_frombytes.c b/src/crypto/shen_ed25519_ref/ref10/ge_frombytes.c deleted file mode 100644 index 1a059ee93..000000000 --- a/src/crypto/shen_ed25519_ref/ref10/ge_frombytes.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "ge.h" - -static const fe d = { -#include "d.h" -} ; - -static const fe sqrtm1 = { -#include "sqrtm1.h" -} ; - -int ge_frombytes_negate_vartime(ge_p3 *h,const unsigned char *s) -{ - fe u; - fe v; - fe v3; - fe vxx; - fe check; - - fe_frombytes(h->Y,s); - fe_1(h->Z); - fe_sq(u,h->Y); - fe_mul(v,u,d); - fe_sub(u,u,h->Z); /* u = y^2-1 */ - fe_add(v,v,h->Z); /* v = dy^2+1 */ - - fe_sq(v3,v); - fe_mul(v3,v3,v); /* v3 = v^3 */ - fe_sq(h->X,v3); - fe_mul(h->X,h->X,v); - fe_mul(h->X,h->X,u); /* x = uv^7 */ - - fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */ - fe_mul(h->X,h->X,v3); - fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */ - - fe_sq(vxx,h->X); - fe_mul(vxx,vxx,v); - fe_sub(check,vxx,u); /* vx^2-u */ - if (fe_isnonzero(check)) { - fe_add(check,vxx,u); /* vx^2+u */ - if (fe_isnonzero(check)) return -1; - fe_mul(h->X,h->X,sqrtm1); - } - - if (fe_isnegative(h->X) == (s[31] >> 7)) - fe_neg(h->X,h->X); - - fe_mul(h->T,h->X,h->Y); - return 0; -} |