rbnacl-libsodium 1.0.15.1 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -6
  3. data/CHANGES.md +50 -42
  4. data/Gemfile +1 -1
  5. data/README.md +3 -1
  6. data/Rakefile +46 -0
  7. data/ext/rbnacl/extconf.rb +16 -1
  8. data/lib/rbnacl/libsodium.rb +16 -8
  9. data/lib/rbnacl/libsodium/version.rb +1 -1
  10. data/rbnacl-libsodium.gemspec +3 -0
  11. data/vendor/libsodium/AUTHORS +20 -5
  12. data/vendor/libsodium/ChangeLog +25 -0
  13. data/vendor/libsodium/Makefile.in +3 -1
  14. data/vendor/libsodium/README.markdown +2 -1
  15. data/vendor/libsodium/aclocal.m4 +1 -0
  16. data/vendor/libsodium/autom4te.cache/output.1 +836 -123
  17. data/vendor/libsodium/autom4te.cache/output.4 +21342 -0
  18. data/vendor/libsodium/autom4te.cache/requests +801 -554
  19. data/vendor/libsodium/autom4te.cache/traces.1 +717 -596
  20. data/vendor/libsodium/autom4te.cache/traces.4 +4355 -0
  21. data/vendor/libsodium/builds/Makefile.in +3 -1
  22. data/vendor/libsodium/builds/msvc/resource.h +1 -1
  23. data/vendor/libsodium/builds/msvc/resource.rc +2 -2
  24. data/vendor/libsodium/builds/msvc/version.h +2 -2
  25. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +17 -8
  26. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +60 -24
  27. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +17 -8
  28. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +60 -24
  29. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +17 -8
  30. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +60 -24
  31. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +17 -8
  32. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +60 -24
  33. data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj +17 -8
  34. data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters +60 -24
  35. data/vendor/libsodium/configure +834 -121
  36. data/vendor/libsodium/configure.ac +55 -13
  37. data/vendor/libsodium/contrib/Findsodium.cmake +22 -3
  38. data/vendor/libsodium/contrib/Makefile.in +3 -1
  39. data/vendor/libsodium/dist-build/Makefile.in +3 -1
  40. data/vendor/libsodium/dist-build/android-build.sh +2 -2
  41. data/vendor/libsodium/dist-build/emscripten-symbols.def +38 -26
  42. data/vendor/libsodium/dist-build/emscripten.sh +23 -8
  43. data/vendor/libsodium/dist-build/msys2-win32.sh +1 -1
  44. data/vendor/libsodium/dist-build/msys2-win64.sh +1 -1
  45. data/vendor/libsodium/libsodium.vcxproj +17 -8
  46. data/vendor/libsodium/libsodium.vcxproj.filters +41 -14
  47. data/vendor/libsodium/m4/ax_tls.m4 +74 -0
  48. data/vendor/libsodium/msvc-scripts/Makefile.in +3 -1
  49. data/vendor/libsodium/msvc-scripts/process.bat +2 -2
  50. data/vendor/libsodium/packaging/dotnet-core/README.md +5 -5
  51. data/vendor/libsodium/packaging/dotnet-core/prepare.py +7 -7
  52. data/vendor/libsodium/packaging/nuget/package.config +1 -1
  53. data/vendor/libsodium/regen-msvc/libsodium.vcxproj +326 -0
  54. data/vendor/libsodium/regen-msvc/libsodium.vcxproj.filters +23 -0
  55. data/vendor/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl +35 -0
  56. data/vendor/libsodium/regen-msvc/libsodium.vcxproj.tpl +93 -0
  57. data/vendor/libsodium/regen-msvc/regen-msvc.py +136 -0
  58. data/vendor/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl +23 -0
  59. data/vendor/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl +331 -0
  60. data/vendor/libsodium/src/Makefile.in +3 -1
  61. data/vendor/libsodium/src/libsodium/Makefile.am +40 -24
  62. data/vendor/libsodium/src/libsodium/Makefile.in +238 -180
  63. data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +10 -2
  64. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c +79 -0
  65. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c +2031 -0
  66. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base.h +1344 -0
  67. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base2.h +40 -0
  68. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h +20 -0
  69. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h +220 -0
  70. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/base.h +1344 -0
  71. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/base2.h +40 -0
  72. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h +21 -0
  73. data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h +116 -0
  74. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h +1 -1
  75. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c +2 -1
  76. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c +14 -82
  77. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c +1 -0
  78. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c +3 -3
  79. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c +3 -3
  80. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +1 -7
  81. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +1 -0
  82. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +0 -6
  83. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c +19 -92
  84. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h +72 -4
  85. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c +5 -1
  86. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h +1 -1
  87. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c +10 -7
  88. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +108 -231
  89. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.h +1 -1
  90. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c +27 -27
  91. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c +2 -1
  92. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c +6 -3
  93. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +3 -11
  94. data/vendor/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c +86 -0
  95. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +28 -26
  96. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +32 -30
  97. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +14 -115
  98. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +56 -13
  99. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/{ed25519_ref10.h → sign_ed25519_ref10.h} +2 -5
  100. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c +1 -1
  101. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c +1 -0
  102. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c +1 -0
  103. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u8.h +1 -1
  104. data/vendor/libsodium/src/libsodium/include/Makefile.am +2 -0
  105. data/vendor/libsodium/src/libsodium/include/Makefile.in +13 -9
  106. data/vendor/libsodium/src/libsodium/include/sodium.h +2 -0
  107. data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_ed25519.h +37 -0
  108. data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h +8 -0
  109. data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h +8 -0
  110. data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h +41 -0
  111. data/vendor/libsodium/src/libsodium/include/sodium/private/common.h +18 -0
  112. data/vendor/libsodium/src/libsodium/include/sodium/private/ed25519_ref10.h +125 -0
  113. data/vendor/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h +1050 -0
  114. data/vendor/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h +518 -0
  115. data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +3 -0
  116. data/vendor/libsodium/src/libsodium/include/sodium/utils.h +3 -0
  117. data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +182 -102
  118. data/vendor/libsodium/src/libsodium/sodium/core.c +30 -2
  119. data/vendor/libsodium/src/libsodium/sodium/runtime.c +14 -0
  120. data/vendor/libsodium/src/libsodium/sodium/utils.c +46 -0
  121. data/vendor/libsodium/test/Makefile.in +3 -1
  122. data/vendor/libsodium/test/default/Makefile.am +16 -0
  123. data/vendor/libsodium/test/default/Makefile.in +71 -23
  124. data/vendor/libsodium/test/default/aead_aes256gcm.c +1 -1
  125. data/vendor/libsodium/test/default/cmptest.h +4 -0
  126. data/vendor/libsodium/test/default/core3.c +44 -4
  127. data/vendor/libsodium/test/default/core3.exp +2 -0
  128. data/vendor/libsodium/test/default/core4.c +1 -1
  129. data/vendor/libsodium/test/default/core_ed25519.c +151 -0
  130. data/vendor/libsodium/test/default/core_ed25519.exp +1 -0
  131. data/vendor/libsodium/test/default/ed25519_convert.c +9 -1
  132. data/vendor/libsodium/test/default/index.html.tpl +17 -3
  133. data/vendor/libsodium/test/default/kdf.c +4 -2
  134. data/vendor/libsodium/test/default/metamorphic.c +8 -8
  135. data/vendor/libsodium/test/default/misuse.c +29 -1
  136. data/vendor/libsodium/test/default/pwhash_argon2i.c +9 -3
  137. data/vendor/libsodium/test/default/pwhash_argon2i.exp +2 -2
  138. data/vendor/libsodium/test/default/pwhash_argon2id.c +7 -2
  139. data/vendor/libsodium/test/default/pwhash_argon2id.exp +2 -2
  140. data/vendor/libsodium/test/default/scalarmult.c +0 -2
  141. data/vendor/libsodium/test/default/scalarmult.exp +0 -1
  142. data/vendor/libsodium/test/default/scalarmult_ed25519.c +90 -0
  143. data/vendor/libsodium/test/default/scalarmult_ed25519.exp +1 -0
  144. data/vendor/libsodium/test/default/secretbox_easy2.c +1 -1
  145. data/vendor/libsodium/test/default/secretstream.c +52 -3
  146. data/vendor/libsodium/test/default/sign.c +16 -0
  147. data/vendor/libsodium/test/default/sodium_core.c +1 -0
  148. data/vendor/libsodium/test/default/sodium_utils.c +2 -1
  149. data/vendor/libsodium/test/default/xchacha20.c +2 -1
  150. metadata +63 -12
  151. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/base.h +0 -1344
  152. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/base2.h +0 -40
  153. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c +0 -2797
  154. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c +0 -545
  155. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.h +0 -10
  156. data/vendor/libsodium/src/libsodium/include/sodium/private/curve25519_ref10.h +0 -132
  157. data/vendor/libsodium/test/default/index-wasm.html.tpl +0 -118
@@ -1,10 +0,0 @@
1
- #ifndef curve25519_donna_c64_H
2
- #define curve25519_donna_c64_H
3
-
4
- #include "crypto_scalarmult_curve25519.h"
5
- #include "../scalarmult_curve25519.h"
6
-
7
- extern struct crypto_scalarmult_curve25519_implementation
8
- crypto_scalarmult_curve25519_donna_c64_implementation;
9
-
10
- #endif
@@ -1,132 +0,0 @@
1
- #ifndef curve25519_ref10_H
2
- #define curve25519_ref10_H
3
-
4
- #include <stddef.h>
5
- #include <stdint.h>
6
-
7
- #define fe crypto_core_curve25519_ref10_fe
8
- typedef int32_t fe[10];
9
-
10
- /*
11
- fe means field element.
12
- Here the field is \Z/(2^255-19).
13
- An element t, entries t[0]...t[9], represents the integer
14
- t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
15
- Bounds on each t[i] vary depending on context.
16
- */
17
-
18
- #define fe_frombytes crypto_core_curve25519_ref10_fe_frombytes
19
- #define fe_tobytes crypto_core_curve25519_ref10_fe_tobytes
20
- #define fe_copy crypto_core_curve25519_ref10_fe_copy
21
- #define fe_isnonzero crypto_core_curve25519_ref10_fe_isnonzero
22
- #define fe_0 crypto_core_curve25519_ref10_fe_0
23
- #define fe_1 crypto_core_curve25519_ref10_fe_1
24
- #define fe_add crypto_core_curve25519_ref10_fe_add
25
- #define fe_sub crypto_core_curve25519_ref10_fe_sub
26
- #define fe_mul crypto_core_curve25519_ref10_fe_mul
27
- #define fe_sq crypto_core_curve25519_ref10_fe_sq
28
- #define fe_invert crypto_core_curve25519_ref10_fe_invert
29
-
30
- extern void fe_frombytes(fe,const unsigned char *);
31
- extern void fe_tobytes(unsigned char *,const fe);
32
-
33
- extern void fe_copy(fe,const fe);
34
- extern int fe_isnonzero(const fe);
35
- extern void fe_0(fe);
36
- extern void fe_1(fe);
37
- extern void fe_add(fe,const fe,const fe);
38
- extern void fe_sub(fe,const fe,const fe);
39
- extern void fe_mul(fe,const fe,const fe);
40
- extern void fe_sq(fe,const fe);
41
- extern void fe_invert(fe,const fe);
42
-
43
- /*
44
- ge means group element.
45
- *
46
- Here the group is the set of pairs (x,y) of field elements (see fe.h)
47
- satisfying -x^2 + y^2 = 1 + d x^2y^2
48
- where d = -121665/121666.
49
- *
50
- Representations:
51
- ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z
52
- ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT
53
- ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T
54
- ge_precomp (Duif): (y+x,y-x,2dxy)
55
- */
56
-
57
- #define ge_p2 crypto_core_curve25519_ref10_ge_p2
58
- typedef struct {
59
- fe X;
60
- fe Y;
61
- fe Z;
62
- } ge_p2;
63
-
64
- #define ge_p3 crypto_core_curve25519_ref10_ge_p3
65
- typedef struct {
66
- fe X;
67
- fe Y;
68
- fe Z;
69
- fe T;
70
- } ge_p3;
71
-
72
- #define ge_p1p1 crypto_core_curve25519_ref10_ge_p1p1
73
- typedef struct {
74
- fe X;
75
- fe Y;
76
- fe Z;
77
- fe T;
78
- } ge_p1p1;
79
-
80
- #define ge_precomp crypto_core_curve25519_ref10_ge_precomp
81
- typedef struct {
82
- fe yplusx;
83
- fe yminusx;
84
- fe xy2d;
85
- } ge_precomp;
86
-
87
- #define ge_cached crypto_core_curve25519_ref10_ge_cached
88
- typedef struct {
89
- fe YplusX;
90
- fe YminusX;
91
- fe Z;
92
- fe T2d;
93
- } ge_cached;
94
-
95
- #define ge_frombytes_negate_vartime crypto_core_curve25519_ref10_ge_frombytes_negate_vartime
96
- #define ge_tobytes crypto_core_curve25519_ref10_ge_tobytes
97
- #define ge_p3_tobytes crypto_core_curve25519_ref10_ge_p3_tobytes
98
-
99
- #define ge_p3_to_cached crypto_core_curve25519_ref10_ge_p3_to_cached
100
- #define ge_p1p1_to_p2 crypto_core_curve25519_ref10_ge_p1p1_to_p2
101
-
102
- #define ge_add crypto_core_curve25519_ref10_ge_add
103
- #define ge_scalarmult_base crypto_core_curve25519_ref10_ge_scalarmult_base
104
- #define ge_double_scalarmult_vartime crypto_core_curve25519_ref10_ge_double_scalarmult_vartime
105
- #define ge_scalarmult_vartime crypto_core_curve25519_ref10_ge_scalarmult_vartime
106
- #define ge_mul_l crypto_core_curve25519_ref10_ge_mul_l
107
-
108
- extern void ge_tobytes(unsigned char *,const ge_p2 *);
109
- extern void ge_p3_tobytes(unsigned char *,const ge_p3 *);
110
- extern int ge_frombytes_negate_vartime(ge_p3 *,const unsigned char *);
111
-
112
- extern void ge_p3_to_cached(ge_cached *,const ge_p3 *);
113
- extern void ge_p1p1_to_p2(ge_p2 *,const ge_p1p1 *);
114
-
115
- extern void ge_add(ge_p1p1 *,const ge_p3 *,const ge_cached *);
116
- extern void ge_scalarmult_base(ge_p3 *,const unsigned char *);
117
- extern void ge_double_scalarmult_vartime(ge_p2 *,const unsigned char *,const ge_p3 *,const unsigned char *);
118
- extern void ge_scalarmult_vartime(ge_p3 *,const unsigned char *,const ge_p3 *);
119
- extern void ge_mul_l(ge_p3 *r, const ge_p3 *A);
120
-
121
- /*
122
- The set of scalars is \Z/l
123
- where l = 2^252 + 27742317777372353535851937790883648493.
124
- */
125
-
126
- #define sc_reduce crypto_core_curve25519_ref10_sc_reduce
127
- #define sc_muladd crypto_core_curve25519_ref10_sc_muladd
128
-
129
- extern void sc_reduce(unsigned char *);
130
- extern void sc_muladd(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *);
131
-
132
- #endif
@@ -1,118 +0,0 @@
1
- <!doctype html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="utf-8" />
6
- <meta name="google" content="notranslate" />
7
- <style>
8
- body {
9
- background: white;
10
- color: black;
11
- }
12
- .test p {
13
- margin: 1px;
14
- }
15
- .test {
16
- font-family: monospace;
17
- white-space: pre;
18
- }
19
- .err {
20
- background: red;
21
- color: white;
22
- }
23
- .passed {
24
- background: green;
25
- color: white;
26
- }
27
- </style>
28
- </head>
29
- <body>
30
- <h1></h1>
31
- <section class="test" id="test-res"></section>
32
- <script>
33
- window.testMain = function() {
34
- function runTest(tname) {
35
- var xhr, expected, hn, idx = 0, passed = true;
36
-
37
- function outputReceived(e) {
38
- var found = e.data;
39
- var p = document.createElement('p');
40
- if (found !== expected[idx++]) {
41
- p.className = 'err';
42
- passed = false;
43
- }
44
- p.appendChild(document.createTextNode(found));
45
- document.getElementById('test-res').appendChild(p);
46
- if (idx >= expected.length) {
47
- if (passed) {
48
- hn.appendChild(document.createTextNode(' - PASSED'));
49
- hn.className = 'passed';
50
- } else {
51
- hn.appendChild(document.createTextNode(' - FAILED'));
52
- hn.className = 'err';
53
- }
54
- if (window.ontestresult) window.ontestresult(passed); // used for the full suite
55
- }
56
- }
57
-
58
- hn = document.getElementsByTagName('h1')[0];
59
- hn.appendChild(document.createTextNode('Test: ' + tname));
60
-
61
- try {
62
- xhr = new ActiveXObject('Microsoft.XMLHTTP');
63
- } catch (e) {
64
- xhr = new XMLHttpRequest();
65
- }
66
- xhr.open('GET', tname + '.exp');
67
- xhr.onreadystatechange = function() {
68
- if (xhr.readyState != 4 || (xhr.status != 200 && xhr.status != 302 && xhr.status != 0)) return;
69
- expected = xhr.responseText.split('\n');
70
- if (expected.length > 0 && expected[expected.length - 1] === '') expected.pop();
71
- expected.push('--- SUCCESS ---');
72
- window.addEventListener('test-output', outputReceived, false);
73
- var wasmXhr = null;
74
- try {
75
- wasmXhr = new ActiveXObject('Microsoft.XMLHTTP');
76
- } catch (e) {
77
- wasmXhr = new XMLHttpRequest();
78
- }
79
- wasmXhr.open('GET', tname + '.wasm');
80
- wasmXhr.responseType = 'arraybuffer';
81
- wasmXhr.onreadystatechange = function() {
82
- if (wasmXhr.readyState != 4 || (wasmXhr.status != 200 && wasmXhr.status != 302 && wasmXhr.status != 0)) return;
83
- window.Module = window.Module || {};
84
- Module.wasmBinary = wasmXhr.response;
85
- var s = document.getElementsByTagName('script')[0];
86
- var st = document.createElement('script');
87
- st.src = tname + '.js';
88
- s.parentNode.insertBefore(st, s);
89
- }
90
- wasmXhr.send(null);
91
- }
92
- xhr.send(null);
93
- }
94
- runTest('{{tname}}');
95
- };
96
- </script>
97
- <script>
98
- (function() {
99
- function inIframe() {
100
- try {
101
- // foolproof, but modern
102
- // also might be blocked to prevent XSS
103
- return !!window.frameElement;
104
- } catch (e) {
105
- try {
106
- // might be blocked by same origin policy
107
- return window.self !== window.top;
108
- } catch (e) {
109
- return true;
110
- }
111
- }
112
- }
113
-
114
- if (!inIframe()) window.testMain(); // run the test automatically if the user loaded the page directly
115
- })();
116
- </script>
117
- </body>
118
- </html>