@twin.org/crypto 0.0.2-next.20 → 0.0.2-next.22
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/dist/cjs/index.cjs +124 -143
- package/dist/esm/index.mjs +124 -143
- package/dist/types/address/bech32.d.ts +4 -0
- package/dist/types/address/bip44.d.ts +4 -0
- package/dist/types/ciphers/chaCha20Poly1305.d.ts +4 -0
- package/dist/types/curves/ed25519.d.ts +4 -0
- package/dist/types/curves/secp256k1.d.ts +4 -0
- package/dist/types/curves/x25519.d.ts +4 -0
- package/dist/types/curves/zip215.d.ts +4 -0
- package/dist/types/hashes/blake2b.d.ts +4 -0
- package/dist/types/hashes/blake3.d.ts +4 -0
- package/dist/types/hashes/hmacSha1.d.ts +4 -0
- package/dist/types/hashes/hmacSha256.d.ts +4 -0
- package/dist/types/hashes/hmacSha512.d.ts +4 -0
- package/dist/types/hashes/pbkdf2.d.ts +4 -0
- package/dist/types/hashes/sha1.d.ts +4 -0
- package/dist/types/hashes/sha256.d.ts +4 -0
- package/dist/types/hashes/sha3.d.ts +4 -0
- package/dist/types/hashes/sha512.d.ts +4 -0
- package/dist/types/helpers/pemHelper.d.ts +4 -0
- package/dist/types/keys/bip39.d.ts +4 -0
- package/dist/types/keys/slip0010.d.ts +4 -0
- package/dist/types/otp/hotp.d.ts +4 -0
- package/docs/changelog.md +38 -0
- package/docs/reference/classes/Bech32.md +8 -0
- package/docs/reference/classes/Bip39.md +8 -0
- package/docs/reference/classes/Bip44.md +8 -0
- package/docs/reference/classes/Blake2b.md +8 -0
- package/docs/reference/classes/Blake3.md +8 -0
- package/docs/reference/classes/ChaCha20Poly1305.md +8 -0
- package/docs/reference/classes/Ed25519.md +8 -0
- package/docs/reference/classes/HmacSha1.md +8 -0
- package/docs/reference/classes/HmacSha256.md +8 -0
- package/docs/reference/classes/HmacSha512.md +8 -0
- package/docs/reference/classes/Hotp.md +8 -0
- package/docs/reference/classes/Pbkdf2.md +8 -0
- package/docs/reference/classes/PemHelper.md +8 -0
- package/docs/reference/classes/Secp256k1.md +8 -0
- package/docs/reference/classes/Sha1.md +8 -0
- package/docs/reference/classes/Sha256.md +8 -0
- package/docs/reference/classes/Sha3.md +8 -0
- package/docs/reference/classes/Sha512.md +8 -0
- package/docs/reference/classes/Slip0010.md +8 -0
- package/docs/reference/classes/X25519.md +8 -0
- package/docs/reference/classes/Zip215.md +8 -0
- package/locales/en.json +9 -28
- package/package.json +10 -6
|
@@ -4,6 +4,10 @@ import { KeyType } from "../models/keyType";
|
|
|
4
4
|
* Implementation of Bip44 for address generation.
|
|
5
5
|
*/
|
|
6
6
|
export declare class Bip44 {
|
|
7
|
+
/**
|
|
8
|
+
* Runtime name for the class.
|
|
9
|
+
*/
|
|
10
|
+
static readonly CLASS_NAME: string;
|
|
7
11
|
/**
|
|
8
12
|
* Generate a bip44 key pair from the seed and parts.
|
|
9
13
|
* @param seed The account seed.
|
|
@@ -10,6 +10,10 @@ export declare class Ed25519 {
|
|
|
10
10
|
* Public Key Size is the size, in bytes, of public keys as used in this package.
|
|
11
11
|
*/
|
|
12
12
|
static PUBLIC_KEY_SIZE: number;
|
|
13
|
+
/**
|
|
14
|
+
* Runtime name for the class.
|
|
15
|
+
*/
|
|
16
|
+
static readonly CLASS_NAME: string;
|
|
13
17
|
/**
|
|
14
18
|
* Public returns the PublicKey corresponding to private.
|
|
15
19
|
* @param privateKey The private key to get the corresponding public key.
|
|
@@ -10,6 +10,10 @@ export declare class Secp256k1 {
|
|
|
10
10
|
* Public Key Size is the size, in bytes, of public keys as used in this package.
|
|
11
11
|
*/
|
|
12
12
|
static PUBLIC_KEY_SIZE: number;
|
|
13
|
+
/**
|
|
14
|
+
* Runtime name for the class.
|
|
15
|
+
*/
|
|
16
|
+
static readonly CLASS_NAME: string;
|
|
13
17
|
/**
|
|
14
18
|
* Public returns the PublicKey corresponding to private.
|
|
15
19
|
* @param privateKey The private key to get the corresponding public key.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Implementation of X25519.
|
|
3
3
|
*/
|
|
4
4
|
export declare class X25519 {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Convert Ed25519 private key to X25519 private key.
|
|
7
11
|
* @param ed25519PrivateKey The ed25519 private key to convert.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Implementation of Zip215.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Zip215 {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Verify reports whether sig is a valid signature of block by
|
|
7
11
|
* publicKey, using precisely-specified validation criteria (ZIP 215) suitable
|
|
@@ -14,6 +14,10 @@ export declare class Blake2b {
|
|
|
14
14
|
* Blake2b 512.
|
|
15
15
|
*/
|
|
16
16
|
static SIZE_512: number;
|
|
17
|
+
/**
|
|
18
|
+
* Runtime name for the class.
|
|
19
|
+
*/
|
|
20
|
+
static readonly CLASS_NAME: string;
|
|
17
21
|
/**
|
|
18
22
|
* Create a new instance of Blake2b.
|
|
19
23
|
* @param outputLength The output length.
|
|
@@ -10,6 +10,10 @@ export declare class HmacSha256 {
|
|
|
10
10
|
* Sha256 224.
|
|
11
11
|
*/
|
|
12
12
|
static readonly SIZE_224: number;
|
|
13
|
+
/**
|
|
14
|
+
* Runtime name for the class.
|
|
15
|
+
*/
|
|
16
|
+
static readonly CLASS_NAME: string;
|
|
13
17
|
/**
|
|
14
18
|
* Create a new instance of HmacSha256.
|
|
15
19
|
* @param key The key for the hmac.
|
|
@@ -18,6 +18,10 @@ export declare class HmacSha512 {
|
|
|
18
18
|
* Sha512 512.
|
|
19
19
|
*/
|
|
20
20
|
static SIZE_512: number;
|
|
21
|
+
/**
|
|
22
|
+
* Runtime name for the class.
|
|
23
|
+
*/
|
|
24
|
+
static readonly CLASS_NAME: string;
|
|
21
25
|
/**
|
|
22
26
|
* Create a new instance of HmacSha512.
|
|
23
27
|
* @param key The key for the hmac.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Implementation of the password based key derivation function 2.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Pbkdf2 {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Derive a key from the parameters using Sha256.
|
|
7
11
|
* @param password The password to derive the key from.
|
|
@@ -10,6 +10,10 @@ export declare class Sha256 {
|
|
|
10
10
|
* Sha256 224.
|
|
11
11
|
*/
|
|
12
12
|
static readonly SIZE_224: number;
|
|
13
|
+
/**
|
|
14
|
+
* Runtime name for the class.
|
|
15
|
+
*/
|
|
16
|
+
static readonly CLASS_NAME: string;
|
|
13
17
|
/**
|
|
14
18
|
* Create a new instance of Sha256.
|
|
15
19
|
* @param bits The number of bits.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Helper class for working with PEM (Privacy-Enhanced Mail) formatted data.
|
|
3
3
|
*/
|
|
4
4
|
export declare class PemHelper {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Strip the PEM content of its headers, footers, and newlines.
|
|
7
11
|
* @param pemContent The PEM content to strip.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Implementation of Bip39 for mnemonic generation.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Bip39 {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Generate a random mnemonic.
|
|
7
11
|
* @param strength The strength of the mnemonic to generate, defaults to 256.
|
|
@@ -5,6 +5,10 @@ import { KeyType } from "../models/keyType";
|
|
|
5
5
|
* https://github.com/satoshilabs/slips/blob/master/slip-0010.md.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Slip0010 {
|
|
8
|
+
/**
|
|
9
|
+
* Runtime name for the class.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
8
12
|
/**
|
|
9
13
|
* Get the master key from the seed.
|
|
10
14
|
* @param seed The seed to generate the master key from.
|
package/dist/types/otp/hotp.d.ts
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* Implementation of https://datatracker.ietf.org/doc/html/rfc4226 .
|
|
4
4
|
*/
|
|
5
5
|
export declare class Hotp {
|
|
6
|
+
/**
|
|
7
|
+
* Runtime name for the class.
|
|
8
|
+
*/
|
|
9
|
+
static readonly CLASS_NAME: string;
|
|
6
10
|
/**
|
|
7
11
|
* Generate a counter based One Time Password.
|
|
8
12
|
* @param key Key for the one time password.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @twin.org/crypto - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.22](https://github.com/twinfoundation/framework/compare/crypto-v0.0.2-next.21...crypto-v0.0.2-next.22) (2025-10-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **crypto:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/core bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
16
|
+
* @twin.org/nameof bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
17
|
+
* devDependencies
|
|
18
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
19
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
20
|
+
* @twin.org/validate-locales bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
21
|
+
|
|
22
|
+
## [0.0.2-next.21](https://github.com/twinfoundation/framework/compare/crypto-v0.0.2-next.20...crypto-v0.0.2-next.21) (2025-10-09)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
|
|
32
|
+
* The following workspace dependencies were updated
|
|
33
|
+
* dependencies
|
|
34
|
+
* @twin.org/core bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
35
|
+
* @twin.org/nameof bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
36
|
+
* devDependencies
|
|
37
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
38
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
39
|
+
* @twin.org/validate-locales bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
40
|
+
|
|
3
41
|
## [0.0.2-next.20](https://github.com/twinfoundation/framework/compare/crypto-v0.0.2-next.19...crypto-v0.0.2-next.20) (2025-10-02)
|
|
4
42
|
|
|
5
43
|
|
|
@@ -28,6 +28,14 @@ Private Key Size is the size, in bytes, of private keys as used in this package.
|
|
|
28
28
|
|
|
29
29
|
Public Key Size is the size, in bytes, of public keys as used in this package.
|
|
30
30
|
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### CLASS\_NAME
|
|
34
|
+
|
|
35
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
36
|
+
|
|
37
|
+
Runtime name for the class.
|
|
38
|
+
|
|
31
39
|
## Methods
|
|
32
40
|
|
|
33
41
|
### publicKeyFromPrivateKey()
|
|
@@ -12,6 +12,14 @@ Helper class for working with PEM (Privacy-Enhanced Mail) formatted data.
|
|
|
12
12
|
|
|
13
13
|
`PemHelper`
|
|
14
14
|
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### CLASS\_NAME
|
|
18
|
+
|
|
19
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
|
+
|
|
21
|
+
Runtime name for the class.
|
|
22
|
+
|
|
15
23
|
## Methods
|
|
16
24
|
|
|
17
25
|
### stripPemMarkers()
|
|
@@ -28,6 +28,14 @@ Private Key Size is the size, in bytes, of private keys as used in this package.
|
|
|
28
28
|
|
|
29
29
|
Public Key Size is the size, in bytes, of public keys as used in this package.
|
|
30
30
|
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### CLASS\_NAME
|
|
34
|
+
|
|
35
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
36
|
+
|
|
37
|
+
Runtime name for the class.
|
|
38
|
+
|
|
31
39
|
## Methods
|
|
32
40
|
|
|
33
41
|
### publicKeyFromPrivateKey()
|
|
@@ -13,6 +13,14 @@ https://github.com/satoshilabs/slips/blob/master/slip-0010.md.
|
|
|
13
13
|
|
|
14
14
|
`Slip0010`
|
|
15
15
|
|
|
16
|
+
## Properties
|
|
17
|
+
|
|
18
|
+
### CLASS\_NAME
|
|
19
|
+
|
|
20
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
21
|
+
|
|
22
|
+
Runtime name for the class.
|
|
23
|
+
|
|
16
24
|
## Methods
|
|
17
25
|
|
|
18
26
|
### getMasterKeyFromSeed()
|