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.
- package/QuickCrypto.podspec +24 -8
- package/README.md +11 -7
- package/android/CMakeLists.txt +1 -0
- package/cpp/blake3/HybridBlake3.cpp +1 -1
- package/cpp/cipher/CCMCipher.cpp +1 -1
- package/cpp/cipher/ChaCha20Cipher.cpp +1 -1
- package/cpp/cipher/ChaCha20Poly1305Cipher.cpp +1 -1
- package/cpp/cipher/GCMCipher.cpp +1 -1
- package/cpp/cipher/HybridCipher.cpp +1 -1
- package/cpp/cipher/HybridCipherFactory.hpp +1 -1
- package/cpp/cipher/HybridRsaCipher.cpp +112 -26
- package/cpp/cipher/HybridRsaCipher.hpp +5 -1
- package/cpp/cipher/OCBCipher.cpp +1 -1
- package/cpp/cipher/XSalsa20Cipher.cpp +1 -1
- package/cpp/ec/HybridEcKeyPair.cpp +1 -1
- package/cpp/ec/HybridEcKeyPair.hpp +1 -1
- package/cpp/ed25519/HybridEdKeyPair.hpp +1 -1
- package/cpp/hash/HybridHash.cpp +12 -5
- package/cpp/hash/HybridHash.hpp +1 -1
- package/cpp/hkdf/HybridHkdf.cpp +1 -1
- package/cpp/hmac/HybridHmac.cpp +13 -4
- package/cpp/hmac/HybridHmac.hpp +2 -1
- package/cpp/keys/HybridKeyObjectHandle.cpp +1 -1
- package/cpp/keys/KeyObjectData.cpp +1 -1
- package/cpp/keys/KeyObjectData.hpp +1 -1
- package/cpp/mldsa/HybridMlDsaKeyPair.cpp +1 -1
- package/cpp/pbkdf2/HybridPbkdf2.cpp +1 -1
- package/cpp/random/HybridRandom.cpp +1 -1
- package/cpp/rsa/HybridRsaKeyPair.cpp +1 -1
- package/cpp/scrypt/HybridScrypt.cpp +1 -1
- package/cpp/sign/HybridSignHandle.cpp +1 -1
- package/cpp/sign/HybridVerifyHandle.cpp +1 -1
- package/cpp/utils/HybridUtils.cpp +19 -0
- package/cpp/utils/HybridUtils.hpp +15 -0
- package/lib/commonjs/hash.js +7 -1
- package/lib/commonjs/hash.js.map +1 -1
- package/lib/commonjs/hmac.js +7 -1
- package/lib/commonjs/hmac.js.map +1 -1
- package/lib/commonjs/keys/publicCipher.js +30 -18
- package/lib/commonjs/keys/publicCipher.js.map +1 -1
- package/lib/commonjs/specs/utils.nitro.js +6 -0
- package/lib/commonjs/specs/utils.nitro.js.map +1 -0
- package/lib/commonjs/utils/index.js +11 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/timingSafeEqual.js +24 -0
- package/lib/commonjs/utils/timingSafeEqual.js.map +1 -0
- package/lib/module/hash.js +7 -1
- package/lib/module/hash.js.map +1 -1
- package/lib/module/hmac.js +7 -1
- package/lib/module/hmac.js.map +1 -1
- package/lib/module/keys/publicCipher.js +30 -18
- package/lib/module/keys/publicCipher.js.map +1 -1
- package/lib/module/specs/utils.nitro.js +4 -0
- package/lib/module/specs/utils.nitro.js.map +1 -0
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/timingSafeEqual.js +20 -0
- package/lib/module/utils/timingSafeEqual.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/typescript/hash.d.ts.map +1 -1
- package/lib/typescript/hmac.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/keys/publicCipher.d.ts +2 -0
- package/lib/typescript/keys/publicCipher.d.ts.map +1 -1
- package/lib/typescript/specs/hash.nitro.d.ts +1 -1
- package/lib/typescript/specs/hash.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/hmac.nitro.d.ts +1 -1
- package/lib/typescript/specs/hmac.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/rsaCipher.nitro.d.ts +14 -4
- package/lib/typescript/specs/rsaCipher.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/utils.nitro.d.ts +8 -0
- package/lib/typescript/specs/utils.nitro.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts +1 -0
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/lib/typescript/utils/timingSafeEqual.d.ts +3 -0
- package/lib/typescript/utils/timingSafeEqual.d.ts.map +1 -0
- package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +1 -0
- package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +10 -0
- package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +10 -0
- package/nitrogen/generated/shared/c++/HybridHashSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridHmacSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridUtilsSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridUtilsSpec.hpp +63 -0
- package/package.json +2 -2
- package/src/hash.ts +6 -1
- package/src/hmac.ts +6 -1
- package/src/keys/publicCipher.ts +46 -26
- package/src/specs/hash.nitro.ts +1 -1
- package/src/specs/hmac.nitro.ts +1 -1
- package/src/specs/rsaCipher.nitro.ts +20 -3
- package/src/specs/utils.nitro.ts +5 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/timingSafeEqual.ts +23 -0
- package/react-native.config.js +0 -19
- package/scripts/embed_openssl_framework.sh +0 -18
- /package/cpp/utils/{Utils.hpp → QuickCryptoUtils.hpp} +0 -0
package/src/utils/index.ts
CHANGED
|
@@ -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
|
+
}
|
package/react-native.config.js
DELETED
|
@@ -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
|