rbnacl-libsodium 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/rbnacl/libsodium/version.rb +1 -1
- data/vendor/libsodium/ChangeLog +5 -0
- data/vendor/libsodium/README.markdown +4 -1
- data/vendor/libsodium/autogen.sh +0 -5
- data/vendor/libsodium/autom4te.cache/output.1 +14 -14
- data/vendor/libsodium/autom4te.cache/output.5 +14 -14
- data/vendor/libsodium/autom4te.cache/requests +868 -868
- data/vendor/libsodium/autom4te.cache/traces.1 +1 -1
- data/vendor/libsodium/builds/msvc/version.h +2 -2
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +10 -72
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +36 -216
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +10 -72
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +34 -214
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +10 -72
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +34 -214
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +10 -72
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +25 -205
- data/vendor/libsodium/configure +14 -14
- data/vendor/libsodium/configure.ac +5 -5
- data/vendor/libsodium/dist-build/msys2-win32.sh +3 -2
- data/vendor/libsodium/dist-build/msys2-win64.sh +3 -2
- data/vendor/libsodium/examples/sign.c +2 -2
- data/vendor/libsodium/examples/utils.h +3 -1
- data/vendor/libsodium/libsodium.vcxproj +7 -53
- data/vendor/libsodium/libsodium.vcxproj.filters +18 -152
- data/vendor/libsodium/msvc-scripts/process.bat +2 -2
- data/vendor/libsodium/src/libsodium/Makefile.am +6 -68
- data/vendor/libsodium/src/libsodium/Makefile.in +49 -724
- data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +2 -2
- data/vendor/libsodium/src/libsodium/{crypto_sign/ed25519 → crypto_core/curve25519}/ref10/base.h +0 -0
- data/vendor/libsodium/src/libsodium/{crypto_sign/ed25519 → crypto_core/curve25519}/ref10/base2.h +0 -0
- data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c +2233 -0
- data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.h +160 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +1 -1
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +2 -2
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +2 -2
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +255 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/{curve25519_ref10.h → x25519_ref10.h} +0 -0
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +1 -2
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +2 -4
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +1 -2
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +1 -2
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.c +16 -9
- data/vendor/libsodium/src/libsodium/include/sodium/export.h +2 -2
- data/vendor/libsodium/src/libsodium/include/sodium/utils.h +6 -4
- data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +12 -8
- data/vendor/libsodium/src/libsodium/sodium/core.c +9 -0
- data/vendor/libsodium/src/libsodium/sodium/runtime.c +32 -10
- data/vendor/libsodium/src/libsodium/sodium/utils.c +8 -8
- data/vendor/libsodium/test/default/auth.c +1 -1
- data/vendor/libsodium/test/default/box.c +16 -4
- data/vendor/libsodium/test/default/box2.c +7 -0
- data/vendor/libsodium/test/default/box7.c +18 -10
- data/vendor/libsodium/test/default/box8.c +1 -1
- data/vendor/libsodium/test/default/box_easy2.c +13 -0
- data/vendor/libsodium/test/default/onetimeauth.c +1 -0
- data/vendor/libsodium/test/default/pwhash_scrypt_ll.c +2 -2
- data/vendor/libsodium/test/default/verify1.c +1 -1
- metadata +9 -71
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/curve25519_ref10.c +0 -73
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe.h +0 -44
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_0_curve25519_ref10.c +0 -23
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_1_curve25519_ref10.c +0 -23
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_add_curve25519_ref10.c +0 -61
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_copy_curve25519_ref10.c +0 -33
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_cswap_curve25519_ref10.c +0 -77
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_frombytes_curve25519_ref10.c +0 -74
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_invert_curve25519_ref10.c +0 -18
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_mul121666_curve25519_ref10.c +0 -74
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_mul_curve25519_ref10.c +0 -257
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_sq_curve25519_ref10.c +0 -153
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_sub_curve25519_ref10.c +0 -61
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_tobytes_curve25519_ref10.c +0 -123
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/montgomery.h +0 -140
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/pow225521.h +0 -160
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d2.h +0 -1
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe.h +0 -56
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_0.c +0 -19
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_1.c +0 -19
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_add.c +0 -57
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_cmov.c +0 -63
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_copy.c +0 -29
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_frombytes.c +0 -73
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_invert.c +0 -14
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnegative.c +0 -16
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnonzero.c +0 -19
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_mul.c +0 -253
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_neg.c +0 -45
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_pow22523.c +0 -13
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq.c +0 -149
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq2.c +0 -160
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sub.c +0 -57
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_tobytes.c +0 -119
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge.h +0 -97
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.h +0 -97
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_double_scalarmult.c +0 -138
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_frombytes.c +0 -50
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.h +0 -88
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.h +0 -88
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p2.c +0 -12
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p3.c +0 -13
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_0.c +0 -8
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.h +0 -73
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_0.c +0 -9
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_dbl.c +0 -12
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_cached.c +0 -17
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_p2.c +0 -12
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_tobytes.c +0 -14
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_precomp_0.c +0 -8
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_scalarmult_base.c +0 -111
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.c +0 -11
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.h +0 -97
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_tobytes.c +0 -14
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/pow22523.h +0 -160
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/pow225521.h +0 -160
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc.h +0 -15
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_muladd.c +0 -368
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_reduce.c +0 -275
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sqrtm1.h +0 -1
@@ -1,160 +0,0 @@
|
|
1
|
-
|
2
|
-
/* qhasm: fe z1 */
|
3
|
-
|
4
|
-
/* qhasm: fe z2 */
|
5
|
-
|
6
|
-
/* qhasm: fe z8 */
|
7
|
-
|
8
|
-
/* qhasm: fe z9 */
|
9
|
-
|
10
|
-
/* qhasm: fe z11 */
|
11
|
-
|
12
|
-
/* qhasm: fe z22 */
|
13
|
-
|
14
|
-
/* qhasm: fe z_5_0 */
|
15
|
-
|
16
|
-
/* qhasm: fe z_10_5 */
|
17
|
-
|
18
|
-
/* qhasm: fe z_10_0 */
|
19
|
-
|
20
|
-
/* qhasm: fe z_20_10 */
|
21
|
-
|
22
|
-
/* qhasm: fe z_20_0 */
|
23
|
-
|
24
|
-
/* qhasm: fe z_40_20 */
|
25
|
-
|
26
|
-
/* qhasm: fe z_40_0 */
|
27
|
-
|
28
|
-
/* qhasm: fe z_50_10 */
|
29
|
-
|
30
|
-
/* qhasm: fe z_50_0 */
|
31
|
-
|
32
|
-
/* qhasm: fe z_100_50 */
|
33
|
-
|
34
|
-
/* qhasm: fe z_100_0 */
|
35
|
-
|
36
|
-
/* qhasm: fe z_200_100 */
|
37
|
-
|
38
|
-
/* qhasm: fe z_200_0 */
|
39
|
-
|
40
|
-
/* qhasm: fe z_250_50 */
|
41
|
-
|
42
|
-
/* qhasm: fe z_250_0 */
|
43
|
-
|
44
|
-
/* qhasm: fe z_255_5 */
|
45
|
-
|
46
|
-
/* qhasm: fe z_255_21 */
|
47
|
-
|
48
|
-
/* qhasm: enter pow225521 */
|
49
|
-
|
50
|
-
/* qhasm: z2 = z1^2^1 */
|
51
|
-
/* asm 1: fe_sq(>z2=fe#1,<z1=fe#11); for (i = 1;i < 1;++i) fe_sq(>z2=fe#1,>z2=fe#1); */
|
52
|
-
/* asm 2: fe_sq(>z2=t0,<z1=z); for (i = 1;i < 1;++i) fe_sq(>z2=t0,>z2=t0); */
|
53
|
-
fe_sq(t0,z); /* for (i = 1;i < 1;++i) fe_sq(t0,t0); */
|
54
|
-
|
55
|
-
/* qhasm: z8 = z2^2^2 */
|
56
|
-
/* asm 1: fe_sq(>z8=fe#2,<z2=fe#1); for (i = 1;i < 2;++i) fe_sq(>z8=fe#2,>z8=fe#2); */
|
57
|
-
/* asm 2: fe_sq(>z8=t1,<z2=t0); for (i = 1;i < 2;++i) fe_sq(>z8=t1,>z8=t1); */
|
58
|
-
fe_sq(t1,t0); for (i = 1;i < 2;++i) fe_sq(t1,t1);
|
59
|
-
|
60
|
-
/* qhasm: z9 = z1*z8 */
|
61
|
-
/* asm 1: fe_mul(>z9=fe#2,<z1=fe#11,<z8=fe#2); */
|
62
|
-
/* asm 2: fe_mul(>z9=t1,<z1=z,<z8=t1); */
|
63
|
-
fe_mul(t1,z,t1);
|
64
|
-
|
65
|
-
/* qhasm: z11 = z2*z9 */
|
66
|
-
/* asm 1: fe_mul(>z11=fe#1,<z2=fe#1,<z9=fe#2); */
|
67
|
-
/* asm 2: fe_mul(>z11=t0,<z2=t0,<z9=t1); */
|
68
|
-
fe_mul(t0,t0,t1);
|
69
|
-
|
70
|
-
/* qhasm: z22 = z11^2^1 */
|
71
|
-
/* asm 1: fe_sq(>z22=fe#3,<z11=fe#1); for (i = 1;i < 1;++i) fe_sq(>z22=fe#3,>z22=fe#3); */
|
72
|
-
/* asm 2: fe_sq(>z22=t2,<z11=t0); for (i = 1;i < 1;++i) fe_sq(>z22=t2,>z22=t2); */
|
73
|
-
fe_sq(t2,t0); /* for (i = 1;i < 1;++i) fe_sq(t2,t2); */
|
74
|
-
|
75
|
-
/* qhasm: z_5_0 = z9*z22 */
|
76
|
-
/* asm 1: fe_mul(>z_5_0=fe#2,<z9=fe#2,<z22=fe#3); */
|
77
|
-
/* asm 2: fe_mul(>z_5_0=t1,<z9=t1,<z22=t2); */
|
78
|
-
fe_mul(t1,t1,t2);
|
79
|
-
|
80
|
-
/* qhasm: z_10_5 = z_5_0^2^5 */
|
81
|
-
/* asm 1: fe_sq(>z_10_5=fe#3,<z_5_0=fe#2); for (i = 1;i < 5;++i) fe_sq(>z_10_5=fe#3,>z_10_5=fe#3); */
|
82
|
-
/* asm 2: fe_sq(>z_10_5=t2,<z_5_0=t1); for (i = 1;i < 5;++i) fe_sq(>z_10_5=t2,>z_10_5=t2); */
|
83
|
-
fe_sq(t2,t1); for (i = 1;i < 5;++i) fe_sq(t2,t2);
|
84
|
-
|
85
|
-
/* qhasm: z_10_0 = z_10_5*z_5_0 */
|
86
|
-
/* asm 1: fe_mul(>z_10_0=fe#2,<z_10_5=fe#3,<z_5_0=fe#2); */
|
87
|
-
/* asm 2: fe_mul(>z_10_0=t1,<z_10_5=t2,<z_5_0=t1); */
|
88
|
-
fe_mul(t1,t2,t1);
|
89
|
-
|
90
|
-
/* qhasm: z_20_10 = z_10_0^2^10 */
|
91
|
-
/* asm 1: fe_sq(>z_20_10=fe#3,<z_10_0=fe#2); for (i = 1;i < 10;++i) fe_sq(>z_20_10=fe#3,>z_20_10=fe#3); */
|
92
|
-
/* asm 2: fe_sq(>z_20_10=t2,<z_10_0=t1); for (i = 1;i < 10;++i) fe_sq(>z_20_10=t2,>z_20_10=t2); */
|
93
|
-
fe_sq(t2,t1); for (i = 1;i < 10;++i) fe_sq(t2,t2);
|
94
|
-
|
95
|
-
/* qhasm: z_20_0 = z_20_10*z_10_0 */
|
96
|
-
/* asm 1: fe_mul(>z_20_0=fe#3,<z_20_10=fe#3,<z_10_0=fe#2); */
|
97
|
-
/* asm 2: fe_mul(>z_20_0=t2,<z_20_10=t2,<z_10_0=t1); */
|
98
|
-
fe_mul(t2,t2,t1);
|
99
|
-
|
100
|
-
/* qhasm: z_40_20 = z_20_0^2^20 */
|
101
|
-
/* asm 1: fe_sq(>z_40_20=fe#4,<z_20_0=fe#3); for (i = 1;i < 20;++i) fe_sq(>z_40_20=fe#4,>z_40_20=fe#4); */
|
102
|
-
/* asm 2: fe_sq(>z_40_20=t3,<z_20_0=t2); for (i = 1;i < 20;++i) fe_sq(>z_40_20=t3,>z_40_20=t3); */
|
103
|
-
fe_sq(t3,t2); for (i = 1;i < 20;++i) fe_sq(t3,t3);
|
104
|
-
|
105
|
-
/* qhasm: z_40_0 = z_40_20*z_20_0 */
|
106
|
-
/* asm 1: fe_mul(>z_40_0=fe#3,<z_40_20=fe#4,<z_20_0=fe#3); */
|
107
|
-
/* asm 2: fe_mul(>z_40_0=t2,<z_40_20=t3,<z_20_0=t2); */
|
108
|
-
fe_mul(t2,t3,t2);
|
109
|
-
|
110
|
-
/* qhasm: z_50_10 = z_40_0^2^10 */
|
111
|
-
/* asm 1: fe_sq(>z_50_10=fe#3,<z_40_0=fe#3); for (i = 1;i < 10;++i) fe_sq(>z_50_10=fe#3,>z_50_10=fe#3); */
|
112
|
-
/* asm 2: fe_sq(>z_50_10=t2,<z_40_0=t2); for (i = 1;i < 10;++i) fe_sq(>z_50_10=t2,>z_50_10=t2); */
|
113
|
-
fe_sq(t2,t2); for (i = 1;i < 10;++i) fe_sq(t2,t2);
|
114
|
-
|
115
|
-
/* qhasm: z_50_0 = z_50_10*z_10_0 */
|
116
|
-
/* asm 1: fe_mul(>z_50_0=fe#2,<z_50_10=fe#3,<z_10_0=fe#2); */
|
117
|
-
/* asm 2: fe_mul(>z_50_0=t1,<z_50_10=t2,<z_10_0=t1); */
|
118
|
-
fe_mul(t1,t2,t1);
|
119
|
-
|
120
|
-
/* qhasm: z_100_50 = z_50_0^2^50 */
|
121
|
-
/* asm 1: fe_sq(>z_100_50=fe#3,<z_50_0=fe#2); for (i = 1;i < 50;++i) fe_sq(>z_100_50=fe#3,>z_100_50=fe#3); */
|
122
|
-
/* asm 2: fe_sq(>z_100_50=t2,<z_50_0=t1); for (i = 1;i < 50;++i) fe_sq(>z_100_50=t2,>z_100_50=t2); */
|
123
|
-
fe_sq(t2,t1); for (i = 1;i < 50;++i) fe_sq(t2,t2);
|
124
|
-
|
125
|
-
/* qhasm: z_100_0 = z_100_50*z_50_0 */
|
126
|
-
/* asm 1: fe_mul(>z_100_0=fe#3,<z_100_50=fe#3,<z_50_0=fe#2); */
|
127
|
-
/* asm 2: fe_mul(>z_100_0=t2,<z_100_50=t2,<z_50_0=t1); */
|
128
|
-
fe_mul(t2,t2,t1);
|
129
|
-
|
130
|
-
/* qhasm: z_200_100 = z_100_0^2^100 */
|
131
|
-
/* asm 1: fe_sq(>z_200_100=fe#4,<z_100_0=fe#3); for (i = 1;i < 100;++i) fe_sq(>z_200_100=fe#4,>z_200_100=fe#4); */
|
132
|
-
/* asm 2: fe_sq(>z_200_100=t3,<z_100_0=t2); for (i = 1;i < 100;++i) fe_sq(>z_200_100=t3,>z_200_100=t3); */
|
133
|
-
fe_sq(t3,t2); for (i = 1;i < 100;++i) fe_sq(t3,t3);
|
134
|
-
|
135
|
-
/* qhasm: z_200_0 = z_200_100*z_100_0 */
|
136
|
-
/* asm 1: fe_mul(>z_200_0=fe#3,<z_200_100=fe#4,<z_100_0=fe#3); */
|
137
|
-
/* asm 2: fe_mul(>z_200_0=t2,<z_200_100=t3,<z_100_0=t2); */
|
138
|
-
fe_mul(t2,t3,t2);
|
139
|
-
|
140
|
-
/* qhasm: z_250_50 = z_200_0^2^50 */
|
141
|
-
/* asm 1: fe_sq(>z_250_50=fe#3,<z_200_0=fe#3); for (i = 1;i < 50;++i) fe_sq(>z_250_50=fe#3,>z_250_50=fe#3); */
|
142
|
-
/* asm 2: fe_sq(>z_250_50=t2,<z_200_0=t2); for (i = 1;i < 50;++i) fe_sq(>z_250_50=t2,>z_250_50=t2); */
|
143
|
-
fe_sq(t2,t2); for (i = 1;i < 50;++i) fe_sq(t2,t2);
|
144
|
-
|
145
|
-
/* qhasm: z_250_0 = z_250_50*z_50_0 */
|
146
|
-
/* asm 1: fe_mul(>z_250_0=fe#2,<z_250_50=fe#3,<z_50_0=fe#2); */
|
147
|
-
/* asm 2: fe_mul(>z_250_0=t1,<z_250_50=t2,<z_50_0=t1); */
|
148
|
-
fe_mul(t1,t2,t1);
|
149
|
-
|
150
|
-
/* qhasm: z_255_5 = z_250_0^2^5 */
|
151
|
-
/* asm 1: fe_sq(>z_255_5=fe#2,<z_250_0=fe#2); for (i = 1;i < 5;++i) fe_sq(>z_255_5=fe#2,>z_255_5=fe#2); */
|
152
|
-
/* asm 2: fe_sq(>z_255_5=t1,<z_250_0=t1); for (i = 1;i < 5;++i) fe_sq(>z_255_5=t1,>z_255_5=t1); */
|
153
|
-
fe_sq(t1,t1); for (i = 1;i < 5;++i) fe_sq(t1,t1);
|
154
|
-
|
155
|
-
/* qhasm: z_255_21 = z_255_5*z11 */
|
156
|
-
/* asm 1: fe_mul(>z_255_21=fe#12,<z_255_5=fe#2,<z11=fe#1); */
|
157
|
-
/* asm 2: fe_mul(>z_255_21=out,<z_255_5=t1,<z11=t0); */
|
158
|
-
fe_mul(out,t1,t0);
|
159
|
-
|
160
|
-
/* qhasm: return */
|
@@ -1 +0,0 @@
|
|
1
|
-
-10913610,13857413,-15372611,6949391,114729,-8787816,-6275908,-3247719,-18696448,-12055116
|
@@ -1 +0,0 @@
|
|
1
|
-
-21827239,-5839606,-30745221,13898782,229458,15978800,-12551817,-6495438,29715968,9444199
|
@@ -1,56 +0,0 @@
|
|
1
|
-
#ifndef FE_H
|
2
|
-
#define FE_H
|
3
|
-
|
4
|
-
#include "crypto_int32.h"
|
5
|
-
|
6
|
-
typedef crypto_int32 fe[10];
|
7
|
-
|
8
|
-
/*
|
9
|
-
fe means field element.
|
10
|
-
Here the field is \Z/(2^255-19).
|
11
|
-
An element t, entries t[0]...t[9], represents the integer
|
12
|
-
t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
|
13
|
-
Bounds on each t[i] vary depending on context.
|
14
|
-
*/
|
15
|
-
|
16
|
-
#define fe_frombytes crypto_sign_ed25519_ref10_fe_frombytes
|
17
|
-
#define fe_tobytes crypto_sign_ed25519_ref10_fe_tobytes
|
18
|
-
#define fe_copy crypto_sign_ed25519_ref10_fe_copy
|
19
|
-
#define fe_isnonzero crypto_sign_ed25519_ref10_fe_isnonzero
|
20
|
-
#define fe_isnegative crypto_sign_ed25519_ref10_fe_isnegative
|
21
|
-
#define fe_0 crypto_sign_ed25519_ref10_fe_0
|
22
|
-
#define fe_1 crypto_sign_ed25519_ref10_fe_1
|
23
|
-
#define fe_cswap crypto_sign_ed25519_ref10_fe_cswap
|
24
|
-
#define fe_cmov crypto_sign_ed25519_ref10_fe_cmov
|
25
|
-
#define fe_add crypto_sign_ed25519_ref10_fe_add
|
26
|
-
#define fe_sub crypto_sign_ed25519_ref10_fe_sub
|
27
|
-
#define fe_neg crypto_sign_ed25519_ref10_fe_neg
|
28
|
-
#define fe_mul crypto_sign_ed25519_ref10_fe_mul
|
29
|
-
#define fe_sq crypto_sign_ed25519_ref10_fe_sq
|
30
|
-
#define fe_sq2 crypto_sign_ed25519_ref10_fe_sq2
|
31
|
-
#define fe_mul121666 crypto_sign_ed25519_ref10_fe_mul121666
|
32
|
-
#define fe_invert crypto_sign_ed25519_ref10_fe_invert
|
33
|
-
#define fe_pow22523 crypto_sign_ed25519_ref10_fe_pow22523
|
34
|
-
|
35
|
-
extern void fe_frombytes(fe,const unsigned char *);
|
36
|
-
extern void fe_tobytes(unsigned char *,const fe);
|
37
|
-
|
38
|
-
extern void fe_copy(fe,const fe);
|
39
|
-
extern int fe_isnonzero(const fe);
|
40
|
-
extern int fe_isnegative(const fe);
|
41
|
-
extern void fe_0(fe);
|
42
|
-
extern void fe_1(fe);
|
43
|
-
extern void fe_cswap(fe,fe,unsigned int);
|
44
|
-
extern void fe_cmov(fe,const fe,unsigned int);
|
45
|
-
|
46
|
-
extern void fe_add(fe,const fe,const fe);
|
47
|
-
extern void fe_sub(fe,const fe,const fe);
|
48
|
-
extern void fe_neg(fe,const fe);
|
49
|
-
extern void fe_mul(fe,const fe,const fe);
|
50
|
-
extern void fe_sq(fe,const fe);
|
51
|
-
extern void fe_sq2(fe,const fe);
|
52
|
-
extern void fe_mul121666(fe,const fe);
|
53
|
-
extern void fe_invert(fe,const fe);
|
54
|
-
extern void fe_pow22523(fe,const fe);
|
55
|
-
|
56
|
-
#endif
|
@@ -1,57 +0,0 @@
|
|
1
|
-
#include "fe.h"
|
2
|
-
|
3
|
-
/*
|
4
|
-
h = f + g
|
5
|
-
Can overlap h with f or g.
|
6
|
-
|
7
|
-
Preconditions:
|
8
|
-
|f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
|
9
|
-
|g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
|
10
|
-
|
11
|
-
Postconditions:
|
12
|
-
|h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
|
13
|
-
*/
|
14
|
-
|
15
|
-
void fe_add(fe h,const fe f,const fe g)
|
16
|
-
{
|
17
|
-
crypto_int32 f0 = f[0];
|
18
|
-
crypto_int32 f1 = f[1];
|
19
|
-
crypto_int32 f2 = f[2];
|
20
|
-
crypto_int32 f3 = f[3];
|
21
|
-
crypto_int32 f4 = f[4];
|
22
|
-
crypto_int32 f5 = f[5];
|
23
|
-
crypto_int32 f6 = f[6];
|
24
|
-
crypto_int32 f7 = f[7];
|
25
|
-
crypto_int32 f8 = f[8];
|
26
|
-
crypto_int32 f9 = f[9];
|
27
|
-
crypto_int32 g0 = g[0];
|
28
|
-
crypto_int32 g1 = g[1];
|
29
|
-
crypto_int32 g2 = g[2];
|
30
|
-
crypto_int32 g3 = g[3];
|
31
|
-
crypto_int32 g4 = g[4];
|
32
|
-
crypto_int32 g5 = g[5];
|
33
|
-
crypto_int32 g6 = g[6];
|
34
|
-
crypto_int32 g7 = g[7];
|
35
|
-
crypto_int32 g8 = g[8];
|
36
|
-
crypto_int32 g9 = g[9];
|
37
|
-
crypto_int32 h0 = f0 + g0;
|
38
|
-
crypto_int32 h1 = f1 + g1;
|
39
|
-
crypto_int32 h2 = f2 + g2;
|
40
|
-
crypto_int32 h3 = f3 + g3;
|
41
|
-
crypto_int32 h4 = f4 + g4;
|
42
|
-
crypto_int32 h5 = f5 + g5;
|
43
|
-
crypto_int32 h6 = f6 + g6;
|
44
|
-
crypto_int32 h7 = f7 + g7;
|
45
|
-
crypto_int32 h8 = f8 + g8;
|
46
|
-
crypto_int32 h9 = f9 + g9;
|
47
|
-
h[0] = h0;
|
48
|
-
h[1] = h1;
|
49
|
-
h[2] = h2;
|
50
|
-
h[3] = h3;
|
51
|
-
h[4] = h4;
|
52
|
-
h[5] = h5;
|
53
|
-
h[6] = h6;
|
54
|
-
h[7] = h7;
|
55
|
-
h[8] = h8;
|
56
|
-
h[9] = h9;
|
57
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
#include "fe.h"
|
2
|
-
|
3
|
-
/*
|
4
|
-
Replace (f,g) with (g,g) if b == 1;
|
5
|
-
replace (f,g) with (f,g) if b == 0.
|
6
|
-
|
7
|
-
Preconditions: b in {0,1}.
|
8
|
-
*/
|
9
|
-
|
10
|
-
void fe_cmov(fe f,const fe g,unsigned int b)
|
11
|
-
{
|
12
|
-
crypto_int32 f0 = f[0];
|
13
|
-
crypto_int32 f1 = f[1];
|
14
|
-
crypto_int32 f2 = f[2];
|
15
|
-
crypto_int32 f3 = f[3];
|
16
|
-
crypto_int32 f4 = f[4];
|
17
|
-
crypto_int32 f5 = f[5];
|
18
|
-
crypto_int32 f6 = f[6];
|
19
|
-
crypto_int32 f7 = f[7];
|
20
|
-
crypto_int32 f8 = f[8];
|
21
|
-
crypto_int32 f9 = f[9];
|
22
|
-
crypto_int32 g0 = g[0];
|
23
|
-
crypto_int32 g1 = g[1];
|
24
|
-
crypto_int32 g2 = g[2];
|
25
|
-
crypto_int32 g3 = g[3];
|
26
|
-
crypto_int32 g4 = g[4];
|
27
|
-
crypto_int32 g5 = g[5];
|
28
|
-
crypto_int32 g6 = g[6];
|
29
|
-
crypto_int32 g7 = g[7];
|
30
|
-
crypto_int32 g8 = g[8];
|
31
|
-
crypto_int32 g9 = g[9];
|
32
|
-
crypto_int32 x0 = f0 ^ g0;
|
33
|
-
crypto_int32 x1 = f1 ^ g1;
|
34
|
-
crypto_int32 x2 = f2 ^ g2;
|
35
|
-
crypto_int32 x3 = f3 ^ g3;
|
36
|
-
crypto_int32 x4 = f4 ^ g4;
|
37
|
-
crypto_int32 x5 = f5 ^ g5;
|
38
|
-
crypto_int32 x6 = f6 ^ g6;
|
39
|
-
crypto_int32 x7 = f7 ^ g7;
|
40
|
-
crypto_int32 x8 = f8 ^ g8;
|
41
|
-
crypto_int32 x9 = f9 ^ g9;
|
42
|
-
b = (unsigned int) (- (int) b);
|
43
|
-
x0 &= b;
|
44
|
-
x1 &= b;
|
45
|
-
x2 &= b;
|
46
|
-
x3 &= b;
|
47
|
-
x4 &= b;
|
48
|
-
x5 &= b;
|
49
|
-
x6 &= b;
|
50
|
-
x7 &= b;
|
51
|
-
x8 &= b;
|
52
|
-
x9 &= b;
|
53
|
-
f[0] = f0 ^ x0;
|
54
|
-
f[1] = f1 ^ x1;
|
55
|
-
f[2] = f2 ^ x2;
|
56
|
-
f[3] = f3 ^ x3;
|
57
|
-
f[4] = f4 ^ x4;
|
58
|
-
f[5] = f5 ^ x5;
|
59
|
-
f[6] = f6 ^ x6;
|
60
|
-
f[7] = f7 ^ x7;
|
61
|
-
f[8] = f8 ^ x8;
|
62
|
-
f[9] = f9 ^ x9;
|
63
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
#include "fe.h"
|
2
|
-
|
3
|
-
/*
|
4
|
-
h = f
|
5
|
-
*/
|
6
|
-
|
7
|
-
void fe_copy(fe h,const fe f)
|
8
|
-
{
|
9
|
-
crypto_int32 f0 = f[0];
|
10
|
-
crypto_int32 f1 = f[1];
|
11
|
-
crypto_int32 f2 = f[2];
|
12
|
-
crypto_int32 f3 = f[3];
|
13
|
-
crypto_int32 f4 = f[4];
|
14
|
-
crypto_int32 f5 = f[5];
|
15
|
-
crypto_int32 f6 = f[6];
|
16
|
-
crypto_int32 f7 = f[7];
|
17
|
-
crypto_int32 f8 = f[8];
|
18
|
-
crypto_int32 f9 = f[9];
|
19
|
-
h[0] = f0;
|
20
|
-
h[1] = f1;
|
21
|
-
h[2] = f2;
|
22
|
-
h[3] = f3;
|
23
|
-
h[4] = f4;
|
24
|
-
h[5] = f5;
|
25
|
-
h[6] = f6;
|
26
|
-
h[7] = f7;
|
27
|
-
h[8] = f8;
|
28
|
-
h[9] = f9;
|
29
|
-
}
|
@@ -1,73 +0,0 @@
|
|
1
|
-
#include "fe.h"
|
2
|
-
#include "crypto_int64.h"
|
3
|
-
#include "crypto_uint64.h"
|
4
|
-
|
5
|
-
static crypto_uint64 load_3(const unsigned char *in)
|
6
|
-
{
|
7
|
-
crypto_uint64 result;
|
8
|
-
result = (crypto_uint64) in[0];
|
9
|
-
result |= ((crypto_uint64) in[1]) << 8;
|
10
|
-
result |= ((crypto_uint64) in[2]) << 16;
|
11
|
-
return result;
|
12
|
-
}
|
13
|
-
|
14
|
-
static crypto_uint64 load_4(const unsigned char *in)
|
15
|
-
{
|
16
|
-
crypto_uint64 result;
|
17
|
-
result = (crypto_uint64) in[0];
|
18
|
-
result |= ((crypto_uint64) in[1]) << 8;
|
19
|
-
result |= ((crypto_uint64) in[2]) << 16;
|
20
|
-
result |= ((crypto_uint64) in[3]) << 24;
|
21
|
-
return result;
|
22
|
-
}
|
23
|
-
|
24
|
-
/*
|
25
|
-
Ignores top bit of h.
|
26
|
-
*/
|
27
|
-
|
28
|
-
void fe_frombytes(fe h,const unsigned char *s)
|
29
|
-
{
|
30
|
-
crypto_int64 h0 = load_4(s);
|
31
|
-
crypto_int64 h1 = load_3(s + 4) << 6;
|
32
|
-
crypto_int64 h2 = load_3(s + 7) << 5;
|
33
|
-
crypto_int64 h3 = load_3(s + 10) << 3;
|
34
|
-
crypto_int64 h4 = load_3(s + 13) << 2;
|
35
|
-
crypto_int64 h5 = load_4(s + 16);
|
36
|
-
crypto_int64 h6 = load_3(s + 20) << 7;
|
37
|
-
crypto_int64 h7 = load_3(s + 23) << 5;
|
38
|
-
crypto_int64 h8 = load_3(s + 26) << 4;
|
39
|
-
crypto_int64 h9 = (load_3(s + 29) & 8388607) << 2;
|
40
|
-
crypto_int64 carry0;
|
41
|
-
crypto_int64 carry1;
|
42
|
-
crypto_int64 carry2;
|
43
|
-
crypto_int64 carry3;
|
44
|
-
crypto_int64 carry4;
|
45
|
-
crypto_int64 carry5;
|
46
|
-
crypto_int64 carry6;
|
47
|
-
crypto_int64 carry7;
|
48
|
-
crypto_int64 carry8;
|
49
|
-
crypto_int64 carry9;
|
50
|
-
|
51
|
-
carry9 = (h9 + (crypto_int64) (1L << 24)) >> 25; h0 += carry9 * 19; h9 -= carry9 << 25;
|
52
|
-
carry1 = (h1 + (crypto_int64) (1L << 24)) >> 25; h2 += carry1; h1 -= carry1 << 25;
|
53
|
-
carry3 = (h3 + (crypto_int64) (1L << 24)) >> 25; h4 += carry3; h3 -= carry3 << 25;
|
54
|
-
carry5 = (h5 + (crypto_int64) (1L << 24)) >> 25; h6 += carry5; h5 -= carry5 << 25;
|
55
|
-
carry7 = (h7 + (crypto_int64) (1L << 24)) >> 25; h8 += carry7; h7 -= carry7 << 25;
|
56
|
-
|
57
|
-
carry0 = (h0 + (crypto_int64) (1L << 25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
|
58
|
-
carry2 = (h2 + (crypto_int64) (1L << 25)) >> 26; h3 += carry2; h2 -= carry2 << 26;
|
59
|
-
carry4 = (h4 + (crypto_int64) (1L << 25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
|
60
|
-
carry6 = (h6 + (crypto_int64) (1L << 25)) >> 26; h7 += carry6; h6 -= carry6 << 26;
|
61
|
-
carry8 = (h8 + (crypto_int64) (1L << 25)) >> 26; h9 += carry8; h8 -= carry8 << 26;
|
62
|
-
|
63
|
-
h[0] = (crypto_int32) h0;
|
64
|
-
h[1] = (crypto_int32) h1;
|
65
|
-
h[2] = (crypto_int32) h2;
|
66
|
-
h[3] = (crypto_int32) h3;
|
67
|
-
h[4] = (crypto_int32) h4;
|
68
|
-
h[5] = (crypto_int32) h5;
|
69
|
-
h[6] = (crypto_int32) h6;
|
70
|
-
h[7] = (crypto_int32) h7;
|
71
|
-
h[8] = (crypto_int32) h8;
|
72
|
-
h[9] = (crypto_int32) h9;
|
73
|
-
}
|