mol_crypto_lib 0.0.218 → 0.0.222

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.
package/node.d.ts CHANGED
@@ -1,2 +1,101 @@
1
+ declare let _$_: {
2
+ new (): {};
3
+ } & typeof globalThis;
4
+ declare class $ extends _$_ {
5
+ }
6
+ declare namespace $ {
7
+ export type $ = typeof $$;
8
+ export class $$ extends $ {
9
+ }
10
+ namespace $$ {
11
+ type $$ = $;
12
+ }
13
+ export {};
14
+ }
15
+
16
+ declare namespace $ {
17
+ class $mol_crypto_secret extends Object {
18
+ readonly native: CryptoKey & {
19
+ type: 'private';
20
+ };
21
+ static size: number;
22
+ static extra: number;
23
+ constructor(native: CryptoKey & {
24
+ type: 'private';
25
+ });
26
+ static generate(): Promise<$mol_crypto_secret>;
27
+ static from(serial: DataView | ArrayBuffer): Promise<$mol_crypto_secret>;
28
+ serial(): Promise<ArrayBuffer>;
29
+ encrypt(open: DataView | ArrayBuffer, salt: Uint8Array): Promise<ArrayBuffer>;
30
+ decrypt(closed: DataView | ArrayBuffer, salt: Uint8Array): Promise<ArrayBuffer>;
31
+ }
32
+ }
33
+
34
+ declare namespace $ {
35
+ function $mol_crypto_cipher_pair(this: $): Promise<{
36
+ public: $mol_crypto_cipher_public;
37
+ private: $mol_crypto_cipher_private;
38
+ }>;
39
+ class $mol_crypto_cipher_public extends Object {
40
+ readonly native: CryptoKey & {
41
+ type: 'public';
42
+ };
43
+ static size: number;
44
+ constructor(native: CryptoKey & {
45
+ type: 'public';
46
+ });
47
+ static from(serial: DataView | ArrayBuffer): Promise<$mol_crypto_cipher_public>;
48
+ serial(): Promise<ArrayBuffer>;
49
+ encrypt(data: DataView | ArrayBuffer): Promise<ArrayBuffer>;
50
+ }
51
+ class $mol_crypto_cipher_private extends Object {
52
+ readonly native: CryptoKey & {
53
+ type: 'private';
54
+ };
55
+ constructor(native: CryptoKey & {
56
+ type: 'private';
57
+ });
58
+ static from(serial: DataView | ArrayBuffer): Promise<$mol_crypto_cipher_private>;
59
+ serial(): Promise<ArrayBuffer>;
60
+ decrypt(data: DataView | ArrayBuffer): Promise<ArrayBuffer>;
61
+ }
62
+ const $mol_crypto_cipher_ecrypted_size = 128;
63
+ }
64
+
65
+ declare namespace $ {
66
+ function $mol_crypto_auditor_pair(this: $): Promise<{
67
+ public: $mol_crypto_auditor_public;
68
+ private: $mol_crypto_auditor_private;
69
+ }>;
70
+ class $mol_crypto_auditor_public extends Object {
71
+ readonly native: CryptoKey & {
72
+ type: 'public';
73
+ };
74
+ static size: number;
75
+ constructor(native: CryptoKey & {
76
+ type: 'public';
77
+ });
78
+ static from(serial: DataView | ArrayBuffer): Promise<$mol_crypto_auditor_public>;
79
+ serial(): Promise<ArrayBuffer>;
80
+ verify(data: DataView | ArrayBuffer, sign: DataView | ArrayBuffer): Promise<boolean>;
81
+ }
82
+ class $mol_crypto_auditor_private extends Object {
83
+ readonly native: CryptoKey & {
84
+ type: 'private';
85
+ };
86
+ static size: number;
87
+ constructor(native: CryptoKey & {
88
+ type: 'private';
89
+ });
90
+ static from(serial: DataView | ArrayBuffer): Promise<$mol_crypto_auditor_private>;
91
+ serial(): Promise<ArrayBuffer>;
92
+ sign(data: DataView | ArrayBuffer): Promise<ArrayBuffer>;
93
+ }
94
+ const $mol_crypto_auditor_sign_size = 64;
95
+ }
96
+
97
+ declare namespace $ {
98
+ function $mol_crypto_salt(): Uint8Array;
99
+ }
1
100
 
2
101
  export = $;
package/node.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/crypto/README.md","mol/crypto/secret/secret.ts","mol/crypto/cipher/cipher.ts","mol/crypto/auditor/auditor.ts","mol/crypto/salt/salt.ts","mol/crypto/lib/lib.meta.tree"],"mods":{},"deps_in":{"mol/crypto":{"mol/crypto/lib":-9007199254740991,"mol/crypto/secret":-9007199254740991,"mol/crypto/cipher":-9007199254740991,"mol/crypto/auditor":-9007199254740991,"mol/crypto/salt":-9007199254740991},"mol":{"mol/crypto":-9007199254740991},"":{"mol":-9007199254740991},"mol/crypto/secret":{"mol/crypto/lib":-9000},"mol/crypto/cipher":{"mol/crypto/lib":-9000},"mol/crypto/auditor":{"mol/crypto/lib":-9000},"mol/crypto/salt":{"mol/crypto/lib":-9000}},"deps_out":{"mol/crypto/lib":{"mol/crypto":-9007199254740991,"mol/crypto/secret":-9000,"mol/crypto/cipher":-9000,"mol/crypto/auditor":-9000,"mol/crypto/salt":-9000},"mol/crypto":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/crypto/secret":{"mol/crypto":-9007199254740991},"mol/crypto/cipher":{"mol/crypto":-9007199254740991},"mol/crypto/auditor":{"mol/crypto":-9007199254740991},"mol/crypto/salt":{"mol/crypto":-9007199254740991}},"sloc":{"LICENSE":113,"md":567,"tree":35,"js":10,"ts":286,"json":84,"lock":939,"CNAME":1,"html":1},"deps":{"mol/crypto/lib":{"..":-9007199254740991,"/mol/crypto/secret":-9000,"/mol/crypto/cipher":-9000,"/mol/crypto/auditor":-9000,"/mol/crypto/salt":-9000},"mol/crypto":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/crypto/secret":{"..":-9007199254740991,"/mol/crypto/secret":-1},"mol/crypto/cipher":{"..":-9007199254740991,"/mol/crypto/cipher/pair":-1,"/mol/crypto/cipher/public":-1,"/mol/crypto/cipher/private":-1,"/mol/crypto/cipher/ecrypted/size":-1},"mol/crypto/auditor":{"..":-9007199254740991,"/mol/crypto/auditor/pair":-1,"/mol/crypto/auditor/public":-1,"/mol/crypto/auditor/private":-1,"/mol/crypto/auditor/sign/size":-1},"mol/crypto/salt":{"..":-9007199254740991,"/mol/crypto/salt":-1}}}
1
+ {"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/crypto/README.md","mol/crypto/secret/secret.ts","mol/crypto/cipher/cipher.ts","mol/crypto/auditor/auditor.ts","mol/crypto/salt/salt.ts","mol/crypto/lib/lib.meta.tree"],"mods":{},"deps_in":{"mol/crypto":{"mol/crypto/lib":-9007199254740991,"mol/crypto/secret":-9007199254740991,"mol/crypto/cipher":-9007199254740991,"mol/crypto/auditor":-9007199254740991,"mol/crypto/salt":-9007199254740991},"mol":{"mol/crypto":-9007199254740991},"":{"mol":-9007199254740991},"mol/crypto/secret":{"mol/crypto/lib":-9000},"mol/crypto/cipher":{"mol/crypto/lib":-9000},"mol/crypto/auditor":{"mol/crypto/lib":-9000},"mol/crypto/salt":{"mol/crypto/lib":-9000}},"deps_out":{"mol/crypto/lib":{"mol/crypto":-9007199254740991,"mol/crypto/secret":-9000,"mol/crypto/cipher":-9000,"mol/crypto/auditor":-9000,"mol/crypto/salt":-9000},"mol/crypto":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/crypto/secret":{"mol/crypto":-9007199254740991},"mol/crypto/cipher":{"mol/crypto":-9007199254740991},"mol/crypto/auditor":{"mol/crypto":-9007199254740991},"mol/crypto/salt":{"mol/crypto":-9007199254740991}},"sloc":{"LICENSE":113,"md":567,"tree":35,"js":10,"ts":286,"json":85,"lock":939,"CNAME":1,"html":1},"deps":{"mol/crypto/lib":{"..":-9007199254740991,"/mol/crypto/secret":-9000,"/mol/crypto/cipher":-9000,"/mol/crypto/auditor":-9000,"/mol/crypto/salt":-9000},"mol/crypto":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/crypto/secret":{"..":-9007199254740991,"/mol/crypto/secret":-1},"mol/crypto/cipher":{"..":-9007199254740991,"/mol/crypto/cipher/pair":-1,"/mol/crypto/cipher/public":-1,"/mol/crypto/cipher/private":-1,"/mol/crypto/cipher/ecrypted/size":-1},"mol/crypto/auditor":{"..":-9007199254740991,"/mol/crypto/auditor/pair":-1,"/mol/crypto/auditor/public":-1,"/mol/crypto/auditor/private":-1,"/mol/crypto/auditor/sign/size":-1},"mol/crypto/salt":{"..":-9007199254740991,"/mol/crypto/salt":-1}}}
package/node.test.js CHANGED
@@ -633,6 +633,12 @@ var $;
633
633
  $mol_assert_not($mol_compare_deep(/\x22/mig, /\x21/mig));
634
634
  $mol_assert_not($mol_compare_deep(/\x22/mig, /\x22/mg));
635
635
  },
636
+ 'Error'() {
637
+ $mol_assert_not($mol_compare_deep(new Error('xxx'), new Error('xxx')));
638
+ const fail = (message) => new Error(message);
639
+ $mol_assert_ok($mol_compare_deep(...['xxx', 'xxx'].map(msg => new Error(msg))));
640
+ $mol_assert_not($mol_compare_deep(...['xxx', 'yyy'].map(msg => new Error(msg))));
641
+ },
636
642
  'Map'() {
637
643
  $mol_assert_ok($mol_compare_deep(new Map, new Map));
638
644
  $mol_assert_ok($mol_compare_deep(new Map([[1, [2]]]), new Map([[1, [2]]])));
@@ -717,6 +723,8 @@ var $;
717
723
  result = compare_set(left, right);
718
724
  else if (left instanceof Map)
719
725
  result = compare_map(left, right);
726
+ else if (left instanceof Error)
727
+ result = left.stack === right.stack;
720
728
  else if (ArrayBuffer.isView(left))
721
729
  result = compare_buffer(left, right);
722
730
  else if (Symbol.toPrimitive in left)