react-native-quick-crypto 1.0.5 → 1.0.7

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 (99) hide show
  1. package/QuickCrypto.podspec +24 -8
  2. package/README.md +11 -7
  3. package/android/CMakeLists.txt +1 -0
  4. package/cpp/blake3/HybridBlake3.cpp +1 -1
  5. package/cpp/cipher/CCMCipher.cpp +1 -1
  6. package/cpp/cipher/ChaCha20Cipher.cpp +1 -1
  7. package/cpp/cipher/ChaCha20Poly1305Cipher.cpp +1 -1
  8. package/cpp/cipher/GCMCipher.cpp +1 -1
  9. package/cpp/cipher/HybridCipher.cpp +1 -1
  10. package/cpp/cipher/HybridCipherFactory.hpp +1 -1
  11. package/cpp/cipher/HybridRsaCipher.cpp +112 -26
  12. package/cpp/cipher/HybridRsaCipher.hpp +5 -1
  13. package/cpp/cipher/OCBCipher.cpp +1 -1
  14. package/cpp/cipher/XSalsa20Cipher.cpp +1 -1
  15. package/cpp/ec/HybridEcKeyPair.cpp +1 -1
  16. package/cpp/ec/HybridEcKeyPair.hpp +1 -1
  17. package/cpp/ed25519/HybridEdKeyPair.hpp +1 -1
  18. package/cpp/hash/HybridHash.cpp +12 -5
  19. package/cpp/hash/HybridHash.hpp +1 -1
  20. package/cpp/hkdf/HybridHkdf.cpp +1 -1
  21. package/cpp/hmac/HybridHmac.cpp +13 -4
  22. package/cpp/hmac/HybridHmac.hpp +2 -1
  23. package/cpp/keys/HybridKeyObjectHandle.cpp +1 -1
  24. package/cpp/keys/KeyObjectData.cpp +1 -1
  25. package/cpp/keys/KeyObjectData.hpp +1 -1
  26. package/cpp/mldsa/HybridMlDsaKeyPair.cpp +1 -1
  27. package/cpp/pbkdf2/HybridPbkdf2.cpp +1 -1
  28. package/cpp/random/HybridRandom.cpp +1 -1
  29. package/cpp/rsa/HybridRsaKeyPair.cpp +1 -1
  30. package/cpp/scrypt/HybridScrypt.cpp +1 -1
  31. package/cpp/sign/HybridSignHandle.cpp +1 -1
  32. package/cpp/sign/HybridVerifyHandle.cpp +1 -1
  33. package/cpp/utils/HybridUtils.cpp +19 -0
  34. package/cpp/utils/HybridUtils.hpp +15 -0
  35. package/lib/commonjs/hash.js +7 -1
  36. package/lib/commonjs/hash.js.map +1 -1
  37. package/lib/commonjs/hmac.js +7 -1
  38. package/lib/commonjs/hmac.js.map +1 -1
  39. package/lib/commonjs/keys/publicCipher.js +30 -18
  40. package/lib/commonjs/keys/publicCipher.js.map +1 -1
  41. package/lib/commonjs/specs/utils.nitro.js +6 -0
  42. package/lib/commonjs/specs/utils.nitro.js.map +1 -0
  43. package/lib/commonjs/utils/index.js +11 -0
  44. package/lib/commonjs/utils/index.js.map +1 -1
  45. package/lib/commonjs/utils/timingSafeEqual.js +24 -0
  46. package/lib/commonjs/utils/timingSafeEqual.js.map +1 -0
  47. package/lib/module/hash.js +7 -1
  48. package/lib/module/hash.js.map +1 -1
  49. package/lib/module/hmac.js +7 -1
  50. package/lib/module/hmac.js.map +1 -1
  51. package/lib/module/keys/publicCipher.js +30 -18
  52. package/lib/module/keys/publicCipher.js.map +1 -1
  53. package/lib/module/specs/utils.nitro.js +4 -0
  54. package/lib/module/specs/utils.nitro.js.map +1 -0
  55. package/lib/module/utils/index.js +1 -0
  56. package/lib/module/utils/index.js.map +1 -1
  57. package/lib/module/utils/timingSafeEqual.js +20 -0
  58. package/lib/module/utils/timingSafeEqual.js.map +1 -0
  59. package/lib/tsconfig.tsbuildinfo +1 -1
  60. package/lib/typescript/hash.d.ts.map +1 -1
  61. package/lib/typescript/hmac.d.ts.map +1 -1
  62. package/lib/typescript/index.d.ts +1 -0
  63. package/lib/typescript/index.d.ts.map +1 -1
  64. package/lib/typescript/keys/publicCipher.d.ts +2 -0
  65. package/lib/typescript/keys/publicCipher.d.ts.map +1 -1
  66. package/lib/typescript/specs/hash.nitro.d.ts +1 -1
  67. package/lib/typescript/specs/hash.nitro.d.ts.map +1 -1
  68. package/lib/typescript/specs/hmac.nitro.d.ts +1 -1
  69. package/lib/typescript/specs/hmac.nitro.d.ts.map +1 -1
  70. package/lib/typescript/specs/rsaCipher.nitro.d.ts +14 -4
  71. package/lib/typescript/specs/rsaCipher.nitro.d.ts.map +1 -1
  72. package/lib/typescript/specs/utils.nitro.d.ts +8 -0
  73. package/lib/typescript/specs/utils.nitro.d.ts.map +1 -0
  74. package/lib/typescript/utils/index.d.ts +1 -0
  75. package/lib/typescript/utils/index.d.ts.map +1 -1
  76. package/lib/typescript/utils/timingSafeEqual.d.ts +3 -0
  77. package/lib/typescript/utils/timingSafeEqual.d.ts.map +1 -0
  78. package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +1 -0
  79. package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +10 -0
  80. package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +10 -0
  81. package/nitrogen/generated/shared/c++/HybridHashSpec.hpp +2 -1
  82. package/nitrogen/generated/shared/c++/HybridHmacSpec.hpp +2 -1
  83. package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.cpp +1 -0
  84. package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.hpp +2 -1
  85. package/nitrogen/generated/shared/c++/HybridUtilsSpec.cpp +21 -0
  86. package/nitrogen/generated/shared/c++/HybridUtilsSpec.hpp +63 -0
  87. package/package.json +2 -2
  88. package/src/hash.ts +6 -1
  89. package/src/hmac.ts +6 -1
  90. package/src/keys/publicCipher.ts +46 -26
  91. package/src/specs/hash.nitro.ts +1 -1
  92. package/src/specs/hmac.nitro.ts +1 -1
  93. package/src/specs/rsaCipher.nitro.ts +20 -3
  94. package/src/specs/utils.nitro.ts +5 -0
  95. package/src/utils/index.ts +1 -0
  96. package/src/utils/timingSafeEqual.ts +23 -0
  97. package/react-native.config.js +0 -19
  98. package/scripts/embed_openssl_framework.sh +0 -18
  99. /package/cpp/utils/{Utils.hpp → QuickCryptoUtils.hpp} +0 -0
@@ -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
File without changes