From b01f2864730c076945cc78b4fd3abc8c1860ae53 Mon Sep 17 00:00:00 2001 From: ShenNoether Date: Sun, 23 Aug 2015 14:18:59 -0600 Subject: Added shen_ed25519_ref to crypto ops subfolder, the point is to directly have bitmonero's crypto code come from bernstein et al's ref 10 code --- src/crypto/shen_ed25519_ref | 1 + 1 file changed, 1 insertion(+) create mode 160000 src/crypto/shen_ed25519_ref (limited to 'src/crypto/shen_ed25519_ref/ref10/ge_msub.h') diff --git a/src/crypto/shen_ed25519_ref b/src/crypto/shen_ed25519_ref new file mode 160000 index 000000000..ecfb9166a --- /dev/null +++ b/src/crypto/shen_ed25519_ref @@ -0,0 +1 @@ +Subproject commit ecfb9166ab10de6c42f89e5ccb22ac9547505218 -- cgit v1.2.3 From 0d70fdca8c04b0dcb3be5ecb5cfff6a8b645ae53 Mon Sep 17 00:00:00 2001 From: ShenNoether Date: Sun, 23 Aug 2015 14:46:44 -0600 Subject: revert to 776b4fc91a821be152f0f23e6873aabb78a72029 --- src/crypto/shen_ed25519_ref | 1 - 1 file changed, 1 deletion(-) delete mode 160000 src/crypto/shen_ed25519_ref (limited to 'src/crypto/shen_ed25519_ref/ref10/ge_msub.h') diff --git a/src/crypto/shen_ed25519_ref b/src/crypto/shen_ed25519_ref deleted file mode 160000 index ecfb9166a..000000000 --- a/src/crypto/shen_ed25519_ref +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ecfb9166ab10de6c42f89e5ccb22ac9547505218 -- cgit v1.2.3 From 0a4bc84b2f681dfd89b501648f65a951d876e2d8 Mon Sep 17 00:00:00 2001 From: ShenNoether Date: Sun, 23 Aug 2015 14:48:50 -0600 Subject: Added ref10 shen_ed25519_ref code, which includes code that can replace crypto-ops with a version straight from Bernstein's ref 10 --- src/crypto/shen_ed25519_ref/ref10/ge_msub.h | 88 +++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/crypto/shen_ed25519_ref/ref10/ge_msub.h (limited to 'src/crypto/shen_ed25519_ref/ref10/ge_msub.h') diff --git a/src/crypto/shen_ed25519_ref/ref10/ge_msub.h b/src/crypto/shen_ed25519_ref/ref10/ge_msub.h new file mode 100644 index 000000000..500f986ba --- /dev/null +++ b/src/crypto/shen_ed25519_ref/ref10/ge_msub.h @@ -0,0 +1,88 @@ + +/* qhasm: enter ge_msub */ + +/* qhasm: fe X1 */ + +/* qhasm: fe Y1 */ + +/* qhasm: fe Z1 */ + +/* qhasm: fe T1 */ + +/* qhasm: fe ypx2 */ + +/* qhasm: fe ymx2 */ + +/* qhasm: fe xy2d2 */ + +/* qhasm: fe X3 */ + +/* qhasm: fe Y3 */ + +/* qhasm: fe Z3 */ + +/* qhasm: fe T3 */ + +/* qhasm: fe YpX1 */ + +/* qhasm: fe YmX1 */ + +/* qhasm: fe A */ + +/* qhasm: fe B */ + +/* qhasm: fe C */ + +/* qhasm: fe D */ + +/* qhasm: YpX1 = Y1+X1 */ +/* asm 1: fe_add(>YpX1=fe#1,YpX1=r->X,Y,X); */ +fe_add(r->X,p->Y,p->X); + +/* qhasm: YmX1 = Y1-X1 */ +/* asm 1: fe_sub(>YmX1=fe#2,YmX1=r->Y,Y,X); */ +fe_sub(r->Y,p->Y,p->X); + +/* qhasm: A = YpX1*ymx2 */ +/* asm 1: fe_mul(>A=fe#3,A=r->Z,X,yminusx); */ +fe_mul(r->Z,r->X,q->yminusx); + +/* qhasm: B = YmX1*ypx2 */ +/* asm 1: fe_mul(>B=fe#2,B=r->Y,Y,yplusx); */ +fe_mul(r->Y,r->Y,q->yplusx); + +/* qhasm: C = xy2d2*T1 */ +/* asm 1: fe_mul(>C=fe#4,C=r->T,xy2d,T); */ +fe_mul(r->T,q->xy2d,p->T); + +/* qhasm: D = 2*Z1 */ +/* asm 1: fe_add(>D=fe#5,D=t0,Z,Z); */ +fe_add(t0,p->Z,p->Z); + +/* qhasm: X3 = A-B */ +/* asm 1: fe_sub(>X3=fe#1,X3=r->X,Z,Y); */ +fe_sub(r->X,r->Z,r->Y); + +/* qhasm: Y3 = A+B */ +/* asm 1: fe_add(>Y3=fe#2,Y3=r->Y,Z,Y); */ +fe_add(r->Y,r->Z,r->Y); + +/* qhasm: Z3 = D-C */ +/* asm 1: fe_sub(>Z3=fe#3,Z3=r->Z,T); */ +fe_sub(r->Z,t0,r->T); + +/* qhasm: T3 = D+C */ +/* asm 1: fe_add(>T3=fe#4,T3=r->T,T); */ +fe_add(r->T,t0,r->T); + +/* qhasm: return */ -- cgit v1.2.3