react-native-quick-crypto 1.0.4 → 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.
- package/QuickCrypto.podspec +21 -7
- package/android/CMakeLists.txt +1 -0
- package/cpp/cipher/HybridRsaCipher.cpp +111 -25
- package/cpp/cipher/HybridRsaCipher.hpp +5 -1
- package/cpp/hash/HybridHash.cpp +11 -4
- package/cpp/hash/HybridHash.hpp +1 -1
- package/cpp/hmac/HybridHmac.cpp +13 -4
- package/cpp/hmac/HybridHmac.hpp +2 -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 +3 -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/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
|
-
};
|