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,138 +0,0 @@
1
- #include "ge.h"
2
-
3
- static void slide(signed char *r,const unsigned char *a)
4
- {
5
- int i;
6
- int b;
7
- int k;
8
-
9
- for (i = 0;i < 256;++i)
10
- r[i] = 1 & (a[i >> 3] >> (i & 7));
11
-
12
- for (i = 0;i < 256;++i)
13
- if (r[i]) {
14
- for (b = 1;b <= 6 && i + b < 256;++b) {
15
- if (r[i + b]) {
16
- if (r[i] + (r[i + b] << b) <= 15) {
17
- r[i] += r[i + b] << b; r[i + b] = 0;
18
- } else if (r[i] - (r[i + b] << b) >= -15) {
19
- r[i] -= r[i + b] << b;
20
- for (k = i + b;k < 256;++k) {
21
- if (!r[k]) {
22
- r[k] = 1;
23
- break;
24
- }
25
- r[k] = 0;
26
- }
27
- } else
28
- break;
29
- }
30
- }
31
- }
32
-
33
- }
34
-
35
- static ge_precomp Bi[8] = {
36
- #include "base2.h"
37
- } ;
38
-
39
- /*
40
- r = a * A + b * B
41
- where a = a[0]+256*a[1]+...+256^31 a[31].
42
- and b = b[0]+256*b[1]+...+256^31 b[31].
43
- B is the Ed25519 base point (x,4/5) with x positive.
44
- */
45
-
46
- void ge_double_scalarmult_vartime(ge_p2 *r,const unsigned char *a,const ge_p3 *A,const unsigned char *b)
47
- {
48
- signed char aslide[256];
49
- signed char bslide[256];
50
- ge_cached Ai[8]; /* A,3A,5A,7A,9A,11A,13A,15A */
51
- ge_p1p1 t;
52
- ge_p3 u;
53
- ge_p3 A2;
54
- int i;
55
-
56
- slide(aslide,a);
57
- slide(bslide,b);
58
-
59
- ge_p3_to_cached(&Ai[0],A);
60
- ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t);
61
- ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u);
62
- ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u);
63
- ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u);
64
- ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u);
65
- ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u);
66
- ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u);
67
- ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u);
68
-
69
- ge_p2_0(r);
70
-
71
- for (i = 255;i >= 0;--i) {
72
- if (aslide[i] || bslide[i]) break;
73
- }
74
-
75
- for (;i >= 0;--i) {
76
- ge_p2_dbl(&t,r);
77
-
78
- if (aslide[i] > 0) {
79
- ge_p1p1_to_p3(&u,&t);
80
- ge_add(&t,&u,&Ai[aslide[i]/2]);
81
- } else if (aslide[i] < 0) {
82
- ge_p1p1_to_p3(&u,&t);
83
- ge_sub(&t,&u,&Ai[(-aslide[i])/2]);
84
- }
85
-
86
- if (bslide[i] > 0) {
87
- ge_p1p1_to_p3(&u,&t);
88
- ge_madd(&t,&u,&Bi[bslide[i]/2]);
89
- } else if (bslide[i] < 0) {
90
- ge_p1p1_to_p3(&u,&t);
91
- ge_msub(&t,&u,&Bi[(-bslide[i])/2]);
92
- }
93
-
94
- ge_p1p1_to_p2(r,&t);
95
- }
96
- }
97
-
98
- void ge_scalarmult_vartime(ge_p3 *r,const unsigned char *a,const ge_p3 *A)
99
- {
100
- signed char aslide[256];
101
- ge_cached Ai[8];
102
- ge_p1p1 t;
103
- ge_p3 u;
104
- ge_p3 A2;
105
- int i;
106
-
107
- slide(aslide,a);
108
-
109
- ge_p3_to_cached(&Ai[0],A);
110
- ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t);
111
- ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u);
112
- ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u);
113
- ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u);
114
- ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u);
115
- ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u);
116
- ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u);
117
- ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u);
118
-
119
- ge_p3_0(r);
120
-
121
- for (i = 255;i >= 0;--i) {
122
- if (aslide[i]) break;
123
- }
124
-
125
- for (;i >= 0;--i) {
126
- ge_p3_dbl(&t,r);
127
-
128
- if (aslide[i] > 0) {
129
- ge_p1p1_to_p3(&u,&t);
130
- ge_add(&t,&u,&Ai[aslide[i]/2]);
131
- } else if (aslide[i] < 0) {
132
- ge_p1p1_to_p3(&u,&t);
133
- ge_sub(&t,&u,&Ai[(-aslide[i])/2]);
134
- }
135
-
136
- ge_p1p1_to_p3(r,&t);
137
- }
138
- }
@@ -1,50 +0,0 @@
1
- #include "ge.h"
2
-
3
- static const fe d = {
4
- #include "d.h"
5
- } ;
6
-
7
- static const fe sqrtm1 = {
8
- #include "sqrtm1.h"
9
- } ;
10
-
11
- int ge_frombytes_negate_vartime(ge_p3 *h,const unsigned char *s)
12
- {
13
- fe u;
14
- fe v;
15
- fe v3;
16
- fe vxx;
17
- fe check;
18
-
19
- fe_frombytes(h->Y,s);
20
- fe_1(h->Z);
21
- fe_sq(u,h->Y);
22
- fe_mul(v,u,d);
23
- fe_sub(u,u,h->Z); /* u = y^2-1 */
24
- fe_add(v,v,h->Z); /* v = dy^2+1 */
25
-
26
- fe_sq(v3,v);
27
- fe_mul(v3,v3,v); /* v3 = v^3 */
28
- fe_sq(h->X,v3);
29
- fe_mul(h->X,h->X,v);
30
- fe_mul(h->X,h->X,u); /* x = uv^7 */
31
-
32
- fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */
33
- fe_mul(h->X,h->X,v3);
34
- fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */
35
-
36
- fe_sq(vxx,h->X);
37
- fe_mul(vxx,vxx,v);
38
- fe_sub(check,vxx,u); /* vx^2-u */
39
- if (fe_isnonzero(check)) {
40
- fe_add(check,vxx,u); /* vx^2+u */
41
- if (fe_isnonzero(check)) return -1;
42
- fe_mul(h->X,h->X,sqrtm1);
43
- }
44
-
45
- if (fe_isnegative(h->X) == (s[31] >> 7))
46
- fe_neg(h->X,h->X);
47
-
48
- fe_mul(h->T,h->X,h->Y);
49
- return 0;
50
- }
@@ -1,11 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = p + q
5
- */
6
-
7
- void ge_madd(ge_p1p1 *r,const ge_p3 *p,const ge_precomp *q)
8
- {
9
- fe t0;
10
- #include "ge_madd.h"
11
- }
@@ -1,88 +0,0 @@
1
-
2
- /* qhasm: enter ge_madd */
3
-
4
- /* qhasm: fe X1 */
5
-
6
- /* qhasm: fe Y1 */
7
-
8
- /* qhasm: fe Z1 */
9
-
10
- /* qhasm: fe T1 */
11
-
12
- /* qhasm: fe ypx2 */
13
-
14
- /* qhasm: fe ymx2 */
15
-
16
- /* qhasm: fe xy2d2 */
17
-
18
- /* qhasm: fe X3 */
19
-
20
- /* qhasm: fe Y3 */
21
-
22
- /* qhasm: fe Z3 */
23
-
24
- /* qhasm: fe T3 */
25
-
26
- /* qhasm: fe YpX1 */
27
-
28
- /* qhasm: fe YmX1 */
29
-
30
- /* qhasm: fe A */
31
-
32
- /* qhasm: fe B */
33
-
34
- /* qhasm: fe C */
35
-
36
- /* qhasm: fe D */
37
-
38
- /* qhasm: YpX1 = Y1+X1 */
39
- /* asm 1: fe_add(>YpX1=fe#1,<Y1=fe#12,<X1=fe#11); */
40
- /* asm 2: fe_add(>YpX1=r->X,<Y1=p->Y,<X1=p->X); */
41
- fe_add(r->X,p->Y,p->X);
42
-
43
- /* qhasm: YmX1 = Y1-X1 */
44
- /* asm 1: fe_sub(>YmX1=fe#2,<Y1=fe#12,<X1=fe#11); */
45
- /* asm 2: fe_sub(>YmX1=r->Y,<Y1=p->Y,<X1=p->X); */
46
- fe_sub(r->Y,p->Y,p->X);
47
-
48
- /* qhasm: A = YpX1*ypx2 */
49
- /* asm 1: fe_mul(>A=fe#3,<YpX1=fe#1,<ypx2=fe#15); */
50
- /* asm 2: fe_mul(>A=r->Z,<YpX1=r->X,<ypx2=q->yplusx); */
51
- fe_mul(r->Z,r->X,q->yplusx);
52
-
53
- /* qhasm: B = YmX1*ymx2 */
54
- /* asm 1: fe_mul(>B=fe#2,<YmX1=fe#2,<ymx2=fe#16); */
55
- /* asm 2: fe_mul(>B=r->Y,<YmX1=r->Y,<ymx2=q->yminusx); */
56
- fe_mul(r->Y,r->Y,q->yminusx);
57
-
58
- /* qhasm: C = xy2d2*T1 */
59
- /* asm 1: fe_mul(>C=fe#4,<xy2d2=fe#17,<T1=fe#14); */
60
- /* asm 2: fe_mul(>C=r->T,<xy2d2=q->xy2d,<T1=p->T); */
61
- fe_mul(r->T,q->xy2d,p->T);
62
-
63
- /* qhasm: D = 2*Z1 */
64
- /* asm 1: fe_add(>D=fe#5,<Z1=fe#13,<Z1=fe#13); */
65
- /* asm 2: fe_add(>D=t0,<Z1=p->Z,<Z1=p->Z); */
66
- fe_add(t0,p->Z,p->Z);
67
-
68
- /* qhasm: X3 = A-B */
69
- /* asm 1: fe_sub(>X3=fe#1,<A=fe#3,<B=fe#2); */
70
- /* asm 2: fe_sub(>X3=r->X,<A=r->Z,<B=r->Y); */
71
- fe_sub(r->X,r->Z,r->Y);
72
-
73
- /* qhasm: Y3 = A+B */
74
- /* asm 1: fe_add(>Y3=fe#2,<A=fe#3,<B=fe#2); */
75
- /* asm 2: fe_add(>Y3=r->Y,<A=r->Z,<B=r->Y); */
76
- fe_add(r->Y,r->Z,r->Y);
77
-
78
- /* qhasm: Z3 = D+C */
79
- /* asm 1: fe_add(>Z3=fe#3,<D=fe#5,<C=fe#4); */
80
- /* asm 2: fe_add(>Z3=r->Z,<D=t0,<C=r->T); */
81
- fe_add(r->Z,t0,r->T);
82
-
83
- /* qhasm: T3 = D-C */
84
- /* asm 1: fe_sub(>T3=fe#4,<D=fe#5,<C=fe#4); */
85
- /* asm 2: fe_sub(>T3=r->T,<D=t0,<C=r->T); */
86
- fe_sub(r->T,t0,r->T);
87
-
88
- /* qhasm: return */
@@ -1,11 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = p - q
5
- */
6
-
7
- void ge_msub(ge_p1p1 *r,const ge_p3 *p,const ge_precomp *q)
8
- {
9
- fe t0;
10
- #include "ge_msub.h"
11
- }
@@ -1,88 +0,0 @@
1
-
2
- /* qhasm: enter ge_msub */
3
-
4
- /* qhasm: fe X1 */
5
-
6
- /* qhasm: fe Y1 */
7
-
8
- /* qhasm: fe Z1 */
9
-
10
- /* qhasm: fe T1 */
11
-
12
- /* qhasm: fe ypx2 */
13
-
14
- /* qhasm: fe ymx2 */
15
-
16
- /* qhasm: fe xy2d2 */
17
-
18
- /* qhasm: fe X3 */
19
-
20
- /* qhasm: fe Y3 */
21
-
22
- /* qhasm: fe Z3 */
23
-
24
- /* qhasm: fe T3 */
25
-
26
- /* qhasm: fe YpX1 */
27
-
28
- /* qhasm: fe YmX1 */
29
-
30
- /* qhasm: fe A */
31
-
32
- /* qhasm: fe B */
33
-
34
- /* qhasm: fe C */
35
-
36
- /* qhasm: fe D */
37
-
38
- /* qhasm: YpX1 = Y1+X1 */
39
- /* asm 1: fe_add(>YpX1=fe#1,<Y1=fe#12,<X1=fe#11); */
40
- /* asm 2: fe_add(>YpX1=r->X,<Y1=p->Y,<X1=p->X); */
41
- fe_add(r->X,p->Y,p->X);
42
-
43
- /* qhasm: YmX1 = Y1-X1 */
44
- /* asm 1: fe_sub(>YmX1=fe#2,<Y1=fe#12,<X1=fe#11); */
45
- /* asm 2: fe_sub(>YmX1=r->Y,<Y1=p->Y,<X1=p->X); */
46
- fe_sub(r->Y,p->Y,p->X);
47
-
48
- /* qhasm: A = YpX1*ymx2 */
49
- /* asm 1: fe_mul(>A=fe#3,<YpX1=fe#1,<ymx2=fe#16); */
50
- /* asm 2: fe_mul(>A=r->Z,<YpX1=r->X,<ymx2=q->yminusx); */
51
- fe_mul(r->Z,r->X,q->yminusx);
52
-
53
- /* qhasm: B = YmX1*ypx2 */
54
- /* asm 1: fe_mul(>B=fe#2,<YmX1=fe#2,<ypx2=fe#15); */
55
- /* asm 2: fe_mul(>B=r->Y,<YmX1=r->Y,<ypx2=q->yplusx); */
56
- fe_mul(r->Y,r->Y,q->yplusx);
57
-
58
- /* qhasm: C = xy2d2*T1 */
59
- /* asm 1: fe_mul(>C=fe#4,<xy2d2=fe#17,<T1=fe#14); */
60
- /* asm 2: fe_mul(>C=r->T,<xy2d2=q->xy2d,<T1=p->T); */
61
- fe_mul(r->T,q->xy2d,p->T);
62
-
63
- /* qhasm: D = 2*Z1 */
64
- /* asm 1: fe_add(>D=fe#5,<Z1=fe#13,<Z1=fe#13); */
65
- /* asm 2: fe_add(>D=t0,<Z1=p->Z,<Z1=p->Z); */
66
- fe_add(t0,p->Z,p->Z);
67
-
68
- /* qhasm: X3 = A-B */
69
- /* asm 1: fe_sub(>X3=fe#1,<A=fe#3,<B=fe#2); */
70
- /* asm 2: fe_sub(>X3=r->X,<A=r->Z,<B=r->Y); */
71
- fe_sub(r->X,r->Z,r->Y);
72
-
73
- /* qhasm: Y3 = A+B */
74
- /* asm 1: fe_add(>Y3=fe#2,<A=fe#3,<B=fe#2); */
75
- /* asm 2: fe_add(>Y3=r->Y,<A=r->Z,<B=r->Y); */
76
- fe_add(r->Y,r->Z,r->Y);
77
-
78
- /* qhasm: Z3 = D-C */
79
- /* asm 1: fe_sub(>Z3=fe#3,<D=fe#5,<C=fe#4); */
80
- /* asm 2: fe_sub(>Z3=r->Z,<D=t0,<C=r->T); */
81
- fe_sub(r->Z,t0,r->T);
82
-
83
- /* qhasm: T3 = D+C */
84
- /* asm 1: fe_add(>T3=fe#4,<D=fe#5,<C=fe#4); */
85
- /* asm 2: fe_add(>T3=r->T,<D=t0,<C=r->T); */
86
- fe_add(r->T,t0,r->T);
87
-
88
- /* qhasm: return */
@@ -1,12 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = p
5
- */
6
-
7
- extern void ge_p1p1_to_p2(ge_p2 *r,const ge_p1p1 *p)
8
- {
9
- fe_mul(r->X,p->X,p->T);
10
- fe_mul(r->Y,p->Y,p->Z);
11
- fe_mul(r->Z,p->Z,p->T);
12
- }
@@ -1,13 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = p
5
- */
6
-
7
- extern void ge_p1p1_to_p3(ge_p3 *r,const ge_p1p1 *p)
8
- {
9
- fe_mul(r->X,p->X,p->T);
10
- fe_mul(r->Y,p->Y,p->Z);
11
- fe_mul(r->Z,p->Z,p->T);
12
- fe_mul(r->T,p->X,p->Y);
13
- }
@@ -1,8 +0,0 @@
1
- #include "ge.h"
2
-
3
- void ge_p2_0(ge_p2 *h)
4
- {
5
- fe_0(h->X);
6
- fe_1(h->Y);
7
- fe_1(h->Z);
8
- }
@@ -1,11 +0,0 @@
1
- #include "ge.h"
2
-
3
- /*
4
- r = 2 * p
5
- */
6
-
7
- void ge_p2_dbl(ge_p1p1 *r,const ge_p2 *p)
8
- {
9
- fe t0;
10
- #include "ge_p2_dbl.h"
11
- }
@@ -1,73 +0,0 @@
1
-
2
- /* qhasm: enter ge_p2_dbl */
3
-
4
- /* qhasm: fe X1 */
5
-
6
- /* qhasm: fe Y1 */
7
-
8
- /* qhasm: fe Z1 */
9
-
10
- /* qhasm: fe A */
11
-
12
- /* qhasm: fe AA */
13
-
14
- /* qhasm: fe XX */
15
-
16
- /* qhasm: fe YY */
17
-
18
- /* qhasm: fe B */
19
-
20
- /* qhasm: fe X3 */
21
-
22
- /* qhasm: fe Y3 */
23
-
24
- /* qhasm: fe Z3 */
25
-
26
- /* qhasm: fe T3 */
27
-
28
- /* qhasm: XX=X1^2 */
29
- /* asm 1: fe_sq(>XX=fe#1,<X1=fe#11); */
30
- /* asm 2: fe_sq(>XX=r->X,<X1=p->X); */
31
- fe_sq(r->X,p->X);
32
-
33
- /* qhasm: YY=Y1^2 */
34
- /* asm 1: fe_sq(>YY=fe#3,<Y1=fe#12); */
35
- /* asm 2: fe_sq(>YY=r->Z,<Y1=p->Y); */
36
- fe_sq(r->Z,p->Y);
37
-
38
- /* qhasm: B=2*Z1^2 */
39
- /* asm 1: fe_sq2(>B=fe#4,<Z1=fe#13); */
40
- /* asm 2: fe_sq2(>B=r->T,<Z1=p->Z); */
41
- fe_sq2(r->T,p->Z);
42
-
43
- /* qhasm: A=X1+Y1 */
44
- /* asm 1: fe_add(>A=fe#2,<X1=fe#11,<Y1=fe#12); */
45
- /* asm 2: fe_add(>A=r->Y,<X1=p->X,<Y1=p->Y); */
46
- fe_add(r->Y,p->X,p->Y);
47
-
48
- /* qhasm: AA=A^2 */
49
- /* asm 1: fe_sq(>AA=fe#5,<A=fe#2); */
50
- /* asm 2: fe_sq(>AA=t0,<A=r->Y); */
51
- fe_sq(t0,r->Y);
52
-
53
- /* qhasm: Y3=YY+XX */
54
- /* asm 1: fe_add(>Y3=fe#2,<YY=fe#3,<XX=fe#1); */
55
- /* asm 2: fe_add(>Y3=r->Y,<YY=r->Z,<XX=r->X); */
56
- fe_add(r->Y,r->Z,r->X);
57
-
58
- /* qhasm: Z3=YY-XX */
59
- /* asm 1: fe_sub(>Z3=fe#3,<YY=fe#3,<XX=fe#1); */
60
- /* asm 2: fe_sub(>Z3=r->Z,<YY=r->Z,<XX=r->X); */
61
- fe_sub(r->Z,r->Z,r->X);
62
-
63
- /* qhasm: X3=AA-Y3 */
64
- /* asm 1: fe_sub(>X3=fe#1,<AA=fe#5,<Y3=fe#2); */
65
- /* asm 2: fe_sub(>X3=r->X,<AA=t0,<Y3=r->Y); */
66
- fe_sub(r->X,t0,r->Y);
67
-
68
- /* qhasm: T3=B-Z3 */
69
- /* asm 1: fe_sub(>T3=fe#4,<B=fe#4,<Z3=fe#3); */
70
- /* asm 2: fe_sub(>T3=r->T,<B=r->T,<Z3=r->Z); */
71
- fe_sub(r->T,r->T,r->Z);
72
-
73
- /* qhasm: return */