@bitwarden/sdk-internal 0.2.0-main.129 → 0.2.0-main.130

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/VERSION CHANGED
@@ -1 +1 @@
1
- f5ab03bcb4490ee8893cf3d709160cd8155acdc3
1
+ aa8622bc534c8348c7f8661cabe160ccb00400f4
@@ -424,11 +424,11 @@ export class CryptoClient {
424
424
  export class PureCrypto {
425
425
  private constructor();
426
426
  free(): void;
427
- static symmetric_decrypt(enc_string: string, key_b64: string): string;
428
- static symmetric_decrypt_to_bytes(enc_string: string, key_b64: string): Uint8Array;
429
- static symmetric_decrypt_array_buffer(enc_bytes: Uint8Array, key_b64: string): Uint8Array;
430
- static symmetric_encrypt(plain: string, key_b64: string): string;
431
- static symmetric_encrypt_to_array_buffer(plain: Uint8Array, key_b64: string): Uint8Array;
427
+ static symmetric_decrypt(enc_string: string, key: Uint8Array): string;
428
+ static symmetric_decrypt_to_bytes(enc_string: string, key: Uint8Array): Uint8Array;
429
+ static symmetric_decrypt_array_buffer(enc_bytes: Uint8Array, key: Uint8Array): Uint8Array;
430
+ static symmetric_encrypt(plain: string, key: Uint8Array): string;
431
+ static symmetric_encrypt_to_array_buffer(plain: Uint8Array, key: Uint8Array): Uint8Array;
432
432
  }
433
433
  export class VaultClient {
434
434
  private constructor();
@@ -390,17 +390,17 @@ export function init_sdk(log_level) {
390
390
  wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
391
391
  }
392
392
 
393
- function getArrayU8FromWasm0(ptr, len) {
394
- ptr = ptr >>> 0;
395
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
396
- }
397
-
398
393
  function passArray8ToWasm0(arg, malloc) {
399
394
  const ptr = malloc(arg.length * 1, 1) >>> 0;
400
395
  getUint8ArrayMemory0().set(arg, ptr / 1);
401
396
  WASM_VECTOR_LEN = arg.length;
402
397
  return ptr;
403
398
  }
399
+
400
+ function getArrayU8FromWasm0(ptr, len) {
401
+ ptr = ptr >>> 0;
402
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
403
+ }
404
404
  /**
405
405
  * Generate a new SSH key pair
406
406
  *
@@ -863,17 +863,17 @@ export class PureCrypto {
863
863
  }
864
864
  /**
865
865
  * @param {string} enc_string
866
- * @param {string} key_b64
866
+ * @param {Uint8Array} key
867
867
  * @returns {string}
868
868
  */
869
- static symmetric_decrypt(enc_string, key_b64) {
869
+ static symmetric_decrypt(enc_string, key) {
870
870
  let deferred4_0;
871
871
  let deferred4_1;
872
872
  try {
873
873
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
874
874
  const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
875
875
  const len0 = WASM_VECTOR_LEN;
876
- const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
876
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
877
877
  const len1 = WASM_VECTOR_LEN;
878
878
  wasm.purecrypto_symmetric_decrypt(retptr, ptr0, len0, ptr1, len1);
879
879
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -897,15 +897,15 @@ export class PureCrypto {
897
897
  }
898
898
  /**
899
899
  * @param {string} enc_string
900
- * @param {string} key_b64
900
+ * @param {Uint8Array} key
901
901
  * @returns {Uint8Array}
902
902
  */
903
- static symmetric_decrypt_to_bytes(enc_string, key_b64) {
903
+ static symmetric_decrypt_to_bytes(enc_string, key) {
904
904
  try {
905
905
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
906
906
  const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
907
907
  const len0 = WASM_VECTOR_LEN;
908
- const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
908
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
909
909
  const len1 = WASM_VECTOR_LEN;
910
910
  wasm.purecrypto_symmetric_decrypt_to_bytes(retptr, ptr0, len0, ptr1, len1);
911
911
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -924,15 +924,15 @@ export class PureCrypto {
924
924
  }
925
925
  /**
926
926
  * @param {Uint8Array} enc_bytes
927
- * @param {string} key_b64
927
+ * @param {Uint8Array} key
928
928
  * @returns {Uint8Array}
929
929
  */
930
- static symmetric_decrypt_array_buffer(enc_bytes, key_b64) {
930
+ static symmetric_decrypt_array_buffer(enc_bytes, key) {
931
931
  try {
932
932
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
933
933
  const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
934
934
  const len0 = WASM_VECTOR_LEN;
935
- const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
935
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
936
936
  const len1 = WASM_VECTOR_LEN;
937
937
  wasm.purecrypto_symmetric_decrypt_array_buffer(retptr, ptr0, len0, ptr1, len1);
938
938
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -951,17 +951,17 @@ export class PureCrypto {
951
951
  }
952
952
  /**
953
953
  * @param {string} plain
954
- * @param {string} key_b64
954
+ * @param {Uint8Array} key
955
955
  * @returns {string}
956
956
  */
957
- static symmetric_encrypt(plain, key_b64) {
957
+ static symmetric_encrypt(plain, key) {
958
958
  let deferred4_0;
959
959
  let deferred4_1;
960
960
  try {
961
961
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
962
962
  const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
963
963
  const len0 = WASM_VECTOR_LEN;
964
- const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
964
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
965
965
  const len1 = WASM_VECTOR_LEN;
966
966
  wasm.purecrypto_symmetric_encrypt(retptr, ptr0, len0, ptr1, len1);
967
967
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -985,15 +985,15 @@ export class PureCrypto {
985
985
  }
986
986
  /**
987
987
  * @param {Uint8Array} plain
988
- * @param {string} key_b64
988
+ * @param {Uint8Array} key
989
989
  * @returns {Uint8Array}
990
990
  */
991
- static symmetric_encrypt_to_array_buffer(plain, key_b64) {
991
+ static symmetric_encrypt_to_array_buffer(plain, key) {
992
992
  try {
993
993
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
994
994
  const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
995
995
  const len0 = WASM_VECTOR_LEN;
996
- const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
996
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
997
997
  const len1 = WASM_VECTOR_LEN;
998
998
  wasm.purecrypto_symmetric_encrypt_to_array_buffer(retptr, ptr0, len0, ptr1, len1);
999
999
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
Binary file