react-native-quick-crypto 1.0.5 → 1.0.6

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.
Files changed (74) hide show
  1. package/QuickCrypto.podspec +21 -7
  2. package/android/CMakeLists.txt +1 -0
  3. package/cpp/cipher/HybridRsaCipher.cpp +111 -25
  4. package/cpp/cipher/HybridRsaCipher.hpp +5 -1
  5. package/cpp/hash/HybridHash.cpp +11 -4
  6. package/cpp/hash/HybridHash.hpp +1 -1
  7. package/cpp/hmac/HybridHmac.cpp +13 -4
  8. package/cpp/hmac/HybridHmac.hpp +2 -1
  9. package/cpp/utils/HybridUtils.cpp +19 -0
  10. package/cpp/utils/HybridUtils.hpp +15 -0
  11. package/lib/commonjs/hash.js +7 -1
  12. package/lib/commonjs/hash.js.map +1 -1
  13. package/lib/commonjs/hmac.js +7 -1
  14. package/lib/commonjs/hmac.js.map +1 -1
  15. package/lib/commonjs/keys/publicCipher.js +30 -18
  16. package/lib/commonjs/keys/publicCipher.js.map +1 -1
  17. package/lib/commonjs/specs/utils.nitro.js +6 -0
  18. package/lib/commonjs/specs/utils.nitro.js.map +1 -0
  19. package/lib/commonjs/utils/index.js +11 -0
  20. package/lib/commonjs/utils/index.js.map +1 -1
  21. package/lib/commonjs/utils/timingSafeEqual.js +24 -0
  22. package/lib/commonjs/utils/timingSafeEqual.js.map +1 -0
  23. package/lib/module/hash.js +7 -1
  24. package/lib/module/hash.js.map +1 -1
  25. package/lib/module/hmac.js +7 -1
  26. package/lib/module/hmac.js.map +1 -1
  27. package/lib/module/keys/publicCipher.js +30 -18
  28. package/lib/module/keys/publicCipher.js.map +1 -1
  29. package/lib/module/specs/utils.nitro.js +4 -0
  30. package/lib/module/specs/utils.nitro.js.map +1 -0
  31. package/lib/module/utils/index.js +1 -0
  32. package/lib/module/utils/index.js.map +1 -1
  33. package/lib/module/utils/timingSafeEqual.js +20 -0
  34. package/lib/module/utils/timingSafeEqual.js.map +1 -0
  35. package/lib/tsconfig.tsbuildinfo +1 -1
  36. package/lib/typescript/hash.d.ts.map +1 -1
  37. package/lib/typescript/hmac.d.ts.map +1 -1
  38. package/lib/typescript/index.d.ts +1 -0
  39. package/lib/typescript/index.d.ts.map +1 -1
  40. package/lib/typescript/keys/publicCipher.d.ts +2 -0
  41. package/lib/typescript/keys/publicCipher.d.ts.map +1 -1
  42. package/lib/typescript/specs/hash.nitro.d.ts +1 -1
  43. package/lib/typescript/specs/hash.nitro.d.ts.map +1 -1
  44. package/lib/typescript/specs/hmac.nitro.d.ts +1 -1
  45. package/lib/typescript/specs/hmac.nitro.d.ts.map +1 -1
  46. package/lib/typescript/specs/rsaCipher.nitro.d.ts +14 -4
  47. package/lib/typescript/specs/rsaCipher.nitro.d.ts.map +1 -1
  48. package/lib/typescript/specs/utils.nitro.d.ts +8 -0
  49. package/lib/typescript/specs/utils.nitro.d.ts.map +1 -0
  50. package/lib/typescript/utils/index.d.ts +1 -0
  51. package/lib/typescript/utils/index.d.ts.map +1 -1
  52. package/lib/typescript/utils/timingSafeEqual.d.ts +3 -0
  53. package/lib/typescript/utils/timingSafeEqual.d.ts.map +1 -0
  54. package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +1 -0
  55. package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +10 -0
  56. package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +10 -0
  57. package/nitrogen/generated/shared/c++/HybridHashSpec.hpp +2 -1
  58. package/nitrogen/generated/shared/c++/HybridHmacSpec.hpp +2 -1
  59. package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.cpp +1 -0
  60. package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.hpp +2 -1
  61. package/nitrogen/generated/shared/c++/HybridUtilsSpec.cpp +21 -0
  62. package/nitrogen/generated/shared/c++/HybridUtilsSpec.hpp +63 -0
  63. package/package.json +2 -2
  64. package/src/hash.ts +6 -1
  65. package/src/hmac.ts +6 -1
  66. package/src/keys/publicCipher.ts +46 -26
  67. package/src/specs/hash.nitro.ts +1 -1
  68. package/src/specs/hmac.nitro.ts +1 -1
  69. package/src/specs/rsaCipher.nitro.ts +20 -3
  70. package/src/specs/utils.nitro.ts +5 -0
  71. package/src/utils/index.ts +1 -0
  72. package/src/utils/timingSafeEqual.ts +23 -0
  73. package/react-native.config.js +0 -19
  74. package/scripts/embed_openssl_framework.sh +0 -18
@@ -1,6 +1,7 @@
1
1
  export * from './conversion';
2
2
  export * from './errors';
3
3
  export * from './hashnames';
4
+ export * from './timingSafeEqual';
4
5
  export * from './types';
5
6
  export * from './validation';
6
7
  export * from './cipher';
@@ -0,0 +1,23 @@
1
+ import { NitroModules } from 'react-native-nitro-modules';
2
+ import type { Utils } from '../specs/utils.nitro';
3
+ import type { ABV } from './types';
4
+ import { abvToArrayBuffer } from './conversion';
5
+
6
+ let utils: Utils;
7
+ function getNative(): Utils {
8
+ if (utils == null) {
9
+ utils = NitroModules.createHybridObject<Utils>('Utils');
10
+ }
11
+ return utils;
12
+ }
13
+
14
+ export function timingSafeEqual(a: ABV, b: ABV): boolean {
15
+ const bufA = abvToArrayBuffer(a);
16
+ const bufB = abvToArrayBuffer(b);
17
+
18
+ if (bufA.byteLength !== bufB.byteLength) {
19
+ throw new RangeError('Input buffers must have the same byte length');
20
+ }
21
+
22
+ return getNative().timingSafeEqual(bufA, bufB);
23
+ }
@@ -1,19 +0,0 @@
1
- module.exports = {
2
- dependency: {
3
- platforms: {
4
- ios: {
5
- scriptPhases: [
6
- {
7
- name: '[CP-User] Embed OpenSSL Framework',
8
- path: './scripts/embed_openssl_framework.sh',
9
- execution_position: 'after_compile',
10
- input_files: ['${BUILT_PRODUCTS_DIR}/OpenSSL.framework'],
11
- output_files: [
12
- '${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework',
13
- ],
14
- },
15
- ],
16
- },
17
- },
18
- },
19
- };
@@ -1,18 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- OPENSSL_FRAMEWORK="${BUILT_PRODUCTS_DIR}/OpenSSL.framework"
5
-
6
- if [ -d "$OPENSSL_FRAMEWORK" ]; then
7
- echo "[QuickCrypto] Copying OpenSSL.framework to app bundle"
8
- mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
9
- cp -Rf "$OPENSSL_FRAMEWORK" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/"
10
-
11
- # Code sign the framework (only if code signing is required and not a simulator build)
12
- if [ "${CODE_SIGNING_REQUIRED}" = "YES" ] && [ "${EFFECTIVE_PLATFORM_NAME}" != "-iphonesimulator" ]; then
13
- codesign --force --sign "${EXPANDED_CODE_SIGN_IDENTITY}" --preserve-metadata=identifier,entitlements --timestamp=none "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework" || true
14
- fi
15
- echo "[QuickCrypto] Successfully embedded OpenSSL.framework"
16
- else
17
- echo "[QuickCrypto] Warning: OpenSSL.framework not found at $OPENSSL_FRAMEWORK"
18
- fi