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.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +4 -0
  3. data/lib/rbnacl/libsodium/version.rb +1 -1
  4. data/vendor/libsodium/ChangeLog +5 -0
  5. data/vendor/libsodium/README.markdown +4 -1
  6. data/vendor/libsodium/autogen.sh +0 -5
  7. data/vendor/libsodium/autom4te.cache/output.1 +14 -14
  8. data/vendor/libsodium/autom4te.cache/output.5 +14 -14
  9. data/vendor/libsodium/autom4te.cache/requests +868 -868
  10. data/vendor/libsodium/autom4te.cache/traces.1 +1 -1
  11. data/vendor/libsodium/builds/msvc/version.h +2 -2
  12. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +10 -72
  13. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +36 -216
  14. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +10 -72
  15. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +34 -214
  16. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +10 -72
  17. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +34 -214
  18. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +10 -72
  19. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +25 -205
  20. data/vendor/libsodium/configure +14 -14
  21. data/vendor/libsodium/configure.ac +5 -5
  22. data/vendor/libsodium/dist-build/msys2-win32.sh +3 -2
  23. data/vendor/libsodium/dist-build/msys2-win64.sh +3 -2
  24. data/vendor/libsodium/examples/sign.c +2 -2
  25. data/vendor/libsodium/examples/utils.h +3 -1
  26. data/vendor/libsodium/libsodium.vcxproj +7 -53
  27. data/vendor/libsodium/libsodium.vcxproj.filters +18 -152
  28. data/vendor/libsodium/msvc-scripts/process.bat +2 -2
  29. data/vendor/libsodium/src/libsodium/Makefile.am +6 -68
  30. data/vendor/libsodium/src/libsodium/Makefile.in +49 -724
  31. data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +2 -2
  32. data/vendor/libsodium/src/libsodium/{crypto_sign/ed25519 → crypto_core/curve25519}/ref10/base.h +0 -0
  33. data/vendor/libsodium/src/libsodium/{crypto_sign/ed25519 → crypto_core/curve25519}/ref10/base2.h +0 -0
  34. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c +2233 -0
  35. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.h +160 -0
  36. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +2 -2
  37. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +1 -1
  38. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +1 -1
  39. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +1 -1
  40. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +2 -2
  41. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +2 -2
  42. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c +1 -1
  43. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +255 -0
  44. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/{curve25519_ref10.h → x25519_ref10.h} +0 -0
  45. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +1 -1
  46. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +1 -2
  47. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +2 -4
  48. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +1 -2
  49. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +1 -2
  50. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c +1 -1
  51. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.c +16 -9
  52. data/vendor/libsodium/src/libsodium/include/sodium/export.h +2 -2
  53. data/vendor/libsodium/src/libsodium/include/sodium/utils.h +6 -4
  54. data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +12 -8
  55. data/vendor/libsodium/src/libsodium/sodium/core.c +9 -0
  56. data/vendor/libsodium/src/libsodium/sodium/runtime.c +32 -10
  57. data/vendor/libsodium/src/libsodium/sodium/utils.c +8 -8
  58. data/vendor/libsodium/test/default/auth.c +1 -1
  59. data/vendor/libsodium/test/default/box.c +16 -4
  60. data/vendor/libsodium/test/default/box2.c +7 -0
  61. data/vendor/libsodium/test/default/box7.c +18 -10
  62. data/vendor/libsodium/test/default/box8.c +1 -1
  63. data/vendor/libsodium/test/default/box_easy2.c +13 -0
  64. data/vendor/libsodium/test/default/onetimeauth.c +1 -0
  65. data/vendor/libsodium/test/default/pwhash_scrypt_ll.c +2 -2
  66. data/vendor/libsodium/test/default/verify1.c +1 -1
  67. metadata +9 -71
  68. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/curve25519_ref10.c +0 -73
  69. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe.h +0 -44
  70. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_0_curve25519_ref10.c +0 -23
  71. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_1_curve25519_ref10.c +0 -23
  72. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_add_curve25519_ref10.c +0 -61
  73. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_copy_curve25519_ref10.c +0 -33
  74. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_cswap_curve25519_ref10.c +0 -77
  75. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_frombytes_curve25519_ref10.c +0 -74
  76. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_invert_curve25519_ref10.c +0 -18
  77. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_mul121666_curve25519_ref10.c +0 -74
  78. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_mul_curve25519_ref10.c +0 -257
  79. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_sq_curve25519_ref10.c +0 -153
  80. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_sub_curve25519_ref10.c +0 -61
  81. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_tobytes_curve25519_ref10.c +0 -123
  82. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/montgomery.h +0 -140
  83. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/pow225521.h +0 -160
  84. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d.h +0 -1
  85. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d2.h +0 -1
  86. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe.h +0 -56
  87. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_0.c +0 -19
  88. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_1.c +0 -19
  89. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_add.c +0 -57
  90. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_cmov.c +0 -63
  91. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_copy.c +0 -29
  92. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_frombytes.c +0 -73
  93. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_invert.c +0 -14
  94. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnegative.c +0 -16
  95. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnonzero.c +0 -19
  96. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_mul.c +0 -253
  97. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_neg.c +0 -45
  98. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_pow22523.c +0 -13
  99. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq.c +0 -149
  100. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq2.c +0 -160
  101. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sub.c +0 -57
  102. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_tobytes.c +0 -119
  103. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge.h +0 -97
  104. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.c +0 -11
  105. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.h +0 -97
  106. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_double_scalarmult.c +0 -138
  107. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_frombytes.c +0 -50
  108. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.c +0 -11
  109. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.h +0 -88
  110. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.c +0 -11
  111. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.h +0 -88
  112. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p2.c +0 -12
  113. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p3.c +0 -13
  114. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_0.c +0 -8
  115. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.c +0 -11
  116. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.h +0 -73
  117. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_0.c +0 -9
  118. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_dbl.c +0 -12
  119. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_cached.c +0 -17
  120. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_p2.c +0 -12
  121. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_tobytes.c +0 -14
  122. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_precomp_0.c +0 -8
  123. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_scalarmult_base.c +0 -111
  124. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.c +0 -11
  125. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.h +0 -97
  126. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_tobytes.c +0 -14
  127. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/pow22523.h +0 -160
  128. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/pow225521.h +0 -160
  129. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc.h +0 -15
  130. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_muladd.c +0 -368
  131. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_reduce.c +0 -275
  132. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sqrtm1.h +0 -1
@@ -1,9 +0,0 @@
1
- #include "ge.h"
2
-
3
- void ge_p3_0(ge_p3 *h)
4
- {
5
- fe_0(h->X);
6
- fe_1(h->Y);
7
- fe_1(h->Z);
8
- fe_0(h->T);
9
- }
@@ -1,12 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = 2 * p
5
- */
6
-
7
- void ge_p3_dbl(ge_p1p1 *r,const ge_p3 *p)
8
- {
9
- ge_p2 q;
10
- ge_p3_to_p2(&q,p);
11
- ge_p2_dbl(r,&q);
12
- }
@@ -1,17 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = p
5
- */
6
-
7
- static const fe d2 = {
8
- #include "d2.h"
9
- } ;
10
-
11
- extern void ge_p3_to_cached(ge_cached *r,const ge_p3 *p)
12
- {
13
- fe_add(r->YplusX,p->Y,p->X);
14
- fe_sub(r->YminusX,p->Y,p->X);
15
- fe_copy(r->Z,p->Z);
16
- fe_mul(r->T2d,p->T,d2);
17
- }
@@ -1,12 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = p
5
- */
6
-
7
- extern void ge_p3_to_p2(ge_p2 *r,const ge_p3 *p)
8
- {
9
- fe_copy(r->X,p->X);
10
- fe_copy(r->Y,p->Y);
11
- fe_copy(r->Z,p->Z);
12
- }
@@ -1,14 +0,0 @@
1
- #include "ge.h"
2
-
3
- void ge_p3_tobytes(unsigned char *s,const ge_p3 *h)
4
- {
5
- fe recip;
6
- fe x;
7
- fe y;
8
-
9
- fe_invert(recip,h->Z);
10
- fe_mul(x,h->X,recip);
11
- fe_mul(y,h->Y,recip);
12
- fe_tobytes(s,y);
13
- s[31] ^= fe_isnegative(x) << 7;
14
- }
@@ -1,8 +0,0 @@
1
- #include "ge.h"
2
-
3
- void ge_precomp_0(ge_precomp *h)
4
- {
5
- fe_1(h->yplusx);
6
- fe_1(h->yminusx);
7
- fe_0(h->xy2d);
8
- }
@@ -1,111 +0,0 @@
1
- #include "ge.h"
2
- #include "crypto_uint32.h"
3
-
4
- #ifdef __cplusplus
5
- # if __GNUC__
6
- # pragma GCC diagnostic ignored "-Wlong-long"
7
- # endif
8
- #endif
9
-
10
- static unsigned char equal(signed char b,signed char c)
11
- {
12
- unsigned char ub = b;
13
- unsigned char uc = c;
14
- unsigned char x = ub ^ uc; /* 0: yes; 1..255: no */
15
- crypto_uint32 y = x; /* 0: yes; 1..255: no */
16
- y -= 1; /* 4294967295: yes; 0..254: no */
17
- y >>= 31; /* 1: yes; 0: no */
18
- return y;
19
- }
20
-
21
- static unsigned char negative(signed char b)
22
- {
23
- unsigned long long x = b; /* 18446744073709551361..18446744073709551615: yes; 0..255: no */
24
- x >>= 63; /* 1: yes; 0: no */
25
- return x;
26
- }
27
-
28
- static void cmov(ge_precomp *t,ge_precomp *u,unsigned char b)
29
- {
30
- fe_cmov(t->yplusx,u->yplusx,b);
31
- fe_cmov(t->yminusx,u->yminusx,b);
32
- fe_cmov(t->xy2d,u->xy2d,b);
33
- }
34
-
35
- /* base[i][j] = (j+1)*256^i*B */
36
- static ge_precomp base[32][8] = {
37
- #include "base.h"
38
- } ;
39
-
40
- static void ge_select(ge_precomp *t,int pos,signed char b)
41
- {
42
- ge_precomp minust;
43
- unsigned char bnegative = negative(b);
44
- unsigned char babs = b - (((-bnegative) & b) << 1);
45
-
46
- ge_precomp_0(t);
47
- cmov(t,&base[pos][0],equal(babs,1));
48
- cmov(t,&base[pos][1],equal(babs,2));
49
- cmov(t,&base[pos][2],equal(babs,3));
50
- cmov(t,&base[pos][3],equal(babs,4));
51
- cmov(t,&base[pos][4],equal(babs,5));
52
- cmov(t,&base[pos][5],equal(babs,6));
53
- cmov(t,&base[pos][6],equal(babs,7));
54
- cmov(t,&base[pos][7],equal(babs,8));
55
- fe_copy(minust.yplusx,t->yminusx);
56
- fe_copy(minust.yminusx,t->yplusx);
57
- fe_neg(minust.xy2d,t->xy2d);
58
- cmov(t,&minust,bnegative);
59
- }
60
-
61
- /*
62
- h = a * B
63
- where a = a[0]+256*a[1]+...+256^31 a[31]
64
- B is the Ed25519 base point (x,4/5) with x positive.
65
-
66
- Preconditions:
67
- a[31] <= 127
68
- */
69
-
70
- void ge_scalarmult_base(ge_p3 *h,const unsigned char *a)
71
- {
72
- signed char e[64];
73
- signed char carry;
74
- ge_p1p1 r;
75
- ge_p2 s;
76
- ge_precomp t;
77
- int i;
78
-
79
- for (i = 0;i < 32;++i) {
80
- e[2 * i + 0] = (a[i] >> 0) & 15;
81
- e[2 * i + 1] = (a[i] >> 4) & 15;
82
- }
83
- /* each e[i] is between 0 and 15 */
84
- /* e[63] is between 0 and 7 */
85
-
86
- carry = 0;
87
- for (i = 0;i < 63;++i) {
88
- e[i] += carry;
89
- carry = e[i] + 8;
90
- carry >>= 4;
91
- e[i] -= carry << 4;
92
- }
93
- e[63] += carry;
94
- /* each e[i] is between -8 and 8 */
95
-
96
- ge_p3_0(h);
97
- for (i = 1;i < 64;i += 2) {
98
- ge_select(&t,i / 2,e[i]);
99
- ge_madd(&r,h,&t); ge_p1p1_to_p3(h,&r);
100
- }
101
-
102
- ge_p3_dbl(&r,h); ge_p1p1_to_p2(&s,&r);
103
- ge_p2_dbl(&r,&s); ge_p1p1_to_p2(&s,&r);
104
- ge_p2_dbl(&r,&s); ge_p1p1_to_p2(&s,&r);
105
- ge_p2_dbl(&r,&s); ge_p1p1_to_p3(h,&r);
106
-
107
- for (i = 0;i < 64;i += 2) {
108
- ge_select(&t,i / 2,e[i]);
109
- ge_madd(&r,h,&t); ge_p1p1_to_p3(h,&r);
110
- }
111
- }
@@ -1,11 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = p - q
5
- */
6
-
7
- void ge_sub(ge_p1p1 *r,const ge_p3 *p,const ge_cached *q)
8
- {
9
- fe t0;
10
- #include "ge_sub.h"
11
- }
@@ -1,97 +0,0 @@
1
-
2
- /* qhasm: enter ge_sub */
3
-
4
- /* qhasm: fe X1 */
5
-
6
- /* qhasm: fe Y1 */
7
-
8
- /* qhasm: fe Z1 */
9
-
10
- /* qhasm: fe Z2 */
11
-
12
- /* qhasm: fe T1 */
13
-
14
- /* qhasm: fe ZZ */
15
-
16
- /* qhasm: fe YpX2 */
17
-
18
- /* qhasm: fe YmX2 */
19
-
20
- /* qhasm: fe T2d2 */
21
-
22
- /* qhasm: fe X3 */
23
-
24
- /* qhasm: fe Y3 */
25
-
26
- /* qhasm: fe Z3 */
27
-
28
- /* qhasm: fe T3 */
29
-
30
- /* qhasm: fe YpX1 */
31
-
32
- /* qhasm: fe YmX1 */
33
-
34
- /* qhasm: fe A */
35
-
36
- /* qhasm: fe B */
37
-
38
- /* qhasm: fe C */
39
-
40
- /* qhasm: fe D */
41
-
42
- /* qhasm: YpX1 = Y1+X1 */
43
- /* asm 1: fe_add(>YpX1=fe#1,<Y1=fe#12,<X1=fe#11); */
44
- /* asm 2: fe_add(>YpX1=r->X,<Y1=p->Y,<X1=p->X); */
45
- fe_add(r->X,p->Y,p->X);
46
-
47
- /* qhasm: YmX1 = Y1-X1 */
48
- /* asm 1: fe_sub(>YmX1=fe#2,<Y1=fe#12,<X1=fe#11); */
49
- /* asm 2: fe_sub(>YmX1=r->Y,<Y1=p->Y,<X1=p->X); */
50
- fe_sub(r->Y,p->Y,p->X);
51
-
52
- /* qhasm: A = YpX1*YmX2 */
53
- /* asm 1: fe_mul(>A=fe#3,<YpX1=fe#1,<YmX2=fe#16); */
54
- /* asm 2: fe_mul(>A=r->Z,<YpX1=r->X,<YmX2=q->YminusX); */
55
- fe_mul(r->Z,r->X,q->YminusX);
56
-
57
- /* qhasm: B = YmX1*YpX2 */
58
- /* asm 1: fe_mul(>B=fe#2,<YmX1=fe#2,<YpX2=fe#15); */
59
- /* asm 2: fe_mul(>B=r->Y,<YmX1=r->Y,<YpX2=q->YplusX); */
60
- fe_mul(r->Y,r->Y,q->YplusX);
61
-
62
- /* qhasm: C = T2d2*T1 */
63
- /* asm 1: fe_mul(>C=fe#4,<T2d2=fe#18,<T1=fe#14); */
64
- /* asm 2: fe_mul(>C=r->T,<T2d2=q->T2d,<T1=p->T); */
65
- fe_mul(r->T,q->T2d,p->T);
66
-
67
- /* qhasm: ZZ = Z1*Z2 */
68
- /* asm 1: fe_mul(>ZZ=fe#1,<Z1=fe#13,<Z2=fe#17); */
69
- /* asm 2: fe_mul(>ZZ=r->X,<Z1=p->Z,<Z2=q->Z); */
70
- fe_mul(r->X,p->Z,q->Z);
71
-
72
- /* qhasm: D = 2*ZZ */
73
- /* asm 1: fe_add(>D=fe#5,<ZZ=fe#1,<ZZ=fe#1); */
74
- /* asm 2: fe_add(>D=t0,<ZZ=r->X,<ZZ=r->X); */
75
- fe_add(t0,r->X,r->X);
76
-
77
- /* qhasm: X3 = A-B */
78
- /* asm 1: fe_sub(>X3=fe#1,<A=fe#3,<B=fe#2); */
79
- /* asm 2: fe_sub(>X3=r->X,<A=r->Z,<B=r->Y); */
80
- fe_sub(r->X,r->Z,r->Y);
81
-
82
- /* qhasm: Y3 = A+B */
83
- /* asm 1: fe_add(>Y3=fe#2,<A=fe#3,<B=fe#2); */
84
- /* asm 2: fe_add(>Y3=r->Y,<A=r->Z,<B=r->Y); */
85
- fe_add(r->Y,r->Z,r->Y);
86
-
87
- /* qhasm: Z3 = D-C */
88
- /* asm 1: fe_sub(>Z3=fe#3,<D=fe#5,<C=fe#4); */
89
- /* asm 2: fe_sub(>Z3=r->Z,<D=t0,<C=r->T); */
90
- fe_sub(r->Z,t0,r->T);
91
-
92
- /* qhasm: T3 = D+C */
93
- /* asm 1: fe_add(>T3=fe#4,<D=fe#5,<C=fe#4); */
94
- /* asm 2: fe_add(>T3=r->T,<D=t0,<C=r->T); */
95
- fe_add(r->T,t0,r->T);
96
-
97
- /* qhasm: return */
@@ -1,14 +0,0 @@
1
- #include "ge.h"
2
-
3
- void ge_tobytes(unsigned char *s,const ge_p2 *h)
4
- {
5
- fe recip;
6
- fe x;
7
- fe y;
8
-
9
- fe_invert(recip,h->Z);
10
- fe_mul(x,h->X,recip);
11
- fe_mul(y,h->Y,recip);
12
- fe_tobytes(s,y);
13
- s[31] ^= fe_isnegative(x) << 7;
14
- }
@@ -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_252_2 */
45
-
46
- /* qhasm: fe z_252_3 */
47
-
48
- /* qhasm: enter pow22523 */
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#1,<z11=fe#1); for (i = 1;i < 1;++i) fe_sq(>z22=fe#1,>z22=fe#1); */
72
- /* asm 2: fe_sq(>z22=t0,<z11=t0); for (i = 1;i < 1;++i) fe_sq(>z22=t0,>z22=t0); */
73
- fe_sq(t0,t0); /* for (i = 1;i < 1;++i) fe_sq(t0,t0); */
74
-
75
- /* qhasm: z_5_0 = z9*z22 */
76
- /* asm 1: fe_mul(>z_5_0=fe#1,<z9=fe#2,<z22=fe#1); */
77
- /* asm 2: fe_mul(>z_5_0=t0,<z9=t1,<z22=t0); */
78
- fe_mul(t0,t1,t0);
79
-
80
- /* qhasm: z_10_5 = z_5_0^2^5 */
81
- /* asm 1: fe_sq(>z_10_5=fe#2,<z_5_0=fe#1); for (i = 1;i < 5;++i) fe_sq(>z_10_5=fe#2,>z_10_5=fe#2); */
82
- /* asm 2: fe_sq(>z_10_5=t1,<z_5_0=t0); for (i = 1;i < 5;++i) fe_sq(>z_10_5=t1,>z_10_5=t1); */
83
- fe_sq(t1,t0); for (i = 1;i < 5;++i) fe_sq(t1,t1);
84
-
85
- /* qhasm: z_10_0 = z_10_5*z_5_0 */
86
- /* asm 1: fe_mul(>z_10_0=fe#1,<z_10_5=fe#2,<z_5_0=fe#1); */
87
- /* asm 2: fe_mul(>z_10_0=t0,<z_10_5=t1,<z_5_0=t0); */
88
- fe_mul(t0,t1,t0);
89
-
90
- /* qhasm: z_20_10 = z_10_0^2^10 */
91
- /* asm 1: fe_sq(>z_20_10=fe#2,<z_10_0=fe#1); for (i = 1;i < 10;++i) fe_sq(>z_20_10=fe#2,>z_20_10=fe#2); */
92
- /* asm 2: fe_sq(>z_20_10=t1,<z_10_0=t0); for (i = 1;i < 10;++i) fe_sq(>z_20_10=t1,>z_20_10=t1); */
93
- fe_sq(t1,t0); for (i = 1;i < 10;++i) fe_sq(t1,t1);
94
-
95
- /* qhasm: z_20_0 = z_20_10*z_10_0 */
96
- /* asm 1: fe_mul(>z_20_0=fe#2,<z_20_10=fe#2,<z_10_0=fe#1); */
97
- /* asm 2: fe_mul(>z_20_0=t1,<z_20_10=t1,<z_10_0=t0); */
98
- fe_mul(t1,t1,t0);
99
-
100
- /* qhasm: z_40_20 = z_20_0^2^20 */
101
- /* asm 1: fe_sq(>z_40_20=fe#3,<z_20_0=fe#2); for (i = 1;i < 20;++i) fe_sq(>z_40_20=fe#3,>z_40_20=fe#3); */
102
- /* asm 2: fe_sq(>z_40_20=t2,<z_20_0=t1); for (i = 1;i < 20;++i) fe_sq(>z_40_20=t2,>z_40_20=t2); */
103
- fe_sq(t2,t1); for (i = 1;i < 20;++i) fe_sq(t2,t2);
104
-
105
- /* qhasm: z_40_0 = z_40_20*z_20_0 */
106
- /* asm 1: fe_mul(>z_40_0=fe#2,<z_40_20=fe#3,<z_20_0=fe#2); */
107
- /* asm 2: fe_mul(>z_40_0=t1,<z_40_20=t2,<z_20_0=t1); */
108
- fe_mul(t1,t2,t1);
109
-
110
- /* qhasm: z_50_10 = z_40_0^2^10 */
111
- /* asm 1: fe_sq(>z_50_10=fe#2,<z_40_0=fe#2); for (i = 1;i < 10;++i) fe_sq(>z_50_10=fe#2,>z_50_10=fe#2); */
112
- /* asm 2: fe_sq(>z_50_10=t1,<z_40_0=t1); for (i = 1;i < 10;++i) fe_sq(>z_50_10=t1,>z_50_10=t1); */
113
- fe_sq(t1,t1); for (i = 1;i < 10;++i) fe_sq(t1,t1);
114
-
115
- /* qhasm: z_50_0 = z_50_10*z_10_0 */
116
- /* asm 1: fe_mul(>z_50_0=fe#1,<z_50_10=fe#2,<z_10_0=fe#1); */
117
- /* asm 2: fe_mul(>z_50_0=t0,<z_50_10=t1,<z_10_0=t0); */
118
- fe_mul(t0,t1,t0);
119
-
120
- /* qhasm: z_100_50 = z_50_0^2^50 */
121
- /* asm 1: fe_sq(>z_100_50=fe#2,<z_50_0=fe#1); for (i = 1;i < 50;++i) fe_sq(>z_100_50=fe#2,>z_100_50=fe#2); */
122
- /* asm 2: fe_sq(>z_100_50=t1,<z_50_0=t0); for (i = 1;i < 50;++i) fe_sq(>z_100_50=t1,>z_100_50=t1); */
123
- fe_sq(t1,t0); for (i = 1;i < 50;++i) fe_sq(t1,t1);
124
-
125
- /* qhasm: z_100_0 = z_100_50*z_50_0 */
126
- /* asm 1: fe_mul(>z_100_0=fe#2,<z_100_50=fe#2,<z_50_0=fe#1); */
127
- /* asm 2: fe_mul(>z_100_0=t1,<z_100_50=t1,<z_50_0=t0); */
128
- fe_mul(t1,t1,t0);
129
-
130
- /* qhasm: z_200_100 = z_100_0^2^100 */
131
- /* asm 1: fe_sq(>z_200_100=fe#3,<z_100_0=fe#2); for (i = 1;i < 100;++i) fe_sq(>z_200_100=fe#3,>z_200_100=fe#3); */
132
- /* asm 2: fe_sq(>z_200_100=t2,<z_100_0=t1); for (i = 1;i < 100;++i) fe_sq(>z_200_100=t2,>z_200_100=t2); */
133
- fe_sq(t2,t1); for (i = 1;i < 100;++i) fe_sq(t2,t2);
134
-
135
- /* qhasm: z_200_0 = z_200_100*z_100_0 */
136
- /* asm 1: fe_mul(>z_200_0=fe#2,<z_200_100=fe#3,<z_100_0=fe#2); */
137
- /* asm 2: fe_mul(>z_200_0=t1,<z_200_100=t2,<z_100_0=t1); */
138
- fe_mul(t1,t2,t1);
139
-
140
- /* qhasm: z_250_50 = z_200_0^2^50 */
141
- /* asm 1: fe_sq(>z_250_50=fe#2,<z_200_0=fe#2); for (i = 1;i < 50;++i) fe_sq(>z_250_50=fe#2,>z_250_50=fe#2); */
142
- /* asm 2: fe_sq(>z_250_50=t1,<z_200_0=t1); for (i = 1;i < 50;++i) fe_sq(>z_250_50=t1,>z_250_50=t1); */
143
- fe_sq(t1,t1); for (i = 1;i < 50;++i) fe_sq(t1,t1);
144
-
145
- /* qhasm: z_250_0 = z_250_50*z_50_0 */
146
- /* asm 1: fe_mul(>z_250_0=fe#1,<z_250_50=fe#2,<z_50_0=fe#1); */
147
- /* asm 2: fe_mul(>z_250_0=t0,<z_250_50=t1,<z_50_0=t0); */
148
- fe_mul(t0,t1,t0);
149
-
150
- /* qhasm: z_252_2 = z_250_0^2^2 */
151
- /* asm 1: fe_sq(>z_252_2=fe#1,<z_250_0=fe#1); for (i = 1;i < 2;++i) fe_sq(>z_252_2=fe#1,>z_252_2=fe#1); */
152
- /* asm 2: fe_sq(>z_252_2=t0,<z_250_0=t0); for (i = 1;i < 2;++i) fe_sq(>z_252_2=t0,>z_252_2=t0); */
153
- fe_sq(t0,t0); for (i = 1;i < 2;++i) fe_sq(t0,t0);
154
-
155
- /* qhasm: z_252_3 = z_252_2*z1 */
156
- /* asm 1: fe_mul(>z_252_3=fe#12,<z_252_2=fe#1,<z1=fe#11); */
157
- /* asm 2: fe_mul(>z_252_3=out,<z_252_2=t0,<z1=z); */
158
- fe_mul(out,t0,z);
159
-
160
- /* qhasm: return */