Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/BUILD_ERROR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ body:
"react-native": "^0.74.3",
"react-native-quick-crypto": "^0.7.1",
"@craftzdog/react-native-buffer": "^6.0.5",
"react-native-fast-encoder": "^0.1.12",
"react-native-quick-base64": "^2.1.2",
...
},
Expand Down
15 changes: 5 additions & 10 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
"react": "19.1.0",
"react-native": "0.81.1",
"react-native-bouncy-checkbox": "4.1.2",
"react-native-fast-encoder": "0.2.0",
"react-native-nitro-modules": "0.29.1",
"react-native-quick-base64": "2.2.1",
"react-native-quick-base64": "2.2.2",
"react-native-quick-crypto": "workspace:*",
"react-native-safe-area-context": "^5.2.2",
"react-native-screens": "4.15.4",
Expand Down Expand Up @@ -83,7 +82,7 @@
"@craftzdog/react-native-buffer": "6.1.0",
"events": "3.3.0",
"expo-build-properties": "0.14.6",
"react-native-quick-base64": "2.2.0",
"react-native-quick-base64": "2.2.2",
"readable-stream": "4.5.2",
"util": "0.12.5",
},
Expand Down Expand Up @@ -1396,8 +1395,6 @@

"flat-cache": ["[email protected]", "", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" } }, "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw=="],

"flatbuffers": ["[email protected]", "", {}, "sha512-QTTZTXTbVfuOVQu2X6eLOw4vefUxnFJZxAKeN3rEPhjEzBtIbehimJLfVGHPM8iX0Na+9i76SBEg0skf0c0sCA=="],

"flatted": ["[email protected]", "", {}, "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw=="],

"flow-enums-runtime": ["[email protected]", "", {}, "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw=="],
Expand Down Expand Up @@ -2190,13 +2187,11 @@

"react-native-builder-bob": ["[email protected]", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-transform-strict-mode": "^7.24.7", "@babel/preset-env": "^7.25.2", "@babel/preset-flow": "^7.24.7", "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "babel-plugin-module-resolver": "^5.0.2", "browserslist": "^4.20.4", "cross-spawn": "^7.0.3", "dedent": "^0.7.0", "del": "^6.1.1", "escape-string-regexp": "^4.0.0", "fs-extra": "^10.1.0", "glob": "^8.0.3", "is-git-dirty": "^2.0.1", "json5": "^2.2.1", "kleur": "^4.1.4", "metro-config": "^0.80.9", "prompts": "^2.4.2", "which": "^2.0.2", "yargs": "^17.5.1" }, "bin": { "bob": "bin/bob" } }, "sha512-nEG9FB5a2Rxw0251dnlM9QtqvuM2os8avRhYDWDdvsZOnQJhQI4fGV5wF5FypAqHNWPQUNXmvhPUFrPSwiPnAQ=="],

"react-native-fast-encoder": ["[email protected]", "", { "dependencies": { "big-integer": "^1.6.51", "flatbuffers": "2.0.6" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-E4mx81fRMVs0qq8is3cZTrbuEJdsDo8Nfe7qTxKZwsCianpYpA2QfyH6cEYumSOEht6l+KeRJ4RqcyfxMDyesg=="],

"react-native-is-edge-to-edge": ["[email protected]", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-FLbPWl/MyYQWz+KwqOZsSyj2JmLKglHatd3xLZWskXOpRaio4LfEDEz8E/A6uD8QoTHW6Aobw1jbEwK7KMgR7Q=="],

"react-native-nitro-modules": ["[email protected]", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-91A/Lc4Zc1Bvzj1iMSnD6vA5Swqv8aVcwGcv8ddjoPd9mahNvVS2arFh3o7kAqRH4RIh3KcQ0NpYslu7AYn55Q=="],

"react-native-quick-base64": ["[email protected].0", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-r7/BRsRl8QKEhS0JsHW6QX9+8LrC6NNWlwNnBnZ69h2kbcfABYsUILT71obrs9fqElEIMzuYSI5aHID955akyQ=="],
"react-native-quick-base64": ["[email protected].2", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-WLHSifHLoamr2kF00Gov0W9ud6CfPshe1rmqWTquVIi9c62qxOaJCFVDrXFZhEBU8B8PvGLVuOlVKH78yhY0Fg=="],

"react-native-quick-crypto": ["react-native-quick-crypto@workspace:packages/react-native-quick-crypto"],

Expand Down Expand Up @@ -2908,6 +2903,8 @@

"@conventional-changelog/git-client/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A=="],

"@craftzdog/react-native-buffer/react-native-quick-base64": ["[email protected]", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-r7/BRsRl8QKEhS0JsHW6QX9+8LrC6NNWlwNnBnZ69h2kbcfABYsUILT71obrs9fqElEIMzuYSI5aHID955akyQ=="],

"@eslint-community/eslint-utils/eslint-visitor-keys": ["[email protected]", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],

"@eslint/plugin-kit/@eslint/core": ["@eslint/[email protected]", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw=="],
Expand Down Expand Up @@ -3544,8 +3541,6 @@

"react-native-quick-crypto-example/@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-cMoR+FoAf/Jyq6+Df2/Z41jISvGZZ2eTlnsaJRptmZ76Caldwy1odD4xTr/gNV9VLj0AWgg/nmkevIyUfIIq5w=="],

"react-native-quick-crypto-example/react-native-quick-base64": ["[email protected]", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-rAECaDhq3v+P8IM10cLgUVvt3kPJq3v+Jznp7tQRLXk1LlV/VCepump3am0ObwHlE6EoXblm4cddPJoXAlO+CQ=="],

"read-package-up/type-fest": ["[email protected]", "", {}, "sha512-bRkIGlXsnGBRBQRAY56UXBm//9qH4bmJfFvq83gSz41N282df+fjy8ofcEgc1sM8geNt5cl6mC2g9Fht1cs8Aw=="],

"read-pkg/parse-json": ["[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.22.13", "index-to-position": "^0.1.2", "type-fest": "^4.7.1" } }, "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA=="],
Expand Down
4 changes: 2 additions & 2 deletions docs/implementation-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ This document attempts to describe the implementation status of Crypto APIs/Inte
### `CryptoKeyPair` algorithms
| Algorithm | Status |
| --------- | :----: |
| `ECDH` | |
| `ECDSA` | |
| `ECDH` | |
| `ECDSA` | |
| `Ed25519` | ❌ |
| `Ed448` | ❌ |
| `ML-DSA-44` | ❌ |
Expand Down
34 changes: 4 additions & 30 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1331,29 +1331,7 @@ PODS:
- React-RCTFBReactNativeSpec
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- react-native-fast-encoder (0.2.0):
- hermes-engine
- RCTRequired
- RCTTypeSafety
- React-Core
- React-Core-prebuilt
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-jsi
- React-NativeModulesApple
- React-RCTFabric
- React-renderercss
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- Yoga
- react-native-quick-base64 (2.2.1):
- react-native-quick-base64 (2.2.2):
- React-Core
- react-native-safe-area-context (5.6.1):
- hermes-engine
Expand Down Expand Up @@ -1884,8 +1862,7 @@ DEPENDENCIES:
- React-logger (from `../../node_modules/react-native/ReactCommon/logger`)
- React-Mapbuffer (from `../../node_modules/react-native/ReactCommon`)
- React-microtasksnativemodule (from `../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
- react-native-fast-encoder (from `../../node_modules/react-native-fast-encoder`)
- react-native-quick-base64 (from `../node_modules/react-native-quick-base64`)
- react-native-quick-base64 (from `../../node_modules/react-native-quick-base64`)
- react-native-safe-area-context (from `../../node_modules/react-native-safe-area-context`)
- React-NativeModulesApple (from `../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
- React-oscompat (from `../../node_modules/react-native/ReactCommon/oscompat`)
Expand Down Expand Up @@ -2002,10 +1979,8 @@ EXTERNAL SOURCES:
:path: "../../node_modules/react-native/ReactCommon"
React-microtasksnativemodule:
:path: "../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
react-native-fast-encoder:
:path: "../../node_modules/react-native-fast-encoder"
react-native-quick-base64:
:path: "../node_modules/react-native-quick-base64"
:path: "../../node_modules/react-native-quick-base64"
react-native-safe-area-context:
:path: "../../node_modules/react-native-safe-area-context"
React-NativeModulesApple:
Expand Down Expand Up @@ -2116,8 +2091,7 @@ SPEC CHECKSUMS:
React-logger: a1c9c8dfc56711d06a21109b55908e177113e554
React-Mapbuffer: bc36232966c55d5b1cbef3b84cb97c4317fa4403
React-microtasksnativemodule: cbabfedcf6c2984e59d07f9ab553f3d277599b1b
react-native-fast-encoder: f65266038936a5ade3a54d34755fce3c7bd92483
react-native-quick-base64: 7b7f689c9b7b4d40916bf5d27e211db1040abac5
react-native-quick-base64: 6568199bb2ac8e72ecdfdc73a230fbc5c1d3aac4
react-native-safe-area-context: 42a1b4f8774b577d03b53de7326e3d5757fe9513
React-NativeModulesApple: 055e2d1417c663e7a26fc0847609f503e626e9e1
React-oscompat: 8f2893713639e12c7558750a9f7de3f08ac255b0
Expand Down
3 changes: 1 addition & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@
"react": "19.1.0",
"react-native": "0.81.1",
"react-native-bouncy-checkbox": "4.1.2",
"react-native-fast-encoder": "0.2.0",
"react-native-nitro-modules": "0.29.1",
"react-native-quick-base64": "2.2.1",
"react-native-quick-base64": "2.2.2",
"react-native-quick-crypto": "workspace:*",
"react-native-safe-area-context": "^5.2.2",
"react-native-screens": "4.15.4",
Expand Down
4 changes: 0 additions & 4 deletions example/src/tests/subtle/encrypt_decrypt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ import aes_gcm_fixtures from '../../fixtures/aes_gcm';
import { assertThrowsAsync } from '../util';
import { ab2str } from 'react-native-quick-crypto';

import RNFE from 'react-native-fast-encoder';
// @ts-expect-error polyfill types are wonky
globalThis.TextEncoder = () => RNFE;

export type RsaEncryptDecryptTestVector = {
name: string;
publicKey: Buffer | null;
Expand Down
6 changes: 4 additions & 2 deletions example/src/tests/subtle/sign_verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { expect } from 'chai';

const encoder = new TextEncoder();

const SUITE = 'subtle.sign/verify';

// // Test Sign/Verify RSASSA-PKCS1-v1_5
// {
// async function test(data) {
Expand Down Expand Up @@ -53,7 +55,7 @@ const encoder = new TextEncoder();
// test('hello world').then(common.mustCall());
// }

test('subtle.sign_verify', 'ECDSA P-384', async () => {
test(SUITE, 'ECDSA P-384', async () => {
const pair = await subtle.generateKey(
{ name: 'ECDSA', namedCurve: 'P-384' },
true,
Expand All @@ -78,7 +80,7 @@ test('subtle.sign_verify', 'ECDSA P-384', async () => {
).to.equal(true);
});

test('subtle.sign_verify', 'ECDSA with HashAlgorithmIdentifier', async () => {
test(SUITE, 'ECDSA with HashAlgorithmIdentifier', async () => {
const pair = await subtle.generateKey(
{ name: 'ECDSA', namedCurve: 'P-256' },
true,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-quick-crypto/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_library(
../cpp/cipher/XSalsa20Cipher.cpp
../cpp/cipher/ChaCha20Cipher.cpp
../cpp/cipher/ChaCha20Poly1305Cipher.cpp
../cpp/ec/HybridEcKeyPair.cpp
../cpp/ed25519/HybridEdKeyPair.cpp
../cpp/hash/HybridHash.cpp
../cpp/hmac/HybridHmac.cpp
Expand All @@ -33,6 +34,7 @@ include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/QuickCrypto+autolinkin
include_directories(
"src/main/cpp"
"../cpp/cipher"
"../cpp/ec"
"../cpp/ed25519"
"../cpp/hash"
"../cpp/hmac"
Expand All @@ -42,8 +44,6 @@ include_directories(
"../cpp/utils"
"../deps/fastpbkdf2"
"../deps/ncrypto/include"
"../build/includes" # flattened Nitro Modules headers
"../../../node_modules/react-native/ReactCommon/jsi"
)

# Third party libraries (Prefabs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ class HybridCipherFactory : public HybridCipherFactorySpec {
// Pass tag length (default 16 if not present)
size_t tag_len = args.authTagLen.has_value() ? static_cast<size_t>(args.authTagLen.value()) : 16;
std::static_pointer_cast<OCBCipher>(cipherInstance)->init(args.cipherKey, args.iv, tag_len);
EVP_CIPHER_free(cipher);
return cipherInstance;
}
case EVP_CIPH_CCM_MODE: {
cipherInstance = std::make_shared<CCMCipher>();
cipherInstance->setArgs(args);
cipherInstance->init(args.cipherKey, args.iv);
EVP_CIPHER_free(cipher);
return cipherInstance;
}
case EVP_CIPH_STREAM_CIPHER: {
Expand All @@ -55,12 +57,14 @@ class HybridCipherFactory : public HybridCipherFactorySpec {
cipherInstance = std::make_shared<ChaCha20Cipher>();
cipherInstance->setArgs(args);
cipherInstance->init(args.cipherKey, args.iv);
EVP_CIPHER_free(cipher);
return cipherInstance;
}
if (cipherName == "chacha20-poly1305") {
cipherInstance = std::make_shared<ChaCha20Poly1305Cipher>();
cipherInstance->setArgs(args);
cipherInstance->init(args.cipherKey, args.iv);
EVP_CIPHER_free(cipher);
return cipherInstance;
}
}
Expand All @@ -69,6 +73,7 @@ class HybridCipherFactory : public HybridCipherFactorySpec {
cipherInstance = std::make_shared<HybridCipher>();
cipherInstance->setArgs(args);
cipherInstance->init(args.cipherKey, args.iv);
EVP_CIPHER_free(cipher);
return cipherInstance;
}
}
Expand Down
Loading
Loading