rbnacl-libsodium 1.0.15.1 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -6
- data/CHANGES.md +50 -42
- data/Gemfile +1 -1
- data/README.md +3 -1
- data/Rakefile +46 -0
- data/ext/rbnacl/extconf.rb +16 -1
- data/lib/rbnacl/libsodium.rb +16 -8
- data/lib/rbnacl/libsodium/version.rb +1 -1
- data/rbnacl-libsodium.gemspec +3 -0
- data/vendor/libsodium/AUTHORS +20 -5
- data/vendor/libsodium/ChangeLog +25 -0
- data/vendor/libsodium/Makefile.in +3 -1
- data/vendor/libsodium/README.markdown +2 -1
- data/vendor/libsodium/aclocal.m4 +1 -0
- data/vendor/libsodium/autom4te.cache/output.1 +836 -123
- data/vendor/libsodium/autom4te.cache/output.4 +21342 -0
- data/vendor/libsodium/autom4te.cache/requests +801 -554
- data/vendor/libsodium/autom4te.cache/traces.1 +717 -596
- data/vendor/libsodium/autom4te.cache/traces.4 +4355 -0
- data/vendor/libsodium/builds/Makefile.in +3 -1
- data/vendor/libsodium/builds/msvc/resource.h +1 -1
- data/vendor/libsodium/builds/msvc/resource.rc +2 -2
- data/vendor/libsodium/builds/msvc/version.h +2 -2
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +17 -8
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +60 -24
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +17 -8
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +60 -24
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +17 -8
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +60 -24
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +17 -8
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +60 -24
- data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj +17 -8
- data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters +60 -24
- data/vendor/libsodium/configure +834 -121
- data/vendor/libsodium/configure.ac +55 -13
- data/vendor/libsodium/contrib/Findsodium.cmake +22 -3
- data/vendor/libsodium/contrib/Makefile.in +3 -1
- data/vendor/libsodium/dist-build/Makefile.in +3 -1
- data/vendor/libsodium/dist-build/android-build.sh +2 -2
- data/vendor/libsodium/dist-build/emscripten-symbols.def +38 -26
- data/vendor/libsodium/dist-build/emscripten.sh +23 -8
- data/vendor/libsodium/dist-build/msys2-win32.sh +1 -1
- data/vendor/libsodium/dist-build/msys2-win64.sh +1 -1
- data/vendor/libsodium/libsodium.vcxproj +17 -8
- data/vendor/libsodium/libsodium.vcxproj.filters +41 -14
- data/vendor/libsodium/m4/ax_tls.m4 +74 -0
- data/vendor/libsodium/msvc-scripts/Makefile.in +3 -1
- data/vendor/libsodium/msvc-scripts/process.bat +2 -2
- data/vendor/libsodium/packaging/dotnet-core/README.md +5 -5
- data/vendor/libsodium/packaging/dotnet-core/prepare.py +7 -7
- data/vendor/libsodium/packaging/nuget/package.config +1 -1
- data/vendor/libsodium/regen-msvc/libsodium.vcxproj +326 -0
- data/vendor/libsodium/regen-msvc/libsodium.vcxproj.filters +23 -0
- data/vendor/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl +35 -0
- data/vendor/libsodium/regen-msvc/libsodium.vcxproj.tpl +93 -0
- data/vendor/libsodium/regen-msvc/regen-msvc.py +136 -0
- data/vendor/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl +23 -0
- data/vendor/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl +331 -0
- data/vendor/libsodium/src/Makefile.in +3 -1
- data/vendor/libsodium/src/libsodium/Makefile.am +40 -24
- data/vendor/libsodium/src/libsodium/Makefile.in +238 -180
- data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +10 -2
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c +79 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c +2031 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base.h +1344 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base2.h +40 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h +20 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h +220 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/base.h +1344 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/base2.h +40 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h +21 -0
- data/vendor/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h +116 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h +1 -1
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c +2 -1
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c +14 -82
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c +3 -3
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c +3 -3
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +1 -7
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +0 -6
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c +19 -92
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h +72 -4
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c +5 -1
- data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h +1 -1
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c +10 -7
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +108 -231
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.h +1 -1
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c +27 -27
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c +2 -1
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c +6 -3
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +3 -11
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c +86 -0
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +28 -26
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +32 -30
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +14 -115
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +56 -13
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/{ed25519_ref10.h → sign_ed25519_ref10.h} +2 -5
- data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u8.h +1 -1
- data/vendor/libsodium/src/libsodium/include/Makefile.am +2 -0
- data/vendor/libsodium/src/libsodium/include/Makefile.in +13 -9
- data/vendor/libsodium/src/libsodium/include/sodium.h +2 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_ed25519.h +37 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h +41 -0
- data/vendor/libsodium/src/libsodium/include/sodium/private/common.h +18 -0
- data/vendor/libsodium/src/libsodium/include/sodium/private/ed25519_ref10.h +125 -0
- data/vendor/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h +1050 -0
- data/vendor/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h +518 -0
- data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +3 -0
- data/vendor/libsodium/src/libsodium/include/sodium/utils.h +3 -0
- data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +182 -102
- data/vendor/libsodium/src/libsodium/sodium/core.c +30 -2
- data/vendor/libsodium/src/libsodium/sodium/runtime.c +14 -0
- data/vendor/libsodium/src/libsodium/sodium/utils.c +46 -0
- data/vendor/libsodium/test/Makefile.in +3 -1
- data/vendor/libsodium/test/default/Makefile.am +16 -0
- data/vendor/libsodium/test/default/Makefile.in +71 -23
- data/vendor/libsodium/test/default/aead_aes256gcm.c +1 -1
- data/vendor/libsodium/test/default/cmptest.h +4 -0
- data/vendor/libsodium/test/default/core3.c +44 -4
- data/vendor/libsodium/test/default/core3.exp +2 -0
- data/vendor/libsodium/test/default/core4.c +1 -1
- data/vendor/libsodium/test/default/core_ed25519.c +151 -0
- data/vendor/libsodium/test/default/core_ed25519.exp +1 -0
- data/vendor/libsodium/test/default/ed25519_convert.c +9 -1
- data/vendor/libsodium/test/default/index.html.tpl +17 -3
- data/vendor/libsodium/test/default/kdf.c +4 -2
- data/vendor/libsodium/test/default/metamorphic.c +8 -8
- data/vendor/libsodium/test/default/misuse.c +29 -1
- data/vendor/libsodium/test/default/pwhash_argon2i.c +9 -3
- data/vendor/libsodium/test/default/pwhash_argon2i.exp +2 -2
- data/vendor/libsodium/test/default/pwhash_argon2id.c +7 -2
- data/vendor/libsodium/test/default/pwhash_argon2id.exp +2 -2
- data/vendor/libsodium/test/default/scalarmult.c +0 -2
- data/vendor/libsodium/test/default/scalarmult.exp +0 -1
- data/vendor/libsodium/test/default/scalarmult_ed25519.c +90 -0
- data/vendor/libsodium/test/default/scalarmult_ed25519.exp +1 -0
- data/vendor/libsodium/test/default/secretbox_easy2.c +1 -1
- data/vendor/libsodium/test/default/secretstream.c +52 -3
- data/vendor/libsodium/test/default/sign.c +16 -0
- data/vendor/libsodium/test/default/sodium_core.c +1 -0
- data/vendor/libsodium/test/default/sodium_utils.c +2 -1
- data/vendor/libsodium/test/default/xchacha20.c +2 -1
- metadata +63 -12
- data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/base.h +0 -1344
- data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/base2.h +0 -40
- data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c +0 -2797
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c +0 -545
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.h +0 -10
- data/vendor/libsodium/src/libsodium/include/sodium/private/curve25519_ref10.h +0 -132
- data/vendor/libsodium/test/default/index-wasm.html.tpl +0 -118
data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.h
DELETED
@@ -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>
|