git.iko.soy/rowtype-yoga/purescript-yoga-subtlecrypto
on master help sign in
spago support
commit0e88b376d61126d2fd6c7f911e5511eae37b317d authorAthan Clark <athan.clark@gmail.com> dateWed 29 Apr 2020, 15:38 (6 years ago) parent152afd9
8 files changed+539−494
.gitignore+1 LICENSE+1−1 bower.json+1−1 buildTests.sh+2−3 packages.dhall+128 spago.dhall+18 test.browser.js+384−485 test/Main.purs+4−4
.gitignore+1
@@ -7,3 +7,4 @@
77/.psc*
88/.purs*
99/.psa*
10+/.spago/
LICENSE+1−1
@@ -1,4 +1,4 @@
1−Copyright 2019 Athan Clark
1+Copyright 2019, 2020 Athan Clark
22
33Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
44
bower.json+1−1
@@ -9,7 +9,7 @@
99 "license": "BSD-3-Clause",
1010 "repository": {
1111 "type": "git",
12− "url": "git://github.com/athanclark/purescript-subtlecrypto.git"
12+ "url": "https://github.com/athanclark/purescript-subtlecrypto.git"
1313 },
1414 "dependencies": {
1515 "purescript-prelude": "^4.1.0",
buildTests.sh+2−3
@@ -1,7 +1,6 @@
11#!/bin/bash
22
3−pulp build && \
4− pulp test
3+spago build
54echo "Bundling..."
6−purs bundle output/**/*.js -m Test.Main --main Test.Main > test.browser.js
5+spago bundle-app -m Test.Main -t test.browser.js
76echo "Bundled."
packages.dhallnew file+128
@@ -0,0 +1,128 @@
1+{-
2+Welcome to your new Dhall package-set!
3+
4+Below are instructions for how to edit this file for most use
5+cases, so that you don't need to know Dhall to use it.
6+
7+## Warning: Don't Move This Top-Level Comment!
8+
9+Due to how `dhall format` currently works, this comment's
10+instructions cannot appear near corresponding sections below
11+because `dhall format` will delete the comment. However,
12+it will not delete a top-level comment like this one.
13+
14+## Use Cases
15+
16+Most will want to do one or both of these options:
17+1. Override/Patch a package's dependency
18+2. Add a package not already in the default package set
19+
20+This file will continue to work whether you use one or both options.
21+Instructions for each option are explained below.
22+
23+### Overriding/Patching a package
24+
25+Purpose:
26+- Change a package's dependency to a newer/older release than the
27+ default package set's release
28+- Use your own modified version of some dependency that may
29+ include new API, changed API, removed API by
30+ using your custom git repo of the library rather than
31+ the package set's repo
32+
33+Syntax:
34+Replace the overrides' "{=}" (an empty record) with the following idea
35+The "//" or "⫽" means "merge these two records and
36+ when they have the same value, use the one on the right:"
37+-------------------------------
38+let overrides =
39+ { packageName =
40+ upstream.packageName // { updateEntity1 = "new value", updateEntity2 = "new value" }
41+ , packageName =
42+ upstream.packageName // { version = "v4.0.0" }
43+ , packageName =
44+ upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" }
45+ }
46+-------------------------------
47+
48+Example:
49+-------------------------------
50+let overrides =
51+ { halogen =
52+ upstream.halogen // { version = "master" }
53+ , halogen-vdom =
54+ upstream.halogen-vdom // { version = "v4.0.0" }
55+ }
56+-------------------------------
57+
58+### Additions
59+
60+Purpose:
61+- Add packages that aren't already included in the default package set
62+
63+Syntax:
64+Replace the additions' "{=}" (an empty record) with the following idea:
65+-------------------------------
66+let additions =
67+ { package-name =
68+ { dependencies =
69+ [ "dependency1"
70+ , "dependency2"
71+ ]
72+ , repo =
73+ "https://example.com/path/to/git/repo.git"
74+ , version =
75+ "tag ('v4.0.0') or branch ('master')"
76+ }
77+ , package-name =
78+ { dependencies =
79+ [ "dependency1"
80+ , "dependency2"
81+ ]
82+ , repo =
83+ "https://example.com/path/to/git/repo.git"
84+ , version =
85+ "tag ('v4.0.0') or branch ('master')"
86+ }
87+ , etc.
88+ }
89+-------------------------------
90+
91+Example:
92+-------------------------------
93+let additions =
94+ { benchotron =
95+ { dependencies =
96+ [ "arrays"
97+ , "exists"
98+ , "profunctor"
99+ , "strings"
100+ , "quickcheck"
101+ , "lcg"
102+ , "transformers"
103+ , "foldable-traversable"
104+ , "exceptions"
105+ , "node-fs"
106+ , "node-buffer"
107+ , "node-readline"
108+ , "datetime"
109+ , "now"
110+ ]
111+ , repo =
112+ "https://github.com/hdgarrood/purescript-benchotron.git"
113+ , version =
114+ "v7.0.0"
115+ }
116+ }
117+-------------------------------
118+-}
119+
120+
121+let upstream =
122+ https://github.com/purescript/package-sets/releases/download/psc-0.13.6-20200423/packages.dhall sha256:c180a06bb5444fd950f8cbdd6605c644fd246deb397e62572b8f4a6b9dbcaf22
123+
124+let overrides = {=}
125+
126+let additions = {=}
127+
128+in upstream // overrides // additions
spago.dhallnew file+18
@@ -0,0 +1,18 @@
1+{-
2+Welcome to a Spago project!
3+You can edit this file as you like.
4+-}
5+{ name = "subtlecrypto"
6+, dependencies =
7+ [ "aff"
8+ , "arraybuffer-types"
9+ , "console"
10+ , "effect"
11+ , "foreign"
12+ , "prelude"
13+ , "promises"
14+ , "psci-support"
15+ ]
16+, packages = ./packages.dhall
17+, sources = [ "src/**/*.purs", "test/**/*.purs" ]
18+}
test.browser.js+384−485
@@ -1,72 +1,10 @@
1−// Generated by purs bundle 0.12.0
1+// Generated by purs bundle 0.13.6
22var PS = {};
3−(function(exports) {
4− // Generated by purs version 0.12.0
3+(function($PS) {
4+ // Generated by purs version 0.13.6
55 "use strict";
6− var Control_Category = PS["Control.Category"];
7− var Data_Boolean = PS["Data.Boolean"];
8− var Data_Ord = PS["Data.Ord"];
9− var Data_Ring = PS["Data.Ring"];
10− var flip = function (f) {
11− return function (b) {
12− return function (a) {
13− return f(a)(b);
14− };
15− };
16− };
17− var $$const = function (a) {
18− return function (v) {
19− return a;
20− };
21− };
22− exports["flip"] = flip;
23− exports["const"] = $$const;
24−})(PS["Data.Function"] = PS["Data.Function"] || {});
25−(function(exports) {
26− "use strict";
27−
28− exports.unit = {};
29−})(PS["Data.Unit"] = PS["Data.Unit"] || {});
30−(function(exports) {
31− // Generated by purs version 0.12.0
32− "use strict";
33− var $foreign = PS["Data.Unit"];
34− var Data_Show = PS["Data.Show"];
35− exports["unit"] = $foreign.unit;
36−})(PS["Data.Unit"] = PS["Data.Unit"] || {});
37−(function(exports) {
38− // Generated by purs version 0.12.0
39− "use strict";
40− var $foreign = PS["Data.Functor"];
41− var Control_Semigroupoid = PS["Control.Semigroupoid"];
42− var Data_Function = PS["Data.Function"];
43− var Data_Unit = PS["Data.Unit"];
44− var Functor = function (map) {
45− this.map = map;
46− };
47− var map = function (dict) {
48− return dict.map;
49− };
50− var $$void = function (dictFunctor) {
51− return map(dictFunctor)(Data_Function["const"](Data_Unit.unit));
52− };
53− var voidRight = function (dictFunctor) {
54− return function (x) {
55− return map(dictFunctor)(Data_Function["const"](x));
56− };
57− };
58− exports["Functor"] = Functor;
59− exports["map"] = map;
60− exports["void"] = $$void;
61− exports["voidRight"] = voidRight;
62−})(PS["Data.Functor"] = PS["Data.Functor"] || {});
63−(function(exports) {
64− // Generated by purs version 0.12.0
65− "use strict";
66− var $foreign = PS["Control.Apply"];
67− var Control_Category = PS["Control.Category"];
68− var Data_Function = PS["Data.Function"];
69− var Data_Functor = PS["Data.Functor"];
6+ $PS["Control.Apply"] = $PS["Control.Apply"] || {};
7+ var exports = $PS["Control.Apply"];
708 var Apply = function (Functor0, apply) {
719 this.Functor0 = Functor0;
7210 this.apply = apply;
@@ -76,13 +14,13 @@ var PS = {};
7614 };
7715 exports["Apply"] = Apply;
7816 exports["apply"] = apply;
79−})(PS["Control.Apply"] = PS["Control.Apply"] || {});
80−(function(exports) {
81− // Generated by purs version 0.12.0
17+})(PS);
18+(function($PS) {
19+ // Generated by purs version 0.13.6
8220 "use strict";
83− var Control_Apply = PS["Control.Apply"];
84− var Data_Functor = PS["Data.Functor"];
85− var Data_Unit = PS["Data.Unit"];
21+ $PS["Control.Applicative"] = $PS["Control.Applicative"] || {};
22+ var exports = $PS["Control.Applicative"];
23+ var Control_Apply = $PS["Control.Apply"];
8624 var Applicative = function (Apply0, pure) {
8725 this.Apply0 = Apply0;
8826 this.pure = pure;
@@ -100,24 +38,40 @@ var PS = {};
10038 exports["Applicative"] = Applicative;
10139 exports["pure"] = pure;
10240 exports["liftA1"] = liftA1;
103−})(PS["Control.Applicative"] = PS["Control.Applicative"] || {});
104−(function(exports) {
105− // Generated by purs version 0.12.0
41+})(PS);
42+(function($PS) {
43+ // Generated by purs version 0.13.6
10644 "use strict";
107− var $foreign = PS["Control.Bind"];
108− var Control_Applicative = PS["Control.Applicative"];
109− var Control_Apply = PS["Control.Apply"];
110− var Control_Category = PS["Control.Category"];
111− var Data_Function = PS["Data.Function"];
112− var Data_Functor = PS["Data.Functor"];
113− var Data_Unit = PS["Data.Unit"];
114− var Bind = function (Apply0, bind) {
115− this.Apply0 = Apply0;
116− this.bind = bind;
45+ $PS["Data.Function"] = $PS["Data.Function"] || {};
46+ var exports = $PS["Data.Function"];
47+ var flip = function (f) {
48+ return function (b) {
49+ return function (a) {
50+ return f(a)(b);
51+ };
52+ };
53+ };
54+ var $$const = function (a) {
55+ return function (v) {
56+ return a;
57+ };
11758 };
59+ exports["flip"] = flip;
60+ exports["const"] = $$const;
61+})(PS);
62+(function($PS) {
63+ // Generated by purs version 0.13.6
64+ "use strict";
65+ $PS["Control.Bind"] = $PS["Control.Bind"] || {};
66+ var exports = $PS["Control.Bind"];
67+ var Data_Function = $PS["Data.Function"];
11868 var Discard = function (discard) {
11969 this.discard = discard;
12070 };
71+ var Bind = function (Apply0, bind) {
72+ this.Apply0 = Apply0;
73+ this.bind = bind;
74+ };
12175 var discard = function (dict) {
12276 return dict.discard;
12377 };
@@ -133,18 +87,16 @@ var PS = {};
13387 exports["Bind"] = Bind;
13488 exports["bind"] = bind;
13589 exports["bindFlipped"] = bindFlipped;
136− exports["Discard"] = Discard;
13790 exports["discard"] = discard;
13891 exports["discardUnit"] = discardUnit;
139−})(PS["Control.Bind"] = PS["Control.Bind"] || {});
140−(function(exports) {
141− // Generated by purs version 0.12.0
92+})(PS);
93+(function($PS) {
94+ // Generated by purs version 0.13.6
14295 "use strict";
143− var Control_Applicative = PS["Control.Applicative"];
144− var Control_Apply = PS["Control.Apply"];
145− var Control_Bind = PS["Control.Bind"];
146− var Data_Functor = PS["Data.Functor"];
147− var Data_Unit = PS["Data.Unit"];
96+ $PS["Control.Monad"] = $PS["Control.Monad"] || {};
97+ var exports = $PS["Control.Monad"];
98+ var Control_Applicative = $PS["Control.Applicative"];
99+ var Control_Bind = $PS["Control.Bind"];
148100 var Monad = function (Applicative0, Bind1) {
149101 this.Applicative0 = Applicative0;
150102 this.Bind1 = Bind1;
@@ -152,9 +104,9 @@ var PS = {};
152104 var ap = function (dictMonad) {
153105 return function (f) {
154106 return function (a) {
155− return Control_Bind.bind(dictMonad.Bind1())(f)(function (v) {
156− return Control_Bind.bind(dictMonad.Bind1())(a)(function (v1) {
157− return Control_Applicative.pure(dictMonad.Applicative0())(v(v1));
107+ return Control_Bind.bind(dictMonad.Bind1())(f)(function (f$prime) {
108+ return Control_Bind.bind(dictMonad.Bind1())(a)(function (a$prime) {
109+ return Control_Applicative.pure(dictMonad.Applicative0())(f$prime(a$prime));
158110 });
159111 });
160112 };
@@ -162,38 +114,12 @@ var PS = {};
162114 };
163115 exports["Monad"] = Monad;
164116 exports["ap"] = ap;
165−})(PS["Control.Monad"] = PS["Control.Monad"] || {});
166−(function(exports) {
167− // Generated by purs version 0.12.0
117+})(PS);
118+(function($PS) {
119+ // Generated by purs version 0.13.6
168120 "use strict";
169− var Control_Alt = PS["Control.Alt"];
170− var Control_Applicative = PS["Control.Applicative"];
171− var Control_Apply = PS["Control.Apply"];
172− var Control_Bind = PS["Control.Bind"];
173− var Control_Extend = PS["Control.Extend"];
174− var Control_Monad = PS["Control.Monad"];
175− var Control_Semigroupoid = PS["Control.Semigroupoid"];
176− var Data_Bifoldable = PS["Data.Bifoldable"];
177− var Data_Bifunctor = PS["Data.Bifunctor"];
178− var Data_Bitraversable = PS["Data.Bitraversable"];
179− var Data_Bounded = PS["Data.Bounded"];
180− var Data_Eq = PS["Data.Eq"];
181− var Data_Foldable = PS["Data.Foldable"];
182− var Data_FoldableWithIndex = PS["Data.FoldableWithIndex"];
183− var Data_Function = PS["Data.Function"];
184− var Data_Functor = PS["Data.Functor"];
185− var Data_Functor_Invariant = PS["Data.Functor.Invariant"];
186− var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
187− var Data_Maybe = PS["Data.Maybe"];
188− var Data_Monoid = PS["Data.Monoid"];
189− var Data_Ord = PS["Data.Ord"];
190− var Data_Ordering = PS["Data.Ordering"];
191− var Data_Semigroup = PS["Data.Semigroup"];
192− var Data_Show = PS["Data.Show"];
193− var Data_Traversable = PS["Data.Traversable"];
194− var Data_TraversableWithIndex = PS["Data.TraversableWithIndex"];
195− var Data_Unit = PS["Data.Unit"];
196− var Prelude = PS["Prelude"];
121+ $PS["Data.Either"] = $PS["Data.Either"] || {};
122+ var exports = $PS["Data.Either"];
197123 var Left = (function () {
198124 function Left(value0) {
199125 this.value0 = value0;
@@ -214,19 +140,54 @@ var PS = {};
214140 })();
215141 exports["Left"] = Left;
216142 exports["Right"] = Right;
217−})(PS["Data.Either"] = PS["Data.Either"] || {});
143+})(PS);
218144(function(exports) {
219− // Generated by purs version 0.12.0
220145 "use strict";
221− var Control_Applicative = PS["Control.Applicative"];
222− var Control_Bind = PS["Control.Bind"];
223− var Control_Semigroupoid = PS["Control.Semigroupoid"];
224− var Data_Either = PS["Data.Either"];
225− var Data_Function = PS["Data.Function"];
226− var Data_Functor = PS["Data.Functor"];
227− var Data_Maybe = PS["Data.Maybe"];
228− var Data_Unit = PS["Data.Unit"];
229− var Prelude = PS["Prelude"];
146+
147+ exports.unit = {};
148+})(PS["Data.Unit"] = PS["Data.Unit"] || {});
149+(function($PS) {
150+ // Generated by purs version 0.13.6
151+ "use strict";
152+ $PS["Data.Unit"] = $PS["Data.Unit"] || {};
153+ var exports = $PS["Data.Unit"];
154+ var $foreign = $PS["Data.Unit"];
155+ exports["unit"] = $foreign.unit;
156+})(PS);
157+(function($PS) {
158+ // Generated by purs version 0.13.6
159+ "use strict";
160+ $PS["Data.Functor"] = $PS["Data.Functor"] || {};
161+ var exports = $PS["Data.Functor"];
162+ var Data_Function = $PS["Data.Function"];
163+ var Data_Unit = $PS["Data.Unit"];
164+ var Functor = function (map) {
165+ this.map = map;
166+ };
167+ var map = function (dict) {
168+ return dict.map;
169+ };
170+ var $$void = function (dictFunctor) {
171+ return map(dictFunctor)(Data_Function["const"](Data_Unit.unit));
172+ };
173+ var voidRight = function (dictFunctor) {
174+ return function (x) {
175+ return map(dictFunctor)(Data_Function["const"](x));
176+ };
177+ };
178+ exports["Functor"] = Functor;
179+ exports["map"] = map;
180+ exports["void"] = $$void;
181+ exports["voidRight"] = voidRight;
182+})(PS);
183+(function($PS) {
184+ // Generated by purs version 0.13.6
185+ "use strict";
186+ $PS["Control.Monad.Error.Class"] = $PS["Control.Monad.Error.Class"] || {};
187+ var exports = $PS["Control.Monad.Error.Class"];
188+ var Control_Applicative = $PS["Control.Applicative"];
189+ var Data_Either = $PS["Data.Either"];
190+ var Data_Functor = $PS["Data.Functor"];
230191 var MonadThrow = function (Monad0, throwError) {
231192 this.Monad0 = Monad0;
232193 this.throwError = throwError;
@@ -234,31 +195,29 @@ var PS = {};
234195 var MonadError = function (MonadThrow0, catchError) {
235196 this.MonadThrow0 = MonadThrow0;
236197 this.catchError = catchError;
237− };
238− var throwError = function (dict) {
239− return dict.throwError;
240− };
198+ };
241199 var catchError = function (dict) {
242200 return dict.catchError;
243201 };
244202 var $$try = function (dictMonadError) {
245203 return function (a) {
246− return catchError(dictMonadError)(Data_Functor.map(((((dictMonadError.MonadThrow0()).Monad0()).Bind1()).Apply0()).Functor0())(Data_Either.Right.create)(a))(function ($21) {
247− return Control_Applicative.pure(((dictMonadError.MonadThrow0()).Monad0()).Applicative0())(Data_Either.Left.create($21));
248− });
204+ return catchError(dictMonadError)(Data_Functor.map(((((dictMonadError.MonadThrow0()).Monad0()).Bind1()).Apply0()).Functor0())(Data_Either.Right.create)(a))((function () {
205+ var $17 = Control_Applicative.pure(((dictMonadError.MonadThrow0()).Monad0()).Applicative0());
206+ return function ($18) {
207+ return $17(Data_Either.Left.create($18));
208+ };
209+ })());
249210 };
250211 };
251− exports["catchError"] = catchError;
252− exports["throwError"] = throwError;
253212 exports["MonadThrow"] = MonadThrow;
254213 exports["MonadError"] = MonadError;
255214 exports["try"] = $$try;
256−})(PS["Control.Monad.Error.Class"] = PS["Control.Monad.Error.Class"] || {});
257−(function(exports) {
258− // Generated by purs version 0.12.0
215+})(PS);
216+(function($PS) {
217+ // Generated by purs version 0.13.6
259218 "use strict";
260− var Data_Eq = PS["Data.Eq"];
261− var Prelude = PS["Prelude"];
219+ $PS["Crypto.Subtle.Constants.AES"] = $PS["Crypto.Subtle.Constants.AES"] || {};
220+ var exports = $PS["Crypto.Subtle.Constants.AES"];
262221 var l256 = 256;
263222 var l192 = 192;
264223 var l128 = 128;
@@ -273,12 +232,12 @@ var PS = {};
273232 exports["l128"] = l128;
274233 exports["l192"] = l192;
275234 exports["l256"] = l256;
276−})(PS["Crypto.Subtle.Constants.AES"] = PS["Crypto.Subtle.Constants.AES"] || {});
277−(function(exports) {
278− // Generated by purs version 0.12.0
235+})(PS);
236+(function($PS) {
237+ // Generated by purs version 0.13.6
279238 "use strict";
280− var Data_Eq = PS["Data.Eq"];
281− var Prelude = PS["Prelude"];
239+ $PS["Crypto.Subtle.Constants.EC"] = $PS["Crypto.Subtle.Constants.EC"] || {};
240+ var exports = $PS["Crypto.Subtle.Constants.EC"];
282241 var p521 = "P-521";
283242 var p384 = "P-384";
284243 var p256 = "P-256";
@@ -289,21 +248,43 @@ var PS = {};
289248 exports["p256"] = p256;
290249 exports["p384"] = p384;
291250 exports["p521"] = p521;
292−})(PS["Crypto.Subtle.Constants.EC"] = PS["Crypto.Subtle.Constants.EC"] || {});
293−(function(exports) {
294− // Generated by purs version 0.12.0
251+})(PS);
252+(function($PS) {
253+ // Generated by purs version 0.13.6
295254 "use strict";
296− var Data_Eq = PS["Data.Eq"];
297− var Prelude = PS["Prelude"];
255+ $PS["Crypto.Subtle.Constants.RSA"] = $PS["Crypto.Subtle.Constants.RSA"] || {};
256+ var exports = $PS["Crypto.Subtle.Constants.RSA"];
298257 var rsaPSS = "RSA-PSS";
299258 var rsaPKCS1 = "RSASSA-PKCS1-v1_5";
300259 var rsaOAEP = "RSA-OAEP";
301260 exports["rsaPKCS1"] = rsaPKCS1;
302261 exports["rsaPSS"] = rsaPSS;
303262 exports["rsaOAEP"] = rsaOAEP;
304−})(PS["Crypto.Subtle.Constants.RSA"] = PS["Crypto.Subtle.Constants.RSA"] || {});
263+})(PS);
264+(function($PS) {
265+ // Generated by purs version 0.13.6
266+ "use strict";
267+ $PS["Crypto.Subtle.Hash"] = $PS["Crypto.Subtle.Hash"] || {};
268+ var exports = $PS["Crypto.Subtle.Hash"];
269+ var sha512 = "SHA-512";
270+ var sha384 = "SHA-384";
271+ var sha256 = "SHA-256";
272+ var sha1 = "SHA-1";
273+ exports["sha1"] = sha1;
274+ exports["sha256"] = sha256;
275+ exports["sha384"] = sha384;
276+ exports["sha512"] = sha512;
277+})(PS);
278+(function(exports) {
279+ "use strict";
280+
281+ exports.generateKeyImpl = function generateKeyImpl (a,e,u) {
282+ return crypto.subtle.generateKey(a,e,u);
283+ };
284+ exports.exp65537 = new Uint8Array([0x01,0x00,0x01]);
285+})(PS["Crypto.Subtle.Key.Generate"] = PS["Crypto.Subtle.Key.Generate"] || {});
305286(function(exports) {
306− "use strict";
287+ "use strict";
307288
308289 exports.pureE = function (a) {
309290 return function () {
@@ -319,18 +300,17 @@ var PS = {};
319300 };
320301 };
321302})(PS["Effect"] = PS["Effect"] || {});
322−(function(exports) {
323− // Generated by purs version 0.12.0
303+(function($PS) {
304+ // Generated by purs version 0.13.6
324305 "use strict";
325− var $foreign = PS["Effect"];
326− var Control_Applicative = PS["Control.Applicative"];
327− var Control_Apply = PS["Control.Apply"];
328− var Control_Bind = PS["Control.Bind"];
329− var Control_Monad = PS["Control.Monad"];
330− var Data_Functor = PS["Data.Functor"];
331− var Data_Monoid = PS["Data.Monoid"];
332− var Data_Semigroup = PS["Data.Semigroup"];
333− var Prelude = PS["Prelude"];
306+ $PS["Effect"] = $PS["Effect"] || {};
307+ var exports = $PS["Effect"];
308+ var $foreign = $PS["Effect"];
309+ var Control_Applicative = $PS["Control.Applicative"];
310+ var Control_Apply = $PS["Control.Apply"];
311+ var Control_Bind = $PS["Control.Bind"];
312+ var Control_Monad = $PS["Control.Monad"];
313+ var Data_Functor = $PS["Data.Functor"];
334314 var monadEffect = new Control_Monad.Monad(function () {
335315 return applicativeEffect;
336316 }, function () {
@@ -347,11 +327,8 @@ var PS = {};
347327 }, $foreign.pureE);
348328 var functorEffect = new Data_Functor.Functor(Control_Applicative.liftA1(applicativeEffect));
349329 exports["functorEffect"] = functorEffect;
350− exports["applyEffect"] = applyEffect;
351330 exports["applicativeEffect"] = applicativeEffect;
352− exports["bindEffect"] = bindEffect;
353− exports["monadEffect"] = monadEffect;
354−})(PS["Effect"] = PS["Effect"] || {});
331+})(PS);
355332(function(exports) {
356333 /* globals setImmediate, clearImmediate, setTimeout, clearTimeout */
357334 /* jshint -W083, -W098, -W003 */
@@ -515,7 +492,7 @@ var PS = {};
515492 delete fibers[fid];
516493 };
517494 }
518− });
495+ })();
519496 fibers[fid] = fiber;
520497 count++;
521498 },
@@ -524,6 +501,10 @@ var PS = {};
524501 },
525502 killAll: function (killError, cb) {
526503 return function () {
504+ if (count === 0) {
505+ return cb();
506+ }
507+
527508 var killCount = 0;
528509 var kills = {};
529510
@@ -625,12 +606,18 @@ var PS = {};
625606 switch (status) {
626607 case STEP_BIND:
627608 status = CONTINUE;
628− step = bhead(step);
629− if (btail === null) {
630− bhead = null;
631− } else {
632− bhead = btail._1;
633− btail = btail._2;
609+ try {
610+ step = bhead(step);
611+ if (btail === null) {
612+ bhead = null;
613+ } else {
614+ bhead = btail._1;
615+ btail = btail._2;
616+ }
617+ } catch (e) {
618+ status = RETURN;
619+ fail = util.left(e);
620+ step = null;
634621 }
635622 break;
636623
@@ -766,14 +753,14 @@ var PS = {};
766753 attempts = attempts._2;
767754
768755 switch (attempt.tag) {
769− // We cannot recover from an interrupt. Otherwise we should
756+ // We cannot recover from an unmasked interrupt. Otherwise we should
770757 // continue stepping, or run the exception handler if an exception
771758 // was raised.
772759 case CATCH:
773760 // We should compare the interrupt status as well because we
774761 // only want it to apply if there has been an interrupt since
775762 // enqueuing the catch.
776− if (interrupt && interrupt !== tmp) {
763+ if (interrupt && interrupt !== tmp && bracketCount === 0) {
777764 status = RETURN;
778765 } else if (fail) {
779766 status = CONTINUE;
@@ -782,11 +769,11 @@ var PS = {};
782769 }
783770 break;
784771
785− // We cannot resume from an interrupt or exception.
772+ // We cannot resume from an unmasked interrupt or exception.
786773 case RESUME:
787774 // As with Catch, we only want to ignore in the case of an
788775 // interrupt since enqueing the item.
789− if (interrupt && interrupt !== tmp || fail) {
776+ if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {
790777 status = RETURN;
791778 } else {
792779 bhead = attempt._1;
@@ -819,12 +806,13 @@ var PS = {};
819806 // Enqueue the appropriate handler. We increase the bracket count
820807 // because it should not be cancelled.
821808 case RELEASE:
822− bracketCount++;
823809 attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);
824810 status = CONTINUE;
825811 // It has only been killed if the interrupt status has changed
826− // since we enqueued the item.
827− if (interrupt && interrupt !== tmp) {
812+ // since we enqueued the item, and the bracket count is 0. If the
813+ // bracket count is non-zero then we are in a masked state so it's
814+ // impossible to be killed.
815+ if (interrupt && interrupt !== tmp && bracketCount === 0) {
828816 step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);
829817 } else if (fail) {
830818 step = attempt._1.failed(util.fromLeft(fail))(attempt._2);
@@ -832,6 +820,7 @@ var PS = {};
832820 step = attempt._1.completed(util.fromRight(step))(attempt._2);
833821 }
834822 fail = null;
823+ bracketCount++;
835824 break;
836825
837826 case FINALIZER:
@@ -1420,12 +1409,11 @@ var PS = {};
14201409 };
14211410 };
14221411})(PS["Effect.Aff"] = PS["Effect.Aff"] || {});
1423−(function(exports) {
1424− // Generated by purs version 0.12.0
1412+(function($PS) {
1413+ // Generated by purs version 0.13.6
14251414 "use strict";
1426− var Control_Category = PS["Control.Category"];
1427− var Control_Monad = PS["Control.Monad"];
1428− var Effect = PS["Effect"];
1415+ $PS["Effect.Class"] = $PS["Effect.Class"] || {};
1416+ var exports = $PS["Effect.Class"];
14291417 var MonadEffect = function (Monad0, liftEffect) {
14301418 this.Monad0 = Monad0;
14311419 this.liftEffect = liftEffect;
@@ -1435,32 +1423,9 @@ var PS = {};
14351423 };
14361424 exports["liftEffect"] = liftEffect;
14371425 exports["MonadEffect"] = MonadEffect;
1438−})(PS["Effect.Class"] = PS["Effect.Class"] || {});
1426+})(PS);
14391427(function(exports) {
1440− "use strict";
1441−
1442− exports.throwException = function (e) {
1443− return function () {
1444− throw e;
1445− };
1446− };
1447−})(PS["Effect.Exception"] = PS["Effect.Exception"] || {});
1448−(function(exports) {
1449− // Generated by purs version 0.12.0
14501428 "use strict";
1451− var $foreign = PS["Effect.Exception"];
1452− var Control_Applicative = PS["Control.Applicative"];
1453− var Control_Semigroupoid = PS["Control.Semigroupoid"];
1454− var Data_Either = PS["Data.Either"];
1455− var Data_Functor = PS["Data.Functor"];
1456− var Data_Maybe = PS["Data.Maybe"];
1457− var Data_Show = PS["Data.Show"];
1458− var Effect = PS["Effect"];
1459− var Prelude = PS["Prelude"];
1460− exports["throwException"] = $foreign.throwException;
1461−})(PS["Effect.Exception"] = PS["Effect.Exception"] || {});
1462−(function(exports) {
1463− "use strict";
14641429
14651430 // module Partial.Unsafe
14661431
@@ -1469,7 +1434,7 @@ var PS = {};
14691434 };
14701435})(PS["Partial.Unsafe"] = PS["Partial.Unsafe"] || {});
14711436(function(exports) {
1472− "use strict";
1437+ "use strict";
14731438
14741439 // module Partial
14751440
@@ -1479,59 +1444,47 @@ var PS = {};
14791444 };
14801445 };
14811446})(PS["Partial"] = PS["Partial"] || {});
1482−(function(exports) {
1483− // Generated by purs version 0.12.0
1447+(function($PS) {
1448+ // Generated by purs version 0.13.6
14841449 "use strict";
1485− var $foreign = PS["Partial"];
1450+ $PS["Partial"] = $PS["Partial"] || {};
1451+ var exports = $PS["Partial"];
1452+ var $foreign = $PS["Partial"];
14861453 exports["crashWith"] = $foreign.crashWith;
1487−})(PS["Partial"] = PS["Partial"] || {});
1488−(function(exports) {
1489− // Generated by purs version 0.12.0
1454+})(PS);
1455+(function($PS) {
1456+ // Generated by purs version 0.13.6
14901457 "use strict";
1491− var $foreign = PS["Partial.Unsafe"];
1492− var Partial = PS["Partial"];
1458+ $PS["Partial.Unsafe"] = $PS["Partial.Unsafe"] || {};
1459+ var exports = $PS["Partial.Unsafe"];
1460+ var $foreign = $PS["Partial.Unsafe"];
1461+ var Partial = $PS["Partial"];
14931462 var unsafeCrashWith = function (msg) {
14941463 return $foreign.unsafePartial(function (dictPartial) {
1495− return Partial.crashWith(dictPartial)(msg);
1464+ return Partial.crashWith()(msg);
14961465 });
14971466 };
14981467 exports["unsafeCrashWith"] = unsafeCrashWith;
1499−})(PS["Partial.Unsafe"] = PS["Partial.Unsafe"] || {});
1500−(function(exports) {
1501− // Generated by purs version 0.12.0
1468+})(PS);
1469+(function($PS) {
1470+ // Generated by purs version 0.13.6
15021471 "use strict";
1503− var $foreign = PS["Effect.Aff"];
1504− var Control_Alt = PS["Control.Alt"];
1505− var Control_Alternative = PS["Control.Alternative"];
1506− var Control_Applicative = PS["Control.Applicative"];
1507− var Control_Apply = PS["Control.Apply"];
1508− var Control_Bind = PS["Control.Bind"];
1509− var Control_Lazy = PS["Control.Lazy"];
1510− var Control_Monad = PS["Control.Monad"];
1511− var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
1512− var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
1513− var Control_Parallel = PS["Control.Parallel"];
1514− var Control_Parallel_Class = PS["Control.Parallel.Class"];
1515− var Control_Plus = PS["Control.Plus"];
1516− var Control_Semigroupoid = PS["Control.Semigroupoid"];
1517− var Data_Either = PS["Data.Either"];
1518− var Data_Foldable = PS["Data.Foldable"];
1519− var Data_Function = PS["Data.Function"];
1520− var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
1521− var Data_Functor = PS["Data.Functor"];
1522− var Data_Monoid = PS["Data.Monoid"];
1523− var Data_Newtype = PS["Data.Newtype"];
1524− var Data_Semigroup = PS["Data.Semigroup"];
1525− var Data_Time_Duration = PS["Data.Time.Duration"];
1526− var Data_Unit = PS["Data.Unit"];
1527− var Effect = PS["Effect"];
1528− var Effect_Class = PS["Effect.Class"];
1529− var Effect_Exception = PS["Effect.Exception"];
1530− var Effect_Unsafe = PS["Effect.Unsafe"];
1531− var Partial_Unsafe = PS["Partial.Unsafe"];
1532− var Prelude = PS["Prelude"];
1533− var Unsafe_Coerce = PS["Unsafe.Coerce"];
1534− var functorAff = new Data_Functor.Functor($foreign._map);
1472+ $PS["Effect.Aff"] = $PS["Effect.Aff"] || {};
1473+ var exports = $PS["Effect.Aff"];
1474+ var $foreign = $PS["Effect.Aff"];
1475+ var Control_Applicative = $PS["Control.Applicative"];
1476+ var Control_Apply = $PS["Control.Apply"];
1477+ var Control_Bind = $PS["Control.Bind"];
1478+ var Control_Monad = $PS["Control.Monad"];
1479+ var Control_Monad_Error_Class = $PS["Control.Monad.Error.Class"];
1480+ var Data_Either = $PS["Data.Either"];
1481+ var Data_Function = $PS["Data.Function"];
1482+ var Data_Functor = $PS["Data.Functor"];
1483+ var Data_Unit = $PS["Data.Unit"];
1484+ var Effect = $PS["Effect"];
1485+ var Effect_Class = $PS["Effect.Class"];
1486+ var Partial_Unsafe = $PS["Partial.Unsafe"];
1487+ var functorAff = new Data_Functor.Functor($foreign["_map"]);
15351488 var ffiUtil = (function () {
15361489 var unsafeFromRight = function (v) {
15371490 if (v instanceof Data_Either.Right) {
@@ -1540,7 +1493,7 @@ var PS = {};
15401493 if (v instanceof Data_Either.Left) {
15411494 return Partial_Unsafe.unsafeCrashWith("unsafeFromRight: Left");
15421495 };
1543− throw new Error("Failed pattern match at Effect.Aff line 400, column 21 - line 402, column 31: " + [ v.constructor.name ]);
1496+ throw new Error("Failed pattern match at Effect.Aff (line 400, column 21 - line 402, column 54): " + [ v.constructor.name ]);
15441497 };
15451498 var unsafeFromLeft = function (v) {
15461499 if (v instanceof Data_Either.Left) {
@@ -1549,7 +1502,7 @@ var PS = {};
15491502 if (v instanceof Data_Either.Right) {
15501503 return Partial_Unsafe.unsafeCrashWith("unsafeFromLeft: Right");
15511504 };
1552− throw new Error("Failed pattern match at Effect.Aff line 395, column 20 - line 399, column 3: " + [ v.constructor.name ]);
1505+ throw new Error("Failed pattern match at Effect.Aff (line 395, column 20 - line 397, column 54): " + [ v.constructor.name ]);
15531506 };
15541507 var isLeft = function (v) {
15551508 if (v instanceof Data_Either.Left) {
@@ -1558,7 +1511,7 @@ var PS = {};
15581511 if (v instanceof Data_Either.Right) {
15591512 return false;
15601513 };
1561− throw new Error("Failed pattern match at Effect.Aff line 390, column 12 - line 392, column 20: " + [ v.constructor.name ]);
1514+ throw new Error("Failed pattern match at Effect.Aff (line 390, column 12 - line 392, column 20): " + [ v.constructor.name ]);
15621515 };
15631516 return {
15641517 isLeft: isLeft,
@@ -1569,13 +1522,13 @@ var PS = {};
15691522 };
15701523 })();
15711524 var makeFiber = function (aff) {
1572− return $foreign._makeFiber(ffiUtil, aff);
1525+ return $foreign["_makeFiber"](ffiUtil, aff);
15731526 };
15741527 var launchAff = function (aff) {
15751528 return function __do() {
1576− var v = makeFiber(aff)();
1577− v.run();
1578− return v;
1529+ var fiber = makeFiber(aff)();
1530+ fiber.run();
1531+ return fiber;
15791532 };
15801533 };
15811534 var monadAff = new Control_Monad.Monad(function () {
@@ -1585,27 +1538,30 @@ var PS = {};
15851538 });
15861539 var bindAff = new Control_Bind.Bind(function () {
15871540 return applyAff;
1588− }, $foreign._bind);
1541+ }, $foreign["_bind"]);
15891542 var applyAff = new Control_Apply.Apply(function () {
15901543 return functorAff;
15911544 }, Control_Monad.ap(monadAff));
15921545 var applicativeAff = new Control_Applicative.Applicative(function () {
15931546 return applyAff;
1594− }, $foreign._pure);
1547+ }, $foreign["_pure"]);
15951548 var monadEffectAff = new Effect_Class.MonadEffect(function () {
15961549 return monadAff;
1597− }, $foreign._liftEffect);
1550+ }, $foreign["_liftEffect"]);
15981551 var monadThrowAff = new Control_Monad_Error_Class.MonadThrow(function () {
15991552 return monadAff;
1600− }, $foreign._throwError);
1553+ }, $foreign["_throwError"]);
16011554 var monadErrorAff = new Control_Monad_Error_Class.MonadError(function () {
16021555 return monadThrowAff;
1603− }, $foreign._catchError);
1556+ }, $foreign["_catchError"]);
16041557 var runAff = function (k) {
16051558 return function (aff) {
1606− return launchAff(Control_Bind.bindFlipped(bindAff)(function ($52) {
1607− return Effect_Class.liftEffect(monadEffectAff)(k($52));
1608− })(Control_Monad_Error_Class["try"](monadErrorAff)(aff)));
1559+ return launchAff(Control_Bind.bindFlipped(bindAff)((function () {
1560+ var $49 = Effect_Class.liftEffect(monadEffectAff);
1561+ return function ($50) {
1562+ return $49(k($50));
1563+ };
1564+ })())(Control_Monad_Error_Class["try"](monadErrorAff)(aff)));
16091565 };
16101566 };
16111567 var runAff_ = function (k) {
@@ -1614,21 +1570,14 @@ var PS = {};
16141570 };
16151571 };
16161572 var nonCanceler = Data_Function["const"](Control_Applicative.pure(applicativeAff)(Data_Unit.unit));
1617− exports["launchAff"] = launchAff;
1618− exports["runAff"] = runAff;
16191573 exports["runAff_"] = runAff_;
16201574 exports["nonCanceler"] = nonCanceler;
1621− exports["functorAff"] = functorAff;
1622− exports["applyAff"] = applyAff;
1623− exports["applicativeAff"] = applicativeAff;
16241575 exports["bindAff"] = bindAff;
1625− exports["monadAff"] = monadAff;
1626− exports["monadThrowAff"] = monadThrowAff;
1627− exports["monadErrorAff"] = monadErrorAff;
16281576 exports["monadEffectAff"] = monadEffectAff;
16291577 exports["makeAff"] = $foreign.makeAff;
1630−})(PS["Effect.Aff"] = PS["Effect.Aff"] || {});
1578+})(PS);
16311579(function(exports) {
1580+
16321581
16331582 exports.promiseToEffectImpl = function (promise, onFulfilled, onRejected) {
16341583 return function () {
@@ -1640,161 +1589,48 @@ var PS = {};
16401589 };
16411590 };
16421591})(PS["Effect.Promise"] = PS["Effect.Promise"] || {});
1643−(function(exports) {exports.undefer = function (f) {
1592+(function(exports) {
1593+ exports.undefer = function (f) {
16441594 return f();
16451595 };
16461596})(PS["Effect.Promise.Unsafe"] = PS["Effect.Promise.Unsafe"] || {});
1647−(function(exports) {
1648− // Generated by purs version 0.12.0
1597+(function($PS) {
1598+ // Generated by purs version 0.13.6
16491599 "use strict";
1650− var $foreign = PS["Effect.Promise.Unsafe"];
1600+ $PS["Effect.Promise.Unsafe"] = $PS["Effect.Promise.Unsafe"] || {};
1601+ var exports = $PS["Effect.Promise.Unsafe"];
1602+ var $foreign = $PS["Effect.Promise.Unsafe"];
16511603 exports["undefer"] = $foreign.undefer;
1652−})(PS["Effect.Promise.Unsafe"] = PS["Effect.Promise.Unsafe"] || {});
1653−(function(exports) {
1654− // Generated by purs version 0.12.0
1604+})(PS);
1605+(function($PS) {
1606+ // Generated by purs version 0.13.6
16551607 "use strict";
1656− var $foreign = PS["Effect.Promise"];
1657− var Control_Applicative = PS["Control.Applicative"];
1658− var Control_Apply = PS["Control.Apply"];
1659− var Control_Bind = PS["Control.Bind"];
1660− var Control_Monad = PS["Control.Monad"];
1661− var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
1662− var Control_Semigroupoid = PS["Control.Semigroupoid"];
1663− var Data_Array = PS["Data.Array"];
1664− var Data_Either = PS["Data.Either"];
1665− var Data_Foldable = PS["Data.Foldable"];
1666− var Data_Function = PS["Data.Function"];
1667− var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
1668− var Data_Functor = PS["Data.Functor"];
1669− var Data_Monoid = PS["Data.Monoid"];
1670− var Data_Semigroup = PS["Data.Semigroup"];
1671− var Data_Time_Duration = PS["Data.Time.Duration"];
1672− var Data_Unfoldable = PS["Data.Unfoldable"];
1673− var Data_Unit = PS["Data.Unit"];
1674− var Effect = PS["Effect"];
1675− var Effect_Class = PS["Effect.Class"];
1676− var Effect_Exception = PS["Effect.Exception"];
1677− var Effect_Promise_Unsafe = PS["Effect.Promise.Unsafe"];
1678− var Prelude = PS["Prelude"];
1608+ $PS["Effect.Promise"] = $PS["Effect.Promise"] || {};
1609+ var exports = $PS["Effect.Promise"];
1610+ var $foreign = $PS["Effect.Promise"];
1611+ var Effect_Promise_Unsafe = $PS["Effect.Promise.Unsafe"];
16791612 var runPromise = function (onSucc) {
16801613 return function (onErr) {
16811614 return function (p) {
16821615 return $foreign.promiseToEffectImpl(Effect_Promise_Unsafe.undefer(function (dictDeferred) {
1683− return p(dictDeferred);
1616+ return p();
16841617 }), onSucc, onErr);
16851618 };
16861619 };
16871620 };
16881621 exports["runPromise"] = runPromise;
1689−})(PS["Effect.Promise"] = PS["Effect.Promise"] || {});
1690−(function(exports) {
1691− // Generated by purs version 0.12.0
1622+})(PS);
1623+(function($PS) {
1624+ // Generated by purs version 0.13.6
16921625 "use strict";
1693− var $foreign = PS["Crypto.Subtle.Hash"];
1694− var Control_Semigroupoid = PS["Control.Semigroupoid"];
1695− var Data_ArrayBuffer_Types = PS["Data.ArrayBuffer.Types"];
1696− var Data_Either = PS["Data.Either"];
1697− var Data_Eq = PS["Data.Eq"];
1698− var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
1699− var Data_Functor = PS["Data.Functor"];
1700− var Effect = PS["Effect"];
1701− var Effect_Aff = PS["Effect.Aff"];
1702− var Effect_Promise = PS["Effect.Promise"];
1703− var Prelude = PS["Prelude"];
1704− var sha512 = "SHA-512";
1705− var sha384 = "SHA-384";
1706− var sha256 = "SHA-256";
1707− var sha1 = "SHA-1";
1708− exports["sha1"] = sha1;
1709− exports["sha256"] = sha256;
1710− exports["sha384"] = sha384;
1711− exports["sha512"] = sha512;
1712−})(PS["Crypto.Subtle.Hash"] = PS["Crypto.Subtle.Hash"] || {});
1713−(function(exports) {
1714− "use strict";
1715−
1716− exports.generateKeyImpl = function generateKeyImpl (a,e,u) {
1717− return crypto.subtle.generateKey(a,e,u);
1718− };
1719− exports.exp65537 = new Uint8Array([0x01,0x00,0x01]);
1720−})(PS["Crypto.Subtle.Key.Generate"] = PS["Crypto.Subtle.Key.Generate"] || {});
1721−(function(exports) {
1722− "use strict";
1723−
1724− exports.exportKeyImpl = function exportKeyImpl (f,x) {
1725− return crypto.subtle.exportKey(f,x);
1726− };
1727−})(PS["Crypto.Subtle.Key.Types"] = PS["Crypto.Subtle.Key.Types"] || {});
1728−(function(exports) {
1729− // Generated by purs version 0.12.0
1730− "use strict";
1731− var $foreign = PS["Crypto.Subtle.Key.Types"];
1732− var Control_Semigroupoid = PS["Control.Semigroupoid"];
1733− var Data_ArrayBuffer_Types = PS["Data.ArrayBuffer.Types"];
1734− var Data_Either = PS["Data.Either"];
1735− var Data_Eq = PS["Data.Eq"];
1736− var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
1737− var Data_Functor = PS["Data.Functor"];
1738− var Effect = PS["Effect"];
1739− var Effect_Aff = PS["Effect.Aff"];
1740− var Effect_Promise = PS["Effect.Promise"];
1741− var Foreign = PS["Foreign"];
1742− var Prelude = PS["Prelude"];
1743− var Unsafe_Coerce = PS["Unsafe.Coerce"];
1744− var wrapKey = "wrapKey";
1745− var verify = "verify";
1746− var unwrapKey = "unwrapKey";
1747− var sign = "sign";
1748− var raw = "raw";
1749− var exportKey = function (f) {
1750− return function (x) {
1751− return Effect_Aff.makeAff(function (resolve) {
1752− return Data_Functor.voidRight(Effect.functorEffect)(Effect_Aff.nonCanceler)(Effect_Promise.runPromise(function ($1) {
1753− return resolve(Data_Either.Right.create($1));
1754− })(function ($2) {
1755− return resolve(Data_Either.Left.create($2));
1756− })(function (dictDeferred) {
1757− return $foreign.exportKeyImpl(f, x);
1758− }));
1759− });
1760− };
1761− };
1762− var encrypt = "encrypt";
1763− var deriveKey = "deriveKey";
1764− var deriveBits = "deriveBits";
1765− var decrypt = "decrypt";
1766− var allUsages = [ encrypt, decrypt, sign, verify, deriveKey, deriveBits, wrapKey, unwrapKey ];
1767− exports["encrypt"] = encrypt;
1768− exports["decrypt"] = decrypt;
1769− exports["sign"] = sign;
1770− exports["verify"] = verify;
1771− exports["deriveKey"] = deriveKey;
1772− exports["deriveBits"] = deriveBits;
1773− exports["unwrapKey"] = unwrapKey;
1774− exports["wrapKey"] = wrapKey;
1775− exports["allUsages"] = allUsages;
1776− exports["exportKey"] = exportKey;
1777− exports["raw"] = raw;
1778−})(PS["Crypto.Subtle.Key.Types"] = PS["Crypto.Subtle.Key.Types"] || {});
1779−(function(exports) {
1780− // Generated by purs version 0.12.0
1781− "use strict";
1782− var $foreign = PS["Crypto.Subtle.Key.Generate"];
1783− var Control_Semigroupoid = PS["Control.Semigroupoid"];
1784− var Crypto_Subtle_Constants_AES = PS["Crypto.Subtle.Constants.AES"];
1785− var Crypto_Subtle_Constants_EC = PS["Crypto.Subtle.Constants.EC"];
1786− var Crypto_Subtle_Constants_RSA = PS["Crypto.Subtle.Constants.RSA"];
1787− var Crypto_Subtle_Hash = PS["Crypto.Subtle.Hash"];
1788− var Crypto_Subtle_Key_Types = PS["Crypto.Subtle.Key.Types"];
1789− var Data_ArrayBuffer_Types = PS["Data.ArrayBuffer.Types"];
1790− var Data_Either = PS["Data.Either"];
1791− var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
1792− var Data_Functor = PS["Data.Functor"];
1793− var Effect = PS["Effect"];
1794− var Effect_Aff = PS["Effect.Aff"];
1795− var Effect_Promise = PS["Effect.Promise"];
1796− var Prelude = PS["Prelude"];
1797− var Unsafe_Coerce = PS["Unsafe.Coerce"];
1626+ $PS["Crypto.Subtle.Key.Generate"] = $PS["Crypto.Subtle.Key.Generate"] || {};
1627+ var exports = $PS["Crypto.Subtle.Key.Generate"];
1628+ var $foreign = $PS["Crypto.Subtle.Key.Generate"];
1629+ var Data_Either = $PS["Data.Either"];
1630+ var Data_Functor = $PS["Data.Functor"];
1631+ var Effect = $PS["Effect"];
1632+ var Effect_Aff = $PS["Effect.Aff"];
1633+ var Effect_Promise = $PS["Effect.Promise"];
17981634 var rsa = function (r) {
17991635 return function (l) {
18001636 return function (e) {
@@ -1868,9 +1704,54 @@ var PS = {};
18681704 exports["hmac"] = hmac;
18691705 exports["aes"] = aes;
18701706 exports["exp65537"] = $foreign.exp65537;
1871−})(PS["Crypto.Subtle.Key.Generate"] = PS["Crypto.Subtle.Key.Generate"] || {});
1707+})(PS);
1708+(function(exports) {
1709+ "use strict";
1710+
1711+ exports.exportKeyImpl = function exportKeyImpl (f,x) {
1712+ return crypto.subtle.exportKey(f,x);
1713+ };
1714+})(PS["Crypto.Subtle.Key.Types"] = PS["Crypto.Subtle.Key.Types"] || {});
1715+(function($PS) {
1716+ // Generated by purs version 0.13.6
1717+ "use strict";
1718+ $PS["Crypto.Subtle.Key.Types"] = $PS["Crypto.Subtle.Key.Types"] || {};
1719+ var exports = $PS["Crypto.Subtle.Key.Types"];
1720+ var $foreign = $PS["Crypto.Subtle.Key.Types"];
1721+ var Data_Either = $PS["Data.Either"];
1722+ var Data_Functor = $PS["Data.Functor"];
1723+ var Effect = $PS["Effect"];
1724+ var Effect_Aff = $PS["Effect.Aff"];
1725+ var Effect_Promise = $PS["Effect.Promise"];
1726+ var wrapKey = "wrapKey";
1727+ var verify = "verify";
1728+ var unwrapKey = "unwrapKey";
1729+ var sign = "sign";
1730+ var raw = "raw";
1731+ var exportKey = function (f) {
1732+ return function (x) {
1733+ return Effect_Aff.makeAff(function (resolve) {
1734+ return Data_Functor.voidRight(Effect.functorEffect)(Effect_Aff.nonCanceler)(Effect_Promise.runPromise(function ($1) {
1735+ return resolve(Data_Either.Right.create($1));
1736+ })(function ($2) {
1737+ return resolve(Data_Either.Left.create($2));
1738+ })(function (dictDeferred) {
1739+ return $foreign.exportKeyImpl(f, x);
1740+ }));
1741+ });
1742+ };
1743+ };
1744+ var encrypt = "encrypt";
1745+ var deriveKey = "deriveKey";
1746+ var deriveBits = "deriveBits";
1747+ var decrypt = "decrypt";
1748+ var allUsages = [ encrypt, decrypt, sign, verify, deriveKey, deriveBits, wrapKey, unwrapKey ];
1749+ exports["allUsages"] = allUsages;
1750+ exports["exportKey"] = exportKey;
1751+ exports["raw"] = raw;
1752+})(PS);
18721753(function(exports) {
1873− "use strict";
1754+ "use strict";
18741755
18751756 exports.log = function (s) {
18761757 return function () {
@@ -1879,39 +1760,57 @@ var PS = {};
18791760 };
18801761 };
18811762})(PS["Effect.Console"] = PS["Effect.Console"] || {});
1882−(function(exports) {
1883− // Generated by purs version 0.12.0
1763+(function($PS) {
1764+ // Generated by purs version 0.13.6
18841765 "use strict";
1885− var $foreign = PS["Effect.Console"];
1886− var Data_Show = PS["Data.Show"];
1887− var Data_Unit = PS["Data.Unit"];
1888− var Effect = PS["Effect"];
1766+ $PS["Effect.Console"] = $PS["Effect.Console"] || {};
1767+ var exports = $PS["Effect.Console"];
1768+ var $foreign = $PS["Effect.Console"];
18891769 exports["log"] = $foreign.log;
1890−})(PS["Effect.Console"] = PS["Effect.Console"] || {});
1770+})(PS);
18911771(function(exports) {
1892− // Generated by purs version 0.12.0
18931772 "use strict";
1894− var Control_Applicative = PS["Control.Applicative"];
1895− var Control_Bind = PS["Control.Bind"];
1896− var Control_Semigroupoid = PS["Control.Semigroupoid"];
1897− var Crypto_Subtle_Constants_AES = PS["Crypto.Subtle.Constants.AES"];
1898− var Crypto_Subtle_Constants_EC = PS["Crypto.Subtle.Constants.EC"];
1899− var Crypto_Subtle_Constants_RSA = PS["Crypto.Subtle.Constants.RSA"];
1900− var Crypto_Subtle_Hash = PS["Crypto.Subtle.Hash"];
1901− var Crypto_Subtle_Key_Generate = PS["Crypto.Subtle.Key.Generate"];
1902− var Crypto_Subtle_Key_Types = PS["Crypto.Subtle.Key.Types"];
1903− var Data_Either = PS["Data.Either"];
1904− var Data_Unit = PS["Data.Unit"];
1905− var Effect = PS["Effect"];
1906− var Effect_Aff = PS["Effect.Aff"];
1907− var Effect_Class = PS["Effect.Class"];
1908− var Effect_Console = PS["Effect.Console"];
1909− var Effect_Exception = PS["Effect.Exception"];
1910− var Prelude = PS["Prelude"];
1911− var Unsafe_Coerce = PS["Unsafe.Coerce"];
1912− var log$prime = function ($51) {
1913− return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Console.log($51));
1773+
1774+ exports.throwException = function (e) {
1775+ return function () {
1776+ throw e;
1777+ };
19141778 };
1779+})(PS["Effect.Exception"] = PS["Effect.Exception"] || {});
1780+(function($PS) {
1781+ // Generated by purs version 0.13.6
1782+ "use strict";
1783+ $PS["Effect.Exception"] = $PS["Effect.Exception"] || {};
1784+ var exports = $PS["Effect.Exception"];
1785+ var $foreign = $PS["Effect.Exception"];
1786+ exports["throwException"] = $foreign.throwException;
1787+})(PS);
1788+(function($PS) {
1789+ // Generated by purs version 0.13.6
1790+ "use strict";
1791+ $PS["Test.Main"] = $PS["Test.Main"] || {};
1792+ var exports = $PS["Test.Main"];
1793+ var Control_Applicative = $PS["Control.Applicative"];
1794+ var Control_Bind = $PS["Control.Bind"];
1795+ var Crypto_Subtle_Constants_AES = $PS["Crypto.Subtle.Constants.AES"];
1796+ var Crypto_Subtle_Constants_EC = $PS["Crypto.Subtle.Constants.EC"];
1797+ var Crypto_Subtle_Constants_RSA = $PS["Crypto.Subtle.Constants.RSA"];
1798+ var Crypto_Subtle_Hash = $PS["Crypto.Subtle.Hash"];
1799+ var Crypto_Subtle_Key_Generate = $PS["Crypto.Subtle.Key.Generate"];
1800+ var Crypto_Subtle_Key_Types = $PS["Crypto.Subtle.Key.Types"];
1801+ var Data_Either = $PS["Data.Either"];
1802+ var Data_Unit = $PS["Data.Unit"];
1803+ var Effect = $PS["Effect"];
1804+ var Effect_Aff = $PS["Effect.Aff"];
1805+ var Effect_Class = $PS["Effect.Class"];
1806+ var Effect_Console = $PS["Effect.Console"];
1807+ var Effect_Exception = $PS["Effect.Exception"];
1808+ var log$prime = (function () {
1809+ var $31 = Effect_Class.liftEffect(Effect_Aff.monadEffectAff);
1810+ return function ($32) {
1811+ return $31(Effect_Console.log($32));
1812+ };
1813+ })();
19151814 var main = (function () {
19161815 var resolve = function (eX) {
19171816 if (eX instanceof Data_Either.Left) {
@@ -1920,24 +1819,24 @@ var PS = {};
19201819 if (eX instanceof Data_Either.Right) {
19211820 return Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit);
19221821 };
1923− throw new Error("Failed pattern match at Test.Main line 24, column 20 - line 26, column 29: " + [ eX.constructor.name ]);
1822+ throw new Error("Failed pattern match at Test.Main (line 24, column 20 - line 26, column 29): " + [ eX.constructor.name ]);
19241823 };
19251824 return Effect_Aff.runAff_(resolve)(Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime("Generating Keys..."))(function () {
19261825 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)((function () {
19271826 var genAES = function (mode) {
1928− return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.aes(mode)(Crypto_Subtle_Constants_AES.l128))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (v) {
1827+ return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.aes(mode)(Crypto_Subtle_Constants_AES.l128))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (k) {
19291828 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - 128"))(function () {
1930− return log$prime(v);
1829+ return log$prime(k);
19311830 });
19321831 }))(function () {
1933− return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.aes(mode)(Crypto_Subtle_Constants_AES.l192))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (v) {
1832+ return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.aes(mode)(Crypto_Subtle_Constants_AES.l192))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (k) {
19341833 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - 192"))(function () {
1935− return log$prime(v);
1834+ return log$prime(k);
19361835 });
19371836 }))(function () {
1938− return Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.aes(mode)(Crypto_Subtle_Constants_AES.l256))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (v) {
1837+ return Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.aes(mode)(Crypto_Subtle_Constants_AES.l256))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (k) {
19391838 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - 256"))(function () {
1940− return log$prime(v);
1839+ return log$prime(k);
19411840 });
19421841 });
19431842 });
@@ -1960,24 +1859,24 @@ var PS = {};
19601859 });
19611860 })())(function () {
19621861 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime("HMAC"))(function () {
1963− return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.hmac(Crypto_Subtle_Hash.sha1))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (v) {
1862+ return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.hmac(Crypto_Subtle_Hash.sha1))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (k) {
19641863 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - SHA-1"))(function () {
1965− return log$prime(v);
1864+ return log$prime(k);
19661865 });
19671866 }))(function () {
1968− return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.hmac(Crypto_Subtle_Hash.sha256))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (v) {
1867+ return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.hmac(Crypto_Subtle_Hash.sha256))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (k) {
19691868 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - SHA-256"))(function () {
1970− return log$prime(v);
1869+ return log$prime(k);
19711870 });
19721871 }))(function () {
1973− return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.hmac(Crypto_Subtle_Hash.sha384))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (v) {
1872+ return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.hmac(Crypto_Subtle_Hash.sha384))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (k) {
19741873 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - SHA-384"))(function () {
1975− return log$prime(v);
1874+ return log$prime(k);
19761875 });
19771876 }))(function () {
1978− return Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.hmac(Crypto_Subtle_Hash.sha512))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (v) {
1877+ return Control_Bind.bind(Effect_Aff.bindAff)(Control_Bind.bindFlipped(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw))(Crypto_Subtle_Key_Generate.generateKey(Crypto_Subtle_Key_Generate.hmac(Crypto_Subtle_Hash.sha512))(true)(Crypto_Subtle_Key_Types.allUsages)))(function (k) {
19791878 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - SHA-512"))(function () {
1980− return log$prime(v);
1879+ return log$prime(k);
19811880 });
19821881 });
19831882 });
@@ -1991,8 +1890,8 @@ var PS = {};
19911890 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - privateKey"))(function () {
19921891 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(v.privateKey))(function () {
19931892 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - publicKey"))(function () {
1994− return Control_Bind.bind(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw)(v.publicKey))(function (v1) {
1995− return log$prime(v1);
1893+ return Control_Bind.bind(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw)(v.publicKey))(function (publicKey$prime) {
1894+ return log$prime(publicKey$prime);
19961895 });
19971896 });
19981897 });
@@ -2004,8 +1903,8 @@ var PS = {};
20041903 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - privateKey"))(function () {
20051904 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(v.privateKey))(function () {
20061905 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - publicKey"))(function () {
2007− return Control_Bind.bind(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw)(v.publicKey))(function (v1) {
2008− return log$prime(v1);
1906+ return Control_Bind.bind(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw)(v.publicKey))(function (publicKey$prime) {
1907+ return log$prime(publicKey$prime);
20091908 });
20101909 });
20111910 });
@@ -2017,8 +1916,8 @@ var PS = {};
20171916 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - privateKey"))(function () {
20181917 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(v.privateKey))(function () {
20191918 return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(log$prime(" - publicKey"))(function () {
2020− return Control_Bind.bind(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw)(v.publicKey))(function (v1) {
2021− return log$prime(v1);
1919+ return Control_Bind.bind(Effect_Aff.bindAff)(Crypto_Subtle_Key_Types.exportKey(Crypto_Subtle_Key_Types.raw)(v.publicKey))(function (publicKey$prime) {
1920+ return log$prime(publicKey$prime);
20221921 });
20231922 });
20241923 });
@@ -2103,5 +2002,5 @@ var PS = {};
21032002 })();
21042003 exports["main"] = main;
21052004 exports["log'"] = log$prime;
2106−})(PS["Test.Main"] = PS["Test.Main"] || {});
2107−PS["Test.Main"].main();
2005+})(PS);
2006+PS["Test.Main"].main();
test/Main.purs+4−4
@@ -89,25 +89,25 @@ main = do
8989 log' " - privateKey"
9090 log' (unsafeCoerce privateKey)
9191 log' " - publicKey"
92− log' (unsafeCoerce publicKey')
92+ log' (unsafeCoerce publicKey)
9393 do CryptoKeyPair {privateKey,publicKey} <- generateKeyPair (rsa alg 2048 exp65537 Hash.sha256) true allUsages
9494 log' " - SHA-256"
9595 log' " - privateKey"
9696 log' (unsafeCoerce privateKey)
9797 log' " - publicKey"
98− log' (unsafeCoerce publicKey')
98+ log' (unsafeCoerce publicKey)
9999 do CryptoKeyPair {privateKey,publicKey} <- generateKeyPair (rsa alg 2048 exp65537 Hash.sha384) true allUsages
100100 log' " - SHA-384"
101101 log' " - privateKey"
102102 log' (unsafeCoerce privateKey)
103103 log' " - publicKey"
104− log' (unsafeCoerce publicKey')
104+ log' (unsafeCoerce publicKey)
105105 do CryptoKeyPair {privateKey,publicKey} <- generateKeyPair (rsa alg 2048 exp65537 Hash.sha512) true allUsages
106106 log' " - SHA-512"
107107 log' " - privateKey"
108108 log' (unsafeCoerce privateKey)
109109 log' " - publicKey"
110− log' (unsafeCoerce publicKey')
110+ log' (unsafeCoerce publicKey)
111111 log' "- RSASSA-PKCS1-v1_5"
112112 genRSA RSA.rsaPKCS1
113113 log' "- RSA-PSS"