@twin.org/crypto 0.0.1-next.18 → 0.0.1-next.19

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.
@@ -12,11 +12,15 @@ Create a new instance of HmacSha512.
12
12
 
13
13
  #### Parameters
14
14
 
15
- **key**: `Uint8Array`
15
+ ##### key
16
+
17
+ `Uint8Array`
16
18
 
17
19
  The key for the hmac.
18
20
 
19
- **bits**: `number` = `HmacSha512.SIZE_512`
21
+ ##### bits
22
+
23
+ `number` = `HmacSha512.SIZE_512`
20
24
 
21
25
  The number of bits.
22
26
 
@@ -66,11 +70,15 @@ Perform Sum 512 on the block.
66
70
 
67
71
  #### Parameters
68
72
 
69
- **key**: `Uint8Array`
73
+ ##### key
74
+
75
+ `Uint8Array`
70
76
 
71
77
  The key for the hmac.
72
78
 
73
- **block**: `Uint8Array`
79
+ ##### block
80
+
81
+ `Uint8Array`
74
82
 
75
83
  The block to operate on.
76
84
 
@@ -90,11 +98,15 @@ Perform Sum 384 on the block.
90
98
 
91
99
  #### Parameters
92
100
 
93
- **key**: `Uint8Array`
101
+ ##### key
102
+
103
+ `Uint8Array`
94
104
 
95
105
  The key for the hmac.
96
106
 
97
- **block**: `Uint8Array`
107
+ ##### block
108
+
109
+ `Uint8Array`
98
110
 
99
111
  The block to operate on.
100
112
 
@@ -114,11 +126,15 @@ Perform Sum 256 on the block.
114
126
 
115
127
  #### Parameters
116
128
 
117
- **key**: `Uint8Array`
129
+ ##### key
130
+
131
+ `Uint8Array`
118
132
 
119
133
  The key for the hmac.
120
134
 
121
- **block**: `Uint8Array`
135
+ ##### block
136
+
137
+ `Uint8Array`
122
138
 
123
139
  The block to operate on.
124
140
 
@@ -138,11 +154,15 @@ Perform Sum 224 on the block.
138
154
 
139
155
  #### Parameters
140
156
 
141
- **key**: `Uint8Array`
157
+ ##### key
158
+
159
+ `Uint8Array`
142
160
 
143
161
  The key for the hmac.
144
162
 
145
- **block**: `Uint8Array`
163
+ ##### block
164
+
165
+ `Uint8Array`
146
166
 
147
167
  The block to operate on.
148
168
 
@@ -162,7 +182,9 @@ Update the hash with the block.
162
182
 
163
183
  #### Parameters
164
184
 
165
- **block**: `Uint8Array`
185
+ ##### block
186
+
187
+ `Uint8Array`
166
188
 
167
189
  The block to update the hash with.
168
190
 
@@ -23,11 +23,15 @@ Generate a counter based One Time Password.
23
23
 
24
24
  #### Parameters
25
25
 
26
- **key**: `Uint8Array`
26
+ ##### key
27
+
28
+ `Uint8Array`
27
29
 
28
30
  Key for the one time password.
29
31
 
30
- **counter**: `number`
32
+ ##### counter
33
+
34
+ `number`
31
35
 
32
36
  This should be stored by the application,
33
37
  must be user specific, and be incremented for each request.
@@ -22,7 +22,9 @@ Generate a password of given length.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **length**: `number`
25
+ ##### length
26
+
27
+ `number`
26
28
 
27
29
  The length of the password to generate.
28
30
 
@@ -23,31 +23,43 @@ Test the strength of the password.
23
23
 
24
24
  #### Parameters
25
25
 
26
- **property**: `string`
26
+ ##### property
27
+
28
+ `string`
27
29
 
28
30
  The name of the property.
29
31
 
30
- **password**: `string`
32
+ ##### password
33
+
34
+ `string`
31
35
 
32
36
  The password to test.
33
37
 
34
- **failures**: `IValidationFailure`[]
38
+ ##### failures
39
+
40
+ `IValidationFailure`[]
35
41
 
36
42
  The list of failures to add to.
37
43
 
38
- **options?**
44
+ ##### options?
39
45
 
40
46
  Options to configure the testing.
41
47
 
42
- **options.minLength?**: `number`
48
+ ###### minLength
49
+
50
+ `number`
43
51
 
44
52
  The minimum length of the password, defaults to 8.
45
53
 
46
- **options.maxLength?**: `number`
54
+ ###### maxLength
55
+
56
+ `number`
47
57
 
48
58
  The minimum length of the password, defaults to 128.
49
59
 
50
- **options.minPhraseLength?**: `number`
60
+ ###### minPhraseLength
61
+
62
+ `number`
51
63
 
52
64
  The minimum length of the password for it to be considered a pass phrase.
53
65
 
@@ -22,19 +22,27 @@ Derive a key from the parameters using Sha256.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **password**: `Uint8Array`
25
+ ##### password
26
+
27
+ `Uint8Array`
26
28
 
27
29
  The password to derive the key from.
28
30
 
29
- **salt**: `Uint8Array`
31
+ ##### salt
32
+
33
+ `Uint8Array`
30
34
 
31
35
  The salt for the derivation.
32
36
 
33
- **iterations**: `number`
37
+ ##### iterations
38
+
39
+ `number`
34
40
 
35
41
  Number of iterations to perform.
36
42
 
37
- **keyLength**: `number`
43
+ ##### keyLength
44
+
45
+ `number`
38
46
 
39
47
  The length of the key to derive.
40
48
 
@@ -54,19 +62,27 @@ Derive a key from the parameters using Sha512.
54
62
 
55
63
  #### Parameters
56
64
 
57
- **password**: `Uint8Array`
65
+ ##### password
66
+
67
+ `Uint8Array`
58
68
 
59
69
  The password to derive the key from.
60
70
 
61
- **salt**: `Uint8Array`
71
+ ##### salt
72
+
73
+ `Uint8Array`
62
74
 
63
75
  The salt for the derivation.
64
76
 
65
- **iterations**: `number`
77
+ ##### iterations
78
+
79
+ `number`
66
80
 
67
81
  Number of iterations to perform.
68
82
 
69
- **keyLength**: `number`
83
+ ##### keyLength
84
+
85
+ `number`
70
86
 
71
87
  The length of the key to derive.
72
88
 
@@ -38,7 +38,9 @@ Public returns the PublicKey corresponding to private.
38
38
 
39
39
  #### Parameters
40
40
 
41
- **privateKey**: `Uint8Array`
41
+ ##### privateKey
42
+
43
+ `Uint8Array`
42
44
 
43
45
  The private key to get the corresponding public key.
44
46
 
@@ -62,11 +64,15 @@ Sign the block with privateKey and returns a signature.
62
64
 
63
65
  #### Parameters
64
66
 
65
- **privateKey**: `Uint8Array`
67
+ ##### privateKey
68
+
69
+ `Uint8Array`
66
70
 
67
71
  The private key.
68
72
 
69
- **block**: `Uint8Array`
73
+ ##### block
74
+
75
+ `Uint8Array`
70
76
 
71
77
  The block to sign.
72
78
 
@@ -90,15 +96,21 @@ Verify reports whether sig is a valid signature of block by publicKey.
90
96
 
91
97
  #### Parameters
92
98
 
93
- **publicKey**: `Uint8Array`
99
+ ##### publicKey
100
+
101
+ `Uint8Array`
94
102
 
95
103
  The public key to verify the signature.
96
104
 
97
- **block**: `Uint8Array`
105
+ ##### block
106
+
107
+ `Uint8Array`
98
108
 
99
109
  The block for the signature.
100
110
 
101
- **signature**: `Uint8Array`
111
+ ##### signature
112
+
113
+ `Uint8Array`
102
114
 
103
115
  The signature.
104
116
 
@@ -24,7 +24,9 @@ Perform Sum on the block.
24
24
 
25
25
  #### Parameters
26
26
 
27
- **block**: `Uint8Array`
27
+ ##### block
28
+
29
+ `Uint8Array`
28
30
 
29
31
  The block to operate on.
30
32
 
@@ -44,7 +46,9 @@ Update the hash with the block.
44
46
 
45
47
  #### Parameters
46
48
 
47
- **block**: `Uint8Array`
49
+ ##### block
50
+
51
+ `Uint8Array`
48
52
 
49
53
  The block to update the hash with.
50
54
 
@@ -12,7 +12,9 @@ Create a new instance of Sha256.
12
12
 
13
13
  #### Parameters
14
14
 
15
- **bits**: `number` = `Sha256.SIZE_256`
15
+ ##### bits
16
+
17
+ `number` = `Sha256.SIZE_256`
16
18
 
17
19
  The number of bits.
18
20
 
@@ -46,7 +48,9 @@ Perform Sum 256 on the block.
46
48
 
47
49
  #### Parameters
48
50
 
49
- **block**: `Uint8Array`
51
+ ##### block
52
+
53
+ `Uint8Array`
50
54
 
51
55
  The block to operate on.
52
56
 
@@ -66,7 +70,9 @@ Perform Sum 224 on the block.
66
70
 
67
71
  #### Parameters
68
72
 
69
- **block**: `Uint8Array`
73
+ ##### block
74
+
75
+ `Uint8Array`
70
76
 
71
77
  The block to operate on.
72
78
 
@@ -86,7 +92,9 @@ Update the hash with the block.
86
92
 
87
93
  #### Parameters
88
94
 
89
- **block**: `Uint8Array`
95
+ ##### block
96
+
97
+ `Uint8Array`
90
98
 
91
99
  The block to update the hash with.
92
100
 
@@ -12,7 +12,9 @@ Create a new instance of Sha3.
12
12
 
13
13
  #### Parameters
14
14
 
15
- **bits**: `number` = `Sha3.SIZE_256`
15
+ ##### bits
16
+
17
+ `number` = `Sha3.SIZE_256`
16
18
 
17
19
  The number of bits.
18
20
 
@@ -62,7 +64,9 @@ Perform Sum 256 on the block.
62
64
 
63
65
  #### Parameters
64
66
 
65
- **block**: `Uint8Array`
67
+ ##### block
68
+
69
+ `Uint8Array`
66
70
 
67
71
  The block to operate on.
68
72
 
@@ -82,7 +86,9 @@ Perform Sum 224 on the block.
82
86
 
83
87
  #### Parameters
84
88
 
85
- **block**: `Uint8Array`
89
+ ##### block
90
+
91
+ `Uint8Array`
86
92
 
87
93
  The block to operate on.
88
94
 
@@ -102,7 +108,9 @@ Perform Sum 384 on the block.
102
108
 
103
109
  #### Parameters
104
110
 
105
- **block**: `Uint8Array`
111
+ ##### block
112
+
113
+ `Uint8Array`
106
114
 
107
115
  The block to operate on.
108
116
 
@@ -122,7 +130,9 @@ Perform Sum 512 on the block.
122
130
 
123
131
  #### Parameters
124
132
 
125
- **block**: `Uint8Array`
133
+ ##### block
134
+
135
+ `Uint8Array`
126
136
 
127
137
  The block to operate on.
128
138
 
@@ -142,7 +152,9 @@ Update the hash with the block.
142
152
 
143
153
  #### Parameters
144
154
 
145
- **block**: `Uint8Array`
155
+ ##### block
156
+
157
+ `Uint8Array`
146
158
 
147
159
  The block to update the hash with.
148
160
 
@@ -12,7 +12,9 @@ Create a new instance of Sha512.
12
12
 
13
13
  #### Parameters
14
14
 
15
- **bits**: `number` = `Sha512.SIZE_512`
15
+ ##### bits
16
+
17
+ `number` = `Sha512.SIZE_512`
16
18
 
17
19
  The number of bits.
18
20
 
@@ -62,7 +64,9 @@ Perform Sum 512 on the block.
62
64
 
63
65
  #### Parameters
64
66
 
65
- **block**: `Uint8Array`
67
+ ##### block
68
+
69
+ `Uint8Array`
66
70
 
67
71
  The block to operate on.
68
72
 
@@ -82,7 +86,9 @@ Perform Sum 384 on the block.
82
86
 
83
87
  #### Parameters
84
88
 
85
- **block**: `Uint8Array`
89
+ ##### block
90
+
91
+ `Uint8Array`
86
92
 
87
93
  The block to operate on.
88
94
 
@@ -102,7 +108,9 @@ Perform Sum 256 on the block.
102
108
 
103
109
  #### Parameters
104
110
 
105
- **block**: `Uint8Array`
111
+ ##### block
112
+
113
+ `Uint8Array`
106
114
 
107
115
  The block to operate on.
108
116
 
@@ -122,7 +130,9 @@ Perform Sum 224 on the block.
122
130
 
123
131
  #### Parameters
124
132
 
125
- **block**: `Uint8Array`
133
+ ##### block
134
+
135
+ `Uint8Array`
126
136
 
127
137
  The block to operate on.
128
138
 
@@ -142,7 +152,9 @@ Update the hash with the block.
142
152
 
143
153
  #### Parameters
144
154
 
145
- **block**: `Uint8Array`
155
+ ##### block
156
+
157
+ `Uint8Array`
146
158
 
147
159
  The block to update the hash with.
148
160
 
@@ -23,11 +23,15 @@ Get the master key from the seed.
23
23
 
24
24
  #### Parameters
25
25
 
26
- **seed**: `Uint8Array`
26
+ ##### seed
27
+
28
+ `Uint8Array`
27
29
 
28
30
  The seed to generate the master key from.
29
31
 
30
- **keyType**: [`KeyType`](../type-aliases/KeyType.md) = `KeyType.Ed25519`
32
+ ##### keyType
33
+
34
+ [`KeyType`](../type-aliases/KeyType.md) = `KeyType.Ed25519`
31
35
 
32
36
  The key type.
33
37
 
@@ -59,15 +63,21 @@ Derive a key from the path.
59
63
 
60
64
  #### Parameters
61
65
 
62
- **seed**: `Uint8Array`
66
+ ##### seed
67
+
68
+ `Uint8Array`
63
69
 
64
70
  The seed.
65
71
 
66
- **path**: [`Bip32Path`](Bip32Path.md)
72
+ ##### path
73
+
74
+ [`Bip32Path`](Bip32Path.md)
67
75
 
68
76
  The path.
69
77
 
70
- **keyType**: [`KeyType`](../type-aliases/KeyType.md) = `KeyType.Ed25519`
78
+ ##### keyType
79
+
80
+ [`KeyType`](../type-aliases/KeyType.md) = `KeyType.Ed25519`
71
81
 
72
82
  The key type.
73
83
 
@@ -95,15 +105,21 @@ Get the public key from the private key.
95
105
 
96
106
  #### Parameters
97
107
 
98
- **privateKey**: `Uint8Array`
108
+ ##### privateKey
109
+
110
+ `Uint8Array`
99
111
 
100
112
  The private key.
101
113
 
102
- **keyType**: [`KeyType`](../type-aliases/KeyType.md) = `KeyType.Ed25519`
114
+ ##### keyType
115
+
116
+ [`KeyType`](../type-aliases/KeyType.md) = `KeyType.Ed25519`
103
117
 
104
118
  The key type.
105
119
 
106
- **withZeroByte**: `boolean` = `true`
120
+ ##### withZeroByte
121
+
122
+ `boolean` = `true`
107
123
 
108
124
  Include a zero bute prefix.
109
125
 
@@ -23,15 +23,21 @@ Generate a time based One Time Password.
23
23
 
24
24
  #### Parameters
25
25
 
26
- **key**: `Uint8Array`
26
+ ##### key
27
+
28
+ `Uint8Array`
27
29
 
28
30
  Key for the one time password.
29
31
 
30
- **interval**: `number` = `30`
32
+ ##### interval
33
+
34
+ `number` = `30`
31
35
 
32
36
  The time step of the counter.
33
37
 
34
- **timestamp**: `number` = `...`
38
+ ##### timestamp
39
+
40
+ `number` = `...`
35
41
 
36
42
  The timestamp.
37
43
 
@@ -51,24 +57,34 @@ Check a One Time Password based on a timer.
51
57
 
52
58
  #### Parameters
53
59
 
54
- **token**: `string`
60
+ ##### token
61
+
62
+ `string`
55
63
 
56
64
  Passcode to validate.
57
65
 
58
- **key**: `Uint8Array`
66
+ ##### key
67
+
68
+ `Uint8Array`
59
69
 
60
70
  Key for the one time password. This should be unique and secret for
61
71
  every user as it is the seed used to calculate the HMAC.
62
72
 
63
- **window**: `number` = `2`
73
+ ##### window
74
+
75
+ `number` = `2`
64
76
 
65
77
  The allowable margin for the counter.
66
78
 
67
- **interval**: `number` = `30`
79
+ ##### interval
80
+
81
+ `number` = `30`
68
82
 
69
83
  The time step of the counter.
70
84
 
71
- **timestamp**: `number` = `...`
85
+ ##### timestamp
86
+
87
+ `number` = `...`
72
88
 
73
89
  The timestamp now.
74
90
 
@@ -88,7 +104,9 @@ Generate a secret.
88
104
 
89
105
  #### Parameters
90
106
 
91
- **length**: `number`
107
+ ##### length
108
+
109
+ `number`
92
110
 
93
111
  The length of the secret to generate.
94
112
 
@@ -108,7 +126,9 @@ Convert the secret back to bytes.
108
126
 
109
127
  #### Parameters
110
128
 
111
- **secretBase32**: `string`
129
+ ##### secretBase32
130
+
131
+ `string`
112
132
 
113
133
  The secret encoded as base32.
114
134
 
@@ -129,15 +149,21 @@ See https://github.com/google/google-authenticator/wiki/Key-Uri-Format .
129
149
 
130
150
  #### Parameters
131
151
 
132
- **issuer**: `string`
152
+ ##### issuer
153
+
154
+ `string`
133
155
 
134
156
  The issuer of the totp.
135
157
 
136
- **label**: `string`
158
+ ##### label
159
+
160
+ `string`
137
161
 
138
162
  The label that will show in auth apps.
139
163
 
140
- **secretBase32**: `string`
164
+ ##### secretBase32
165
+
166
+ `string`
141
167
 
142
168
  The secret as base 32.
143
169
 
@@ -22,7 +22,9 @@ Convert Ed25519 private key to X25519 private key.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **ed25519PrivateKey**: `Uint8Array`
25
+ ##### ed25519PrivateKey
26
+
27
+ `Uint8Array`
26
28
 
27
29
  The ed25519 private key to convert.
28
30
 
@@ -42,7 +44,9 @@ Convert Ed25519 public key to X25519 public key.
42
44
 
43
45
  #### Parameters
44
46
 
45
- **ed25519PublicKey**: `Uint8Array`
47
+ ##### ed25519PublicKey
48
+
49
+ `Uint8Array`
46
50
 
47
51
  The ed25519 public key to convert.
48
52