@reallyme/crypto 0.3.9 → 0.3.11
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/README.md +10 -11
- package/dist/aead.js +1 -1
- package/dist/aesKw.js +1 -1
- package/dist/algorithms.js +1 -1
- package/dist/argon2id.js +1 -1
- package/dist/bip340Schnorr.js +1 -1
- package/dist/cryptoFacade.d.ts +60 -81
- package/dist/cryptoFacade.js +12 -408
- package/dist/cryptoFacadeAsymmetric.d.ts +20 -0
- package/dist/cryptoFacadeAsymmetric.js +252 -0
- package/dist/cryptoFacadeSymmetric.d.ts +27 -0
- package/dist/cryptoFacadeSymmetric.js +166 -0
- package/dist/digest.js +1 -1
- package/dist/ed25519.d.ts +2 -0
- package/dist/ed25519.js +45 -4
- package/dist/encodeEcdsaDer.js +1 -1
- package/dist/errors.js +1 -1
- package/dist/hkdf.js +1 -1
- package/dist/hmac.d.ts +3 -3
- package/dist/hmac.js +8 -5
- package/dist/hpke.d.ts +1 -1
- package/dist/hpke.js +4 -2
- package/dist/index.js +1 -1
- package/dist/jwaConcatKdf.js +1 -1
- package/dist/jwk.js +46 -11
- package/dist/kmac.js +1 -1
- package/dist/memory.js +1 -1
- package/dist/mlDsa.js +1 -1
- package/dist/mlKem.js +1 -1
- package/dist/operationResponse.js +1 -1
- package/dist/p256Ecdh.js +1 -1
- package/dist/p256Ecdsa.js +1 -1
- package/dist/p384Ecdh.js +1 -1
- package/dist/p384Ecdsa.js +1 -1
- package/dist/p521Ecdh.js +1 -1
- package/dist/p521Ecdsa.js +1 -1
- package/dist/pbkdf2.js +12 -4
- package/dist/proto/generated/reallyme/crypto/v1/crypto_pb.js +1 -1
- package/dist/proto.d.ts +8 -117
- package/dist/proto.js +6 -1085
- package/dist/protoAlgorithms.d.ts +21 -0
- package/dist/protoAlgorithms.js +323 -0
- package/dist/protoErrors.d.ts +27 -0
- package/dist/protoErrors.js +275 -0
- package/dist/protoIdentifiers.d.ts +14 -0
- package/dist/protoIdentifiers.js +112 -0
- package/dist/protoJwk.d.ts +10 -0
- package/dist/protoJwk.js +204 -0
- package/dist/protoValues.d.ts +63 -0
- package/dist/protoValues.js +228 -0
- package/dist/providerCatalog.js +1 -1
- package/dist/rsa.js +1 -1
- package/dist/secp256k1.js +1 -1
- package/dist/slhDsa.js +1 -1
- package/dist/validateBytes.js +1 -1
- package/dist/verifyBundledWasmModule.d.ts +63 -0
- package/dist/verifyBundledWasmModule.js +80 -0
- package/dist/wasm/reallyme_crypto_wasm.d.ts +383 -0
- package/dist/wasm/reallyme_crypto_wasm.js +8 -8
- package/dist/wasm/reallyme_crypto_wasm_bg.wasm +0 -0
- package/dist/wasmModuleTypes.js +1 -1
- package/dist/wasmProvider.d.ts +5 -0
- package/dist/wasmProvider.js +61 -3
- package/dist/x25519.js +1 -1
- package/dist/xWing.js +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { processOperationResponse, processOperationResponseJson, aes128GcmSeal, aes128GcmOpen, aes192GcmSeal, aes192GcmOpen, aes256GcmSeal, aes256GcmOpen, aes256GcmSivSeal, aes256GcmSivOpen, chacha20Poly1305Seal, chacha20Poly1305Open, xchacha20Poly1305Seal, xchacha20Poly1305Open, aes128KwWrapKey, aes128KwUnwrapKey, aes192KwWrapKey, aes192KwUnwrapKey, aes256KwWrapKey, aes256KwUnwrapKey, argon2idDeriveKey, kmac256Derive, hpkeSealBase, hpkeOpenBase, mlDsa44GenerateKeypair, mlDsa44DeriveKeypair, mlDsa44Sign, mlDsa44Verify, mlDsa65GenerateKeypair, mlDsa65DeriveKeypair, mlDsa65Sign, mlDsa65Verify, mlDsa87GenerateKeypair, mlDsa87DeriveKeypair, mlDsa87Sign, mlDsa87Verify, mlKem512GenerateKeypair, mlKem512DeriveKeypair, mlKem512Encapsulate, mlKem512Decapsulate, mlKem768GenerateKeypair, mlKem768DeriveKeypair, mlKem768Encapsulate, mlKem768Decapsulate, mlKem1024GenerateKeypair, mlKem1024DeriveKeypair, mlKem1024Encapsulate, mlKem1024Decapsulate, slhDsaSha2128sGenerateKeypair, slhDsaSha2128sDeriveKeypair, slhDsaSha2128sSign, slhDsaSha2128sVerify, rsaVerifyPkcs1v15, rsaVerifyPss, xWing768GenerateKeypair, xWing768DeriveKeypair, xWing768Encapsulate, xWing768Decapsulate } from "../dist/wasm/reallyme_crypto_wasm.js";
|
|
2
|
+
export declare const bundledWasmFunctions: Readonly<{
|
|
3
|
+
processOperationResponse: typeof processOperationResponse;
|
|
4
|
+
processOperationResponseJson: typeof processOperationResponseJson;
|
|
5
|
+
aes128GcmSeal: typeof aes128GcmSeal;
|
|
6
|
+
aes128GcmOpen: typeof aes128GcmOpen;
|
|
7
|
+
aes192GcmSeal: typeof aes192GcmSeal;
|
|
8
|
+
aes192GcmOpen: typeof aes192GcmOpen;
|
|
9
|
+
aes256GcmSeal: typeof aes256GcmSeal;
|
|
10
|
+
aes256GcmOpen: typeof aes256GcmOpen;
|
|
11
|
+
aes256GcmSivSeal: typeof aes256GcmSivSeal;
|
|
12
|
+
aes256GcmSivOpen: typeof aes256GcmSivOpen;
|
|
13
|
+
chacha20Poly1305Seal: typeof chacha20Poly1305Seal;
|
|
14
|
+
chacha20Poly1305Open: typeof chacha20Poly1305Open;
|
|
15
|
+
xchacha20Poly1305Seal: typeof xchacha20Poly1305Seal;
|
|
16
|
+
xchacha20Poly1305Open: typeof xchacha20Poly1305Open;
|
|
17
|
+
aes128KwWrapKey: typeof aes128KwWrapKey;
|
|
18
|
+
aes128KwUnwrapKey: typeof aes128KwUnwrapKey;
|
|
19
|
+
aes192KwWrapKey: typeof aes192KwWrapKey;
|
|
20
|
+
aes192KwUnwrapKey: typeof aes192KwUnwrapKey;
|
|
21
|
+
aes256KwWrapKey: typeof aes256KwWrapKey;
|
|
22
|
+
aes256KwUnwrapKey: typeof aes256KwUnwrapKey;
|
|
23
|
+
argon2idDeriveKey: typeof argon2idDeriveKey;
|
|
24
|
+
kmac256Derive: typeof kmac256Derive;
|
|
25
|
+
hpkeSealBase: typeof hpkeSealBase;
|
|
26
|
+
hpkeOpenBase: typeof hpkeOpenBase;
|
|
27
|
+
mlDsa44GenerateKeypair: typeof mlDsa44GenerateKeypair;
|
|
28
|
+
mlDsa44DeriveKeypair: typeof mlDsa44DeriveKeypair;
|
|
29
|
+
mlDsa44Sign: typeof mlDsa44Sign;
|
|
30
|
+
mlDsa44Verify: typeof mlDsa44Verify;
|
|
31
|
+
mlDsa65GenerateKeypair: typeof mlDsa65GenerateKeypair;
|
|
32
|
+
mlDsa65DeriveKeypair: typeof mlDsa65DeriveKeypair;
|
|
33
|
+
mlDsa65Sign: typeof mlDsa65Sign;
|
|
34
|
+
mlDsa65Verify: typeof mlDsa65Verify;
|
|
35
|
+
mlDsa87GenerateKeypair: typeof mlDsa87GenerateKeypair;
|
|
36
|
+
mlDsa87DeriveKeypair: typeof mlDsa87DeriveKeypair;
|
|
37
|
+
mlDsa87Sign: typeof mlDsa87Sign;
|
|
38
|
+
mlDsa87Verify: typeof mlDsa87Verify;
|
|
39
|
+
mlKem512GenerateKeypair: typeof mlKem512GenerateKeypair;
|
|
40
|
+
mlKem512DeriveKeypair: typeof mlKem512DeriveKeypair;
|
|
41
|
+
mlKem512Encapsulate: typeof mlKem512Encapsulate;
|
|
42
|
+
mlKem512Decapsulate: typeof mlKem512Decapsulate;
|
|
43
|
+
mlKem768GenerateKeypair: typeof mlKem768GenerateKeypair;
|
|
44
|
+
mlKem768DeriveKeypair: typeof mlKem768DeriveKeypair;
|
|
45
|
+
mlKem768Encapsulate: typeof mlKem768Encapsulate;
|
|
46
|
+
mlKem768Decapsulate: typeof mlKem768Decapsulate;
|
|
47
|
+
mlKem1024GenerateKeypair: typeof mlKem1024GenerateKeypair;
|
|
48
|
+
mlKem1024DeriveKeypair: typeof mlKem1024DeriveKeypair;
|
|
49
|
+
mlKem1024Encapsulate: typeof mlKem1024Encapsulate;
|
|
50
|
+
mlKem1024Decapsulate: typeof mlKem1024Decapsulate;
|
|
51
|
+
slhDsaSha2128sGenerateKeypair: typeof slhDsaSha2128sGenerateKeypair;
|
|
52
|
+
slhDsaSha2128sDeriveKeypair: typeof slhDsaSha2128sDeriveKeypair;
|
|
53
|
+
slhDsaSha2128sSign: typeof slhDsaSha2128sSign;
|
|
54
|
+
slhDsaSha2128sVerify: typeof slhDsaSha2128sVerify;
|
|
55
|
+
rsaVerifyPkcs1v15: typeof rsaVerifyPkcs1v15;
|
|
56
|
+
rsaVerifyPss: typeof rsaVerifyPss;
|
|
57
|
+
xWing768GenerateKeypair: typeof xWing768GenerateKeypair;
|
|
58
|
+
xWing768DeriveKeypair: typeof xWing768DeriveKeypair;
|
|
59
|
+
xWing768Encapsulate: typeof xWing768Encapsulate;
|
|
60
|
+
xWing768Decapsulate: typeof xWing768Decapsulate;
|
|
61
|
+
}>;
|
|
62
|
+
/** Reject any replacement of the package-owned WASM callables before global installation. */
|
|
63
|
+
export declare const verifyBundledWasmModule: (module: object) => boolean;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 ReallyMe LLC
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
import { processOperationResponse, processOperationResponseJson, aes128GcmSeal, aes128GcmOpen, aes192GcmSeal, aes192GcmOpen, aes256GcmSeal, aes256GcmOpen, aes256GcmSivSeal, aes256GcmSivOpen, chacha20Poly1305Seal, chacha20Poly1305Open, xchacha20Poly1305Seal, xchacha20Poly1305Open, aes128KwWrapKey, aes128KwUnwrapKey, aes192KwWrapKey, aes192KwUnwrapKey, aes256KwWrapKey, aes256KwUnwrapKey, argon2idDeriveKey, kmac256Derive, hpkeSealBase, hpkeOpenBase, mlDsa44GenerateKeypair, mlDsa44DeriveKeypair, mlDsa44Sign, mlDsa44Verify, mlDsa65GenerateKeypair, mlDsa65DeriveKeypair, mlDsa65Sign, mlDsa65Verify, mlDsa87GenerateKeypair, mlDsa87DeriveKeypair, mlDsa87Sign, mlDsa87Verify, mlKem512GenerateKeypair, mlKem512DeriveKeypair, mlKem512Encapsulate, mlKem512Decapsulate, mlKem768GenerateKeypair, mlKem768DeriveKeypair, mlKem768Encapsulate, mlKem768Decapsulate, mlKem1024GenerateKeypair, mlKem1024DeriveKeypair, mlKem1024Encapsulate, mlKem1024Decapsulate, slhDsaSha2128sGenerateKeypair, slhDsaSha2128sDeriveKeypair, slhDsaSha2128sSign, slhDsaSha2128sVerify, rsaVerifyPkcs1v15, rsaVerifyPss, xWing768GenerateKeypair, xWing768DeriveKeypair, xWing768Encapsulate, xWing768Decapsulate, } from "../dist/wasm/reallyme_crypto_wasm.js";
|
|
5
|
+
export const bundledWasmFunctions = Object.freeze({
|
|
6
|
+
processOperationResponse,
|
|
7
|
+
processOperationResponseJson,
|
|
8
|
+
aes128GcmSeal,
|
|
9
|
+
aes128GcmOpen,
|
|
10
|
+
aes192GcmSeal,
|
|
11
|
+
aes192GcmOpen,
|
|
12
|
+
aes256GcmSeal,
|
|
13
|
+
aes256GcmOpen,
|
|
14
|
+
aes256GcmSivSeal,
|
|
15
|
+
aes256GcmSivOpen,
|
|
16
|
+
chacha20Poly1305Seal,
|
|
17
|
+
chacha20Poly1305Open,
|
|
18
|
+
xchacha20Poly1305Seal,
|
|
19
|
+
xchacha20Poly1305Open,
|
|
20
|
+
aes128KwWrapKey,
|
|
21
|
+
aes128KwUnwrapKey,
|
|
22
|
+
aes192KwWrapKey,
|
|
23
|
+
aes192KwUnwrapKey,
|
|
24
|
+
aes256KwWrapKey,
|
|
25
|
+
aes256KwUnwrapKey,
|
|
26
|
+
argon2idDeriveKey,
|
|
27
|
+
kmac256Derive,
|
|
28
|
+
hpkeSealBase,
|
|
29
|
+
hpkeOpenBase,
|
|
30
|
+
mlDsa44GenerateKeypair,
|
|
31
|
+
mlDsa44DeriveKeypair,
|
|
32
|
+
mlDsa44Sign,
|
|
33
|
+
mlDsa44Verify,
|
|
34
|
+
mlDsa65GenerateKeypair,
|
|
35
|
+
mlDsa65DeriveKeypair,
|
|
36
|
+
mlDsa65Sign,
|
|
37
|
+
mlDsa65Verify,
|
|
38
|
+
mlDsa87GenerateKeypair,
|
|
39
|
+
mlDsa87DeriveKeypair,
|
|
40
|
+
mlDsa87Sign,
|
|
41
|
+
mlDsa87Verify,
|
|
42
|
+
mlKem512GenerateKeypair,
|
|
43
|
+
mlKem512DeriveKeypair,
|
|
44
|
+
mlKem512Encapsulate,
|
|
45
|
+
mlKem512Decapsulate,
|
|
46
|
+
mlKem768GenerateKeypair,
|
|
47
|
+
mlKem768DeriveKeypair,
|
|
48
|
+
mlKem768Encapsulate,
|
|
49
|
+
mlKem768Decapsulate,
|
|
50
|
+
mlKem1024GenerateKeypair,
|
|
51
|
+
mlKem1024DeriveKeypair,
|
|
52
|
+
mlKem1024Encapsulate,
|
|
53
|
+
mlKem1024Decapsulate,
|
|
54
|
+
slhDsaSha2128sGenerateKeypair,
|
|
55
|
+
slhDsaSha2128sDeriveKeypair,
|
|
56
|
+
slhDsaSha2128sSign,
|
|
57
|
+
slhDsaSha2128sVerify,
|
|
58
|
+
rsaVerifyPkcs1v15,
|
|
59
|
+
rsaVerifyPss,
|
|
60
|
+
xWing768GenerateKeypair,
|
|
61
|
+
xWing768DeriveKeypair,
|
|
62
|
+
xWing768Encapsulate,
|
|
63
|
+
xWing768Decapsulate,
|
|
64
|
+
});
|
|
65
|
+
/** Reject any replacement of the package-owned WASM callables before global installation. */
|
|
66
|
+
export const verifyBundledWasmModule = (module) => {
|
|
67
|
+
try {
|
|
68
|
+
for (const [name, expected] of Object.entries(bundledWasmFunctions)) {
|
|
69
|
+
const descriptor = Object.getOwnPropertyDescriptor(module, name);
|
|
70
|
+
const candidate = descriptor?.get === undefined ? descriptor?.value : Reflect.get(module, name);
|
|
71
|
+
if (candidate !== expected) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
};
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Open and authenticate an AES-128-GCM `ciphertext || tag`.
|
|
6
|
+
*/
|
|
7
|
+
export function aes128GcmOpen(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Seal plaintext with AES-128-GCM and return `ciphertext || tag`.
|
|
11
|
+
*/
|
|
12
|
+
export function aes128GcmSeal(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unwrap key material with AES-128-KW.
|
|
16
|
+
*/
|
|
17
|
+
export function aes128KwUnwrapKey(kek: Uint8Array, wrapped_key: Uint8Array): Uint8Array;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Wrap key material with AES-128-KW.
|
|
21
|
+
*/
|
|
22
|
+
export function aes128KwWrapKey(kek: Uint8Array, key_data: Uint8Array): Uint8Array;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Open and authenticate an AES-192-GCM `ciphertext || tag`.
|
|
26
|
+
*/
|
|
27
|
+
export function aes192GcmOpen(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Seal plaintext with AES-192-GCM and return `ciphertext || tag`.
|
|
31
|
+
*/
|
|
32
|
+
export function aes192GcmSeal(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Unwrap key material with AES-192-KW.
|
|
36
|
+
*/
|
|
37
|
+
export function aes192KwUnwrapKey(kek: Uint8Array, wrapped_key: Uint8Array): Uint8Array;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Wrap key material with AES-192-KW.
|
|
41
|
+
*/
|
|
42
|
+
export function aes192KwWrapKey(kek: Uint8Array, key_data: Uint8Array): Uint8Array;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Open and authenticate an AES-256-GCM `ciphertext || tag`.
|
|
46
|
+
*/
|
|
47
|
+
export function aes256GcmOpen(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Seal plaintext with AES-256-GCM and return `ciphertext || tag`.
|
|
51
|
+
*/
|
|
52
|
+
export function aes256GcmSeal(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Open and authenticate an AES-256-GCM-SIV `ciphertext || tag`.
|
|
56
|
+
*/
|
|
57
|
+
export function aes256GcmSivOpen(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Seal plaintext with AES-256-GCM-SIV and return `ciphertext || tag`.
|
|
61
|
+
*/
|
|
62
|
+
export function aes256GcmSivSeal(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Unwrap key material with AES-256-KW.
|
|
66
|
+
*/
|
|
67
|
+
export function aes256KwUnwrapKey(kek: Uint8Array, wrapped_key: Uint8Array): Uint8Array;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Wrap key material with AES-256-KW.
|
|
71
|
+
*/
|
|
72
|
+
export function aes256KwWrapKey(kek: Uint8Array, key_data: Uint8Array): Uint8Array;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Derive the fixed 32-byte Argon2id key for a versioned ReallyMe profile.
|
|
76
|
+
*/
|
|
77
|
+
export function argon2idDeriveKey(kdf_version: number, secret: Uint8Array, salt: Uint8Array): Uint8Array;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Open and authenticate a ChaCha20-Poly1305 `ciphertext || tag`.
|
|
81
|
+
*/
|
|
82
|
+
export function chacha20Poly1305Open(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Seal plaintext with ChaCha20-Poly1305 and return `ciphertext || tag`.
|
|
86
|
+
*/
|
|
87
|
+
export function chacha20Poly1305Seal(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Open one RFC 9180 HPKE Base-mode message.
|
|
91
|
+
*/
|
|
92
|
+
export function hpkeOpenBase(suite: number, recipient_secret_key: Uint8Array, encapsulated_key: Uint8Array, info: Uint8Array, aad: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Seal one RFC 9180 HPKE Base-mode message.
|
|
96
|
+
*/
|
|
97
|
+
export function hpkeSealBase(suite: number, recipient_public_key: Uint8Array, info: Uint8Array, aad: Uint8Array, plaintext: Uint8Array): any;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Derive key material with KMAC256.
|
|
101
|
+
*/
|
|
102
|
+
export function kmac256Derive(key: Uint8Array, context: Uint8Array, customization: Uint8Array, output_length: number): Uint8Array;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Derive an ML-DSA-44 keypair from a 32-byte seed.
|
|
106
|
+
*/
|
|
107
|
+
export function mlDsa44DeriveKeypair(secret_key: Uint8Array): any;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Generate an ML-DSA-44 keypair.
|
|
111
|
+
*/
|
|
112
|
+
export function mlDsa44GenerateKeypair(): any;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Sign a message with ML-DSA-44.
|
|
116
|
+
*/
|
|
117
|
+
export function mlDsa44Sign(secret_key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Verify an ML-DSA-44 detached signature.
|
|
121
|
+
*/
|
|
122
|
+
export function mlDsa44Verify(public_key: Uint8Array, message: Uint8Array, signature: Uint8Array): void;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Derive an ML-DSA-65 keypair from a 32-byte seed.
|
|
126
|
+
*/
|
|
127
|
+
export function mlDsa65DeriveKeypair(secret_key: Uint8Array): any;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Generate an ML-DSA-65 keypair.
|
|
131
|
+
*/
|
|
132
|
+
export function mlDsa65GenerateKeypair(): any;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Sign a message with ML-DSA-65.
|
|
136
|
+
*/
|
|
137
|
+
export function mlDsa65Sign(secret_key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Verify an ML-DSA-65 detached signature.
|
|
141
|
+
*/
|
|
142
|
+
export function mlDsa65Verify(public_key: Uint8Array, message: Uint8Array, signature: Uint8Array): void;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Derive an ML-DSA-87 keypair from a 32-byte seed.
|
|
146
|
+
*/
|
|
147
|
+
export function mlDsa87DeriveKeypair(secret_key: Uint8Array): any;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Generate an ML-DSA-87 keypair.
|
|
151
|
+
*/
|
|
152
|
+
export function mlDsa87GenerateKeypair(): any;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Sign a message with ML-DSA-87.
|
|
156
|
+
*/
|
|
157
|
+
export function mlDsa87Sign(secret_key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Verify an ML-DSA-87 detached signature.
|
|
161
|
+
*/
|
|
162
|
+
export function mlDsa87Verify(public_key: Uint8Array, message: Uint8Array, signature: Uint8Array): void;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Decapsulate an ML-KEM-1024 ciphertext.
|
|
166
|
+
*/
|
|
167
|
+
export function mlKem1024Decapsulate(ciphertext: Uint8Array, secret_key: Uint8Array): Uint8Array;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Derive an ML-KEM-1024 keypair from a 64-byte FIPS 203 seed.
|
|
171
|
+
*/
|
|
172
|
+
export function mlKem1024DeriveKeypair(secret_key: Uint8Array): any;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Encapsulate to an ML-KEM-1024 public key.
|
|
176
|
+
*/
|
|
177
|
+
export function mlKem1024Encapsulate(public_key: Uint8Array): any;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Generate an ML-KEM-1024 keypair.
|
|
181
|
+
*/
|
|
182
|
+
export function mlKem1024GenerateKeypair(): any;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Decapsulate an ML-KEM-512 ciphertext.
|
|
186
|
+
*/
|
|
187
|
+
export function mlKem512Decapsulate(ciphertext: Uint8Array, secret_key: Uint8Array): Uint8Array;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Derive an ML-KEM-512 keypair from a 64-byte FIPS 203 seed.
|
|
191
|
+
*/
|
|
192
|
+
export function mlKem512DeriveKeypair(secret_key: Uint8Array): any;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Encapsulate to an ML-KEM-512 public key.
|
|
196
|
+
*/
|
|
197
|
+
export function mlKem512Encapsulate(public_key: Uint8Array): any;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Generate an ML-KEM-512 keypair.
|
|
201
|
+
*/
|
|
202
|
+
export function mlKem512GenerateKeypair(): any;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Decapsulate an ML-KEM-768 ciphertext.
|
|
206
|
+
*/
|
|
207
|
+
export function mlKem768Decapsulate(ciphertext: Uint8Array, secret_key: Uint8Array): Uint8Array;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Derive an ML-KEM-768 keypair from a 64-byte FIPS 203 seed.
|
|
211
|
+
*/
|
|
212
|
+
export function mlKem768DeriveKeypair(secret_key: Uint8Array): any;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Encapsulate to an ML-KEM-768 public key.
|
|
216
|
+
*/
|
|
217
|
+
export function mlKem768Encapsulate(public_key: Uint8Array): any;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Generate an ML-KEM-768 keypair.
|
|
221
|
+
*/
|
|
222
|
+
export function mlKem768GenerateKeypair(): any;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Execute one generated binary protobuf request and return a binary `CryptoOperationResponse`.
|
|
226
|
+
*/
|
|
227
|
+
export function processOperationResponse(request: Uint8Array): Uint8Array;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Execute one generated ProtoJSON request and return a binary `CryptoOperationResponse`.
|
|
231
|
+
*/
|
|
232
|
+
export function processOperationResponseJson(request_json: Uint8Array): Uint8Array;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Verify an RSASSA-PKCS1-v1_5 signature against a DER RSA public key.
|
|
236
|
+
*/
|
|
237
|
+
export function rsaVerifyPkcs1v15(public_key_der: Uint8Array, public_key_encoding: number, hash_suite: number, message: Uint8Array, signature: Uint8Array): void;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Verify an RSASSA-PSS signature against a DER RSA public key.
|
|
241
|
+
*/
|
|
242
|
+
export function rsaVerifyPss(public_key_der: Uint8Array, public_key_encoding: number, message_hash_suite: number, mgf1_hash_suite: number, salt_len: number, message: Uint8Array, signature: Uint8Array): void;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Derive an SLH-DSA-SHA2-128s keypair from the three FIPS 205 seeds.
|
|
246
|
+
*/
|
|
247
|
+
export function slhDsaSha2128sDeriveKeypair(sk_seed: Uint8Array, sk_prf: Uint8Array, pk_seed: Uint8Array): any;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Generate an SLH-DSA-SHA2-128s keypair.
|
|
251
|
+
*/
|
|
252
|
+
export function slhDsaSha2128sGenerateKeypair(): any;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Sign a message with SLH-DSA-SHA2-128s.
|
|
256
|
+
*/
|
|
257
|
+
export function slhDsaSha2128sSign(secret_key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Verify an SLH-DSA-SHA2-128s detached signature.
|
|
261
|
+
*/
|
|
262
|
+
export function slhDsaSha2128sVerify(public_key: Uint8Array, message: Uint8Array, signature: Uint8Array): void;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Decapsulate an X-Wing-768 ciphertext with a 32-byte secret seed.
|
|
266
|
+
*/
|
|
267
|
+
export function xWing768Decapsulate(ciphertext: Uint8Array, secret_key: Uint8Array): Uint8Array;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Derive an X-Wing-768 public key from a 32-byte secret seed.
|
|
271
|
+
*/
|
|
272
|
+
export function xWing768DeriveKeypair(secret_key: Uint8Array): any;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Randomly encapsulate to an X-Wing-768 public key.
|
|
276
|
+
*/
|
|
277
|
+
export function xWing768Encapsulate(public_key: Uint8Array): any;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Generate a random X-Wing-768 keypair for the TypeScript WASM provider.
|
|
281
|
+
*/
|
|
282
|
+
export function xWing768GenerateKeypair(): any;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Open and authenticate an XChaCha20-Poly1305 `ciphertext || tag`.
|
|
286
|
+
*/
|
|
287
|
+
export function xchacha20Poly1305Open(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Seal plaintext with XChaCha20-Poly1305 and return `ciphertext || tag`.
|
|
291
|
+
*/
|
|
292
|
+
export function xchacha20Poly1305Seal(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
293
|
+
|
|
294
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
295
|
+
|
|
296
|
+
export interface InitOutput {
|
|
297
|
+
readonly memory: WebAssembly.Memory;
|
|
298
|
+
readonly aes128GcmOpen: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
299
|
+
readonly aes128GcmSeal: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
300
|
+
readonly aes128KwUnwrapKey: (a: any, b: any) => [number, number, number];
|
|
301
|
+
readonly aes128KwWrapKey: (a: any, b: any) => [number, number, number];
|
|
302
|
+
readonly aes192GcmOpen: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
303
|
+
readonly aes192GcmSeal: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
304
|
+
readonly aes192KwUnwrapKey: (a: any, b: any) => [number, number, number];
|
|
305
|
+
readonly aes192KwWrapKey: (a: any, b: any) => [number, number, number];
|
|
306
|
+
readonly aes256GcmOpen: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
307
|
+
readonly aes256GcmSeal: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
308
|
+
readonly aes256GcmSivOpen: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
309
|
+
readonly aes256GcmSivSeal: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
310
|
+
readonly aes256KwUnwrapKey: (a: any, b: any) => [number, number, number];
|
|
311
|
+
readonly aes256KwWrapKey: (a: any, b: any) => [number, number, number];
|
|
312
|
+
readonly argon2idDeriveKey: (a: number, b: any, c: any) => [number, number, number];
|
|
313
|
+
readonly chacha20Poly1305Open: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
314
|
+
readonly chacha20Poly1305Seal: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
315
|
+
readonly hpkeOpenBase: (a: number, b: any, c: any, d: any, e: any, f: any) => [number, number, number];
|
|
316
|
+
readonly hpkeSealBase: (a: number, b: any, c: any, d: any, e: any) => [number, number, number];
|
|
317
|
+
readonly kmac256Derive: (a: any, b: any, c: any, d: number) => [number, number, number];
|
|
318
|
+
readonly mlDsa44DeriveKeypair: (a: any) => [number, number, number];
|
|
319
|
+
readonly mlDsa44GenerateKeypair: () => [number, number, number];
|
|
320
|
+
readonly mlDsa44Sign: (a: any, b: any) => [number, number, number];
|
|
321
|
+
readonly mlDsa44Verify: (a: any, b: any, c: any) => [number, number];
|
|
322
|
+
readonly mlDsa65DeriveKeypair: (a: any) => [number, number, number];
|
|
323
|
+
readonly mlDsa65GenerateKeypair: () => [number, number, number];
|
|
324
|
+
readonly mlDsa65Sign: (a: any, b: any) => [number, number, number];
|
|
325
|
+
readonly mlDsa65Verify: (a: any, b: any, c: any) => [number, number];
|
|
326
|
+
readonly mlDsa87DeriveKeypair: (a: any) => [number, number, number];
|
|
327
|
+
readonly mlDsa87GenerateKeypair: () => [number, number, number];
|
|
328
|
+
readonly mlDsa87Sign: (a: any, b: any) => [number, number, number];
|
|
329
|
+
readonly mlDsa87Verify: (a: any, b: any, c: any) => [number, number];
|
|
330
|
+
readonly mlKem1024Decapsulate: (a: any, b: any) => [number, number, number];
|
|
331
|
+
readonly mlKem1024DeriveKeypair: (a: any) => [number, number, number];
|
|
332
|
+
readonly mlKem1024Encapsulate: (a: any) => [number, number, number];
|
|
333
|
+
readonly mlKem1024GenerateKeypair: () => [number, number, number];
|
|
334
|
+
readonly mlKem512Decapsulate: (a: any, b: any) => [number, number, number];
|
|
335
|
+
readonly mlKem512DeriveKeypair: (a: any) => [number, number, number];
|
|
336
|
+
readonly mlKem512Encapsulate: (a: any) => [number, number, number];
|
|
337
|
+
readonly mlKem512GenerateKeypair: () => [number, number, number];
|
|
338
|
+
readonly mlKem768Decapsulate: (a: any, b: any) => [number, number, number];
|
|
339
|
+
readonly mlKem768DeriveKeypair: (a: any) => [number, number, number];
|
|
340
|
+
readonly mlKem768Encapsulate: (a: any) => [number, number, number];
|
|
341
|
+
readonly mlKem768GenerateKeypair: () => [number, number, number];
|
|
342
|
+
readonly processOperationResponse: (a: any) => any;
|
|
343
|
+
readonly processOperationResponseJson: (a: any) => any;
|
|
344
|
+
readonly rsaVerifyPkcs1v15: (a: any, b: number, c: number, d: any, e: any) => [number, number];
|
|
345
|
+
readonly rsaVerifyPss: (a: any, b: number, c: number, d: number, e: number, f: any, g: any) => [number, number];
|
|
346
|
+
readonly slhDsaSha2128sDeriveKeypair: (a: any, b: any, c: any) => [number, number, number];
|
|
347
|
+
readonly slhDsaSha2128sGenerateKeypair: () => [number, number, number];
|
|
348
|
+
readonly slhDsaSha2128sSign: (a: any, b: any) => [number, number, number];
|
|
349
|
+
readonly slhDsaSha2128sVerify: (a: any, b: any, c: any) => [number, number];
|
|
350
|
+
readonly xWing768Decapsulate: (a: any, b: any) => [number, number, number];
|
|
351
|
+
readonly xWing768DeriveKeypair: (a: any) => [number, number, number];
|
|
352
|
+
readonly xWing768Encapsulate: (a: any) => [number, number, number];
|
|
353
|
+
readonly xWing768GenerateKeypair: () => [number, number, number];
|
|
354
|
+
readonly xchacha20Poly1305Open: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
355
|
+
readonly xchacha20Poly1305Seal: (a: any, b: any, c: any, d: any) => [number, number, number];
|
|
356
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
357
|
+
readonly __externref_table_alloc: () => number;
|
|
358
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
359
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
360
|
+
readonly __wbindgen_start: () => void;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
367
|
+
* a precompiled `WebAssembly.Module`.
|
|
368
|
+
*
|
|
369
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
370
|
+
*
|
|
371
|
+
* @returns {InitOutput}
|
|
372
|
+
*/
|
|
373
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
377
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
378
|
+
*
|
|
379
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
380
|
+
*
|
|
381
|
+
* @returns {Promise<InitOutput>}
|
|
382
|
+
*/
|
|
383
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -814,37 +814,37 @@ export function xchacha20Poly1305Seal(key, nonce, aad, plaintext) {
|
|
|
814
814
|
function __wbg_get_imports() {
|
|
815
815
|
const import0 = {
|
|
816
816
|
__proto__: null,
|
|
817
|
-
|
|
817
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
818
818
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
819
819
|
},
|
|
820
820
|
__wbg_getRandomValues_436a51d0629d84e1: function() { return handleError(function (arg0, arg1) {
|
|
821
821
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
822
822
|
}, arguments); },
|
|
823
|
-
|
|
823
|
+
__wbg_length_7f3c00c40364105e: function(arg0) {
|
|
824
824
|
const ret = arg0.length;
|
|
825
825
|
return ret;
|
|
826
826
|
},
|
|
827
|
-
|
|
827
|
+
__wbg_new_617a8cdb8bb1130e: function() {
|
|
828
828
|
const ret = new Object();
|
|
829
829
|
return ret;
|
|
830
830
|
},
|
|
831
|
-
|
|
831
|
+
__wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
|
|
832
832
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
833
833
|
return ret;
|
|
834
834
|
},
|
|
835
|
-
|
|
835
|
+
__wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
|
|
836
836
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
837
837
|
},
|
|
838
|
-
|
|
838
|
+
__wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
|
|
839
839
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
840
840
|
return ret;
|
|
841
841
|
}, arguments); },
|
|
842
|
-
|
|
842
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
843
843
|
// Cast intrinsic for `F64 -> Externref`.
|
|
844
844
|
const ret = arg0;
|
|
845
845
|
return ret;
|
|
846
846
|
},
|
|
847
|
-
|
|
847
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
848
848
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
849
849
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
850
850
|
return ret;
|
|
Binary file
|
package/dist/wasmModuleTypes.js
CHANGED
package/dist/wasmProvider.d.ts
CHANGED
|
@@ -76,7 +76,12 @@ export type ReallyMeWasmProvider = Readonly<{
|
|
|
76
76
|
xWing768Encapsulate: EncapsulateFn;
|
|
77
77
|
xWing768Decapsulate: DecapsulateFn;
|
|
78
78
|
}>;
|
|
79
|
+
/** Bind callables after the caller establishes module ownership; tests exercise this boundary directly. */
|
|
80
|
+
export declare const createWasmProviderFromModule: (module: unknown) => ReallyMeWasmProvider;
|
|
81
|
+
/** Build a provider only from the package-owned and initialized WASM module. */
|
|
79
82
|
export declare const createReallyMeWasmProvider: (module: unknown) => ReallyMeWasmProvider;
|
|
83
|
+
/** A structural copy cannot be used as an explicit facade provider. */
|
|
84
|
+
export declare const requireTrustedReallyMeWasmProvider: (provider: ReallyMeWasmProvider) => ReallyMeWasmProvider;
|
|
80
85
|
export declare const installReallyMeWasmProvider: (module: unknown) => void;
|
|
81
86
|
export declare const requireReallyMeWasmProvider: () => ReallyMeWasmProvider;
|
|
82
87
|
export {};
|