@reallyme/crypto 0.3.4 → 0.3.5

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/aesKw.d.ts CHANGED
@@ -8,9 +8,14 @@ export declare const AES_KW_INTEGRITY_CHECK_LENGTH = 8;
8
8
  export declare const AES_KW_MIN_KEY_DATA_LENGTH = 16;
9
9
  export declare const AES_KW_MIN_WRAPPED_KEY_LENGTH: number;
10
10
  export declare const AES_KW_MAX_KEY_DATA_LENGTH = 4096;
11
+ declare const wrapKey: (algorithm: ReallyMeKeyWrapAlgorithm, wrappingKey: Uint8Array, keyToWrap: Uint8Array) => Uint8Array;
12
+ declare const wrapKeyWithProvider: (algorithm: ReallyMeKeyWrapAlgorithm, provider: ReallyMeWasmProvider, wrappingKey: Uint8Array, keyToWrap: Uint8Array) => Uint8Array;
13
+ declare const unwrapKey: (algorithm: ReallyMeKeyWrapAlgorithm, wrappingKey: Uint8Array, wrappedKey: Uint8Array) => Uint8Array;
14
+ declare const unwrapKeyWithProvider: (algorithm: ReallyMeKeyWrapAlgorithm, provider: ReallyMeWasmProvider, wrappingKey: Uint8Array, wrappedKey: Uint8Array) => Uint8Array;
11
15
  export declare const ReallyMeAesKw: {
12
- readonly wrapKey: (algorithm: ReallyMeKeyWrapAlgorithm, wrappingKey: Uint8Array, keyToWrap: Uint8Array) => Uint8Array;
13
- readonly wrapKeyWithProvider: (algorithm: ReallyMeKeyWrapAlgorithm, provider: ReallyMeWasmProvider, wrappingKey: Uint8Array, keyToWrap: Uint8Array) => Uint8Array;
14
- readonly unwrapKey: (algorithm: ReallyMeKeyWrapAlgorithm, wrappingKey: Uint8Array, wrappedKey: Uint8Array) => Uint8Array;
15
- readonly unwrapKeyWithProvider: (algorithm: ReallyMeKeyWrapAlgorithm, provider: ReallyMeWasmProvider, wrappingKey: Uint8Array, wrappedKey: Uint8Array) => Uint8Array;
16
+ readonly wrapKey: typeof wrapKey;
17
+ readonly wrapKeyWithProvider: typeof wrapKeyWithProvider;
18
+ readonly unwrapKey: typeof unwrapKey;
19
+ readonly unwrapKeyWithProvider: typeof unwrapKeyWithProvider;
16
20
  };
21
+ export {};
package/dist/rsa.d.ts CHANGED
@@ -3,6 +3,7 @@ import type { ReallyMeWasmProvider } from "./wasmProvider.js";
3
3
  export type ReallyMeRsaPublicKeyDerEncoding = "PKCS1" | "SPKI";
4
4
  export declare const RSA_PUBLIC_KEY_DER_MAX_LENGTH = 4096;
5
5
  export declare const RSA_SIGNATURE_MAX_LENGTH = 1024;
6
+ declare const verifyWithProvider: (provider: ReallyMeWasmProvider, algorithm: ReallyMeSignatureAlgorithm, signature: Uint8Array, message: Uint8Array, publicKeyDer: Uint8Array, publicKeyEncoding: ReallyMeRsaPublicKeyDerEncoding) => void;
6
7
  /**
7
8
  * RSA signature verification through the ReallyMe Rust WASM provider.
8
9
  *
@@ -12,5 +13,6 @@ export declare const RSA_SIGNATURE_MAX_LENGTH = 1024;
12
13
  */
13
14
  export declare const ReallyMeRsa: {
14
15
  readonly verify: (algorithm: ReallyMeSignatureAlgorithm, signature: Uint8Array, message: Uint8Array, publicKeyDer: Uint8Array, publicKeyEncoding: ReallyMeRsaPublicKeyDerEncoding) => void;
15
- readonly verifyWithProvider: (provider: ReallyMeWasmProvider, algorithm: ReallyMeSignatureAlgorithm, signature: Uint8Array, message: Uint8Array, publicKeyDer: Uint8Array, publicKeyEncoding: ReallyMeRsaPublicKeyDerEncoding) => void;
16
+ readonly verifyWithProvider: typeof verifyWithProvider;
16
17
  };
18
+ export {};
@@ -814,28 +814,28 @@ export function xchacha20Poly1305Seal(key, nonce, aad, plaintext) {
814
814
  function __wbg_get_imports() {
815
815
  const import0 = {
816
816
  __proto__: null,
817
- __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
817
+ __wbg___wbindgen_throw_bb96b2010945f0bc: function(arg0, arg1) {
818
818
  throw new Error(getStringFromWasm0(arg0, arg1));
819
819
  },
820
- __wbg_getRandomValues_cc7f052a444bb2ce: function() { return handleError(function (arg0, arg1) {
820
+ __wbg_getRandomValues_436a51d0629d84e1: function() { return handleError(function (arg0, arg1) {
821
821
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
822
822
  }, arguments); },
823
- __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
823
+ __wbg_length_36bd29c6848c2144: function(arg0) {
824
824
  const ret = arg0.length;
825
825
  return ret;
826
826
  },
827
- __wbg_new_da52cf8fe3429cb2: function() {
827
+ __wbg_new_ebe3e0f6837f0879: function() {
828
828
  const ret = new Object();
829
829
  return ret;
830
830
  },
831
- __wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
831
+ __wbg_new_from_slice_3eea173078478cfe: function(arg0, arg1) {
832
832
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
833
833
  return ret;
834
834
  },
835
- __wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
835
+ __wbg_prototypesetcall_de8e0d9553586985: function(arg0, arg1, arg2) {
836
836
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
837
837
  },
838
- __wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
838
+ __wbg_set_8155bb79a948541b: function() { return handleError(function (arg0, arg1, arg2) {
839
839
  const ret = Reflect.set(arg0, arg1, arg2);
840
840
  return ret;
841
841
  }, arguments); },
@@ -929,11 +929,15 @@ function __wbg_finalize_init(instance, module) {
929
929
 
930
930
  async function __wbg_load(module, imports) {
931
931
  if (typeof Response === 'function' && module instanceof Response) {
932
+ if (!module.ok) {
933
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
934
+ }
935
+
932
936
  if (typeof WebAssembly.instantiateStreaming === 'function') {
933
937
  try {
934
938
  return await WebAssembly.instantiateStreaming(module, imports);
935
939
  } catch (e) {
936
- const validResponse = module.ok && expectedResponseType(module.type);
940
+ const validResponse = expectedResponseType(module.type);
937
941
 
938
942
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
939
943
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reallyme/crypto",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "ReallyMe crypto SDK for TypeScript/JavaScript with an explicit, pinned provider set.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -52,13 +52,13 @@
52
52
  "test": "npm run build && node --test \"test/*.test.mjs\""
53
53
  },
54
54
  "dependencies": {
55
- "@bufbuild/protobuf": "2.12.1",
56
- "@noble/curves": "2.2.0",
57
- "@noble/hashes": "2.2.0",
58
- "@reallyme/codec": "0.2.0"
55
+ "@bufbuild/protobuf": "2.14.1",
56
+ "@noble/curves": "2.4.0",
57
+ "@noble/hashes": "2.4.0",
58
+ "@reallyme/codec": "0.2.1"
59
59
  },
60
60
  "devDependencies": {
61
- "typescript": "5.8.3"
61
+ "typescript": "7.0.2"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=20.19.0"