Skip to content

Commit 1625b10

Browse files
authored
chore: cleanup (#847)
1 parent be541d6 commit 1625b10

16 files changed

+151
-289
lines changed

.claude/agents/cpp-specialist.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: cpp-specialist
3-
description: Use PROACTIVELY for all C++ code, Nitro Modules implementation, OpenSSL 3.3+ integration, and native performance optimization
3+
description: Use PROACTIVELY for all C++ code, Nitro Modules implementation, OpenSSL 3.6+ integration, and native performance optimization
44
---
55

66
# C++ Implementation Specialist
@@ -11,7 +11,7 @@ You are a C++ specialist focused on the native layer of React Native Quick Crypt
1111

1212
- C++20 modern code
1313
- Nitro Modules native implementation
14-
- OpenSSL 3.3+ integration
14+
- OpenSSL 3.6+ integration
1515
- Native cryptographic operations
1616
- Memory management with smart pointers
1717
- Performance optimization
@@ -37,13 +37,13 @@ You are a C++ specialist focused on the native layer of React Native Quick Crypt
3737
// ... forget to free
3838
```
3939

40-
2. **OpenSSL 3.3+ APIs**
40+
2. **OpenSSL 3.6+ APIs**
4141
- Use EVP_* high-level APIs (not deprecated low-level)
4242
- Proper error handling with ERR_get_error()
4343
- Provider-based architecture where applicable
4444
- Check Node.js `deps/ncrypto` for reference patterns
4545
```cpp
46-
// GOOD: OpenSSL 3.3 EVP API
46+
// GOOD: OpenSSL 3.6+ EVP API
4747
EVP_CIPHER_CTX* ctx = EVP_CIPHER_CTX_new();
4848
EVP_EncryptInit_ex2(ctx, EVP_aes_256_gcm(), key, iv, nullptr);
4949

@@ -105,19 +105,13 @@ When implementing features, check in order:
105105
106106
1. **Node.js ncrypto** (primary reference)
107107
- `$REPOS/node/deps/ncrypto` - Node.js externalized crypto
108-
- May need updating to OpenSSL 3.3+ patterns
108+
- May need updating to OpenSSL 3.6+ patterns
109109
- Best source for algorithm implementations
110110
111-
2. **OpenSSL 3.3+ Documentation**
111+
2. **OpenSSL 3.6+ Documentation**
112112
- EVP API documentation
113-
- Migration guide from 1.1.1 to 3.3+
114113
- Provider API for modern patterns
115114
116-
3. **RNQC 0.x** (migration reference only)
117-
- `$REPOS/rnqc/0.x` - Old implementation
118-
- Uses OpenSSL 1.1.1 (deprecated)
119-
- Don't copy patterns, use for comparison only
120-
121115
## Common Patterns
122116
123117
### Pattern 1: EVP Cipher Context (AEAD)
@@ -269,17 +263,6 @@ public:
269263
} // namespace
270264
```
271265
272-
## Migration from OpenSSL 1.1.1 to 3.3+
273-
274-
Common changes needed:
275-
276-
| OpenSSL 1.1.1 | OpenSSL 3.3+ |
277-
|---------------|-------------|
278-
| `AES_set_encrypt_key()` | `EVP_EncryptInit_ex2()` with `EVP_aes_*()` |
279-
| `SHA256()` | `EVP_Digest()` with `EVP_sha256()` |
280-
| Direct struct access | Use EVP getters/setters |
281-
| Low-level APIs | High-level EVP APIs |
282-
283266
## Quality Checks
284267
285268
Before marking task complete:
@@ -291,7 +274,7 @@ Before marking task complete:
291274
- [ ] No raw pointer ownership
292275
293276
2. **OpenSSL Integration**
294-
- [ ] Using OpenSSL 3.3+ APIs
277+
- [ ] Using OpenSSL 3.6+ APIs
295278
- [ ] No deprecated functions
296279
- [ ] Proper error handling
297280
- [ ] Error queue cleared
@@ -311,10 +294,9 @@ Before marking task complete:
311294
## Tools & References
312295
313296
- C++20 compiler
314-
- OpenSSL 3.3+ headers and libraries
297+
- OpenSSL 3.6+ headers and libraries
315298
- Nitro Modules SDK
316299
- Node.js ncrypto source (`$REPOS/node/deps/ncrypto`)
317-
- RNQC 0.x reference (`$REPOS/rnqc/0.x`)
318300
319301
## Collaboration
320302
@@ -323,4 +305,4 @@ You work closely with:
323305
- **crypto-specialist**: Validate algorithm implementations
324306
- **testing-specialist**: Provide testable native APIs
325307
326-
Remember: Write modern, safe, efficient C++ that properly integrates OpenSSL 3.3+ cryptographic operations into React Native via Nitro Modules.
308+
Remember: Write modern, safe, efficient C++ that properly integrates OpenSSL 3.6+ cryptographic operations into React Native via Nitro Modules.

.claude/agents/crypto-specialist.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ When reviewing a cryptographic implementation:
229229

230230
## Tools & References
231231

232-
- OpenSSL documentation (v3.3+)
232+
- OpenSSL documentation (v3.6+)
233233
- NIST cryptographic standards
234234
- RFC specifications
235235
- WebCrypto API spec (W3C)
236236
- Node.js ncrypto source (`$REPOS/node/deps/ncrypto`)
237-
- RNQC 0.x for compatibility (`$REPOS/rnqc/0.x`)
237+
- ncrypto (`$REPOS/ncrypto`)
238238

239239
## Common Questions to Ask
240240

.claude/agents/orchestrator.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ When you receive a request:
4747

4848
4. **Assign to specialists**
4949
- typescript-specialist: TypeScript API surface, types, JS implementations
50-
- cpp-specialist: C++ Nitro Modules, OpenSSL 3.3+ integration, native code
50+
- cpp-specialist: C++ Nitro Modules, OpenSSL 3.6+ integration, native code
5151
- crypto-specialist: Cryptographic correctness, algorithm implementation, security
5252
- testing-specialist: Test strategies (note: tests run in RN app environment)
5353

@@ -58,7 +58,7 @@ When you receive a request:
5858
User Request: "Implement subtle.encrypt/decrypt for AES-GCM"
5959
6060
Orchestrator analyzes:
61-
- Scope: TypeScript API, C++ implementation, OpenSSL 3.3+
61+
- Scope: TypeScript API, C++ implementation, OpenSSL 3.6+
6262
- Requires: Type definitions, native implementation, bridging
6363
6464
Decomposition:
@@ -67,7 +67,7 @@ Wave 1 (Foundation):
6767
- typescript-specialist: Define TypeScript types matching WebCrypto API
6868
6969
Wave 2 (Implementation):
70-
- cpp-specialist: Implement AES-GCM using OpenSSL 3.3+ EVP APIs
70+
- cpp-specialist: Implement AES-GCM using OpenSSL 3.6+ EVP APIs
7171
- typescript-specialist: Create Nitro Module bindings
7272
7373
Wave 3 (Validation):
@@ -77,7 +77,7 @@ Wave 3 (Validation):
7777

7878
### Example 2: Refactoring to Modern C++
7979
```
80-
User Request: "Migrate hash functions from OpenSSL 1.1.1 to 3.3+"
80+
User Request: "Migrate hash functions from OpenSSL 1.1.1 to 3.6+"
8181
8282
Orchestrator analyzes:
8383
- Scope: Multiple C++ files, OpenSSL API changes
@@ -86,7 +86,7 @@ Orchestrator analyzes:
8686
Decomposition:
8787
Wave 1 (Research):
8888
- cpp-specialist: Identify all OpenSSL 1.1.1 usage patterns
89-
- crypto-specialist: Map deprecated APIs to OpenSSL 3.3+ equivalents
89+
- crypto-specialist: Map deprecated APIs to OpenSSL 3.6+ equivalents
9090
9191
Wave 2 (Migration):
9292
- cpp-specialist: Update to EVP_* APIs, modernize C++ patterns
@@ -110,7 +110,7 @@ Wave 1 (Specification):
110110
- typescript-specialist: Define TypeScript API matching Node.js
111111
112112
Wave 2 (Implementation):
113-
- cpp-specialist: Implement using OpenSSL 3.3+ PBKDF2
113+
- cpp-specialist: Implement using OpenSSL 3.6+ PBKDF2
114114
- typescript-specialist: Create JS wrapper with Node.js semantics
115115
116116
Wave 3 (Compatibility):

.claude/agents/typescript-specialist.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ You are a TypeScript specialist focused on the JavaScript/TypeScript layer of Re
5353
3. **API Compatibility Priority**
5454
- WebCrypto API first (for subtle.* methods)
5555
- Node.js API second (for crypto.* polyfills)
56-
- 0.x compatibility third (for migration)
57-
- Check Node.js `deps/ncrypto` for reference implementations
56+
- ncrypto compatibility third (for working w/ OpenSSL)
57+
- Check Node.js's separate repo `$REPOS/ncrypto` for reference implementations
5858

5959
**HIGH - ENFORCE STRICTLY:**
6060

@@ -125,11 +125,6 @@ When implementing features, check in order:
125125
2. **Node.js** (for `crypto.*` polyfills)
126126
- `$REPOS/node/deps/ncrypto` - Node.js crypto externalization
127127
- Node.js crypto module documentation
128-
- May need updating to OpenSSL 3.3+
129-
130-
3. **RNQC 0.x** (for migration reference)
131-
- `$REPOS/rnqc/0.x` - Old implementation
132-
- Uses OpenSSL 1.1.1 (deprecated patterns)
133128

134129
## Common Patterns
135130

.claude/rules/architecture.xml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<item>This is a React Native project that offers cryptographic operations in native code</item>
1111
<item>Uses Nitro Modules to bridge JavaScript and C++</item>
1212
<item>Part of the API strives to be a polyfill of the Node.js crypto module</item>
13-
<item>Goal: Migrate from OpenSSL 1.1.1 to OpenSSL 3.3+ with modern C++ and Nitro Modules</item>
1413
</context>
1514
<mustAcknowledge>true</mustAcknowledge>
1615
</rule>
@@ -30,12 +29,12 @@
3029
</priority>
3130
<priority>
3231
<rank>3</rank>
33-
<source>RNQC 0.x Implementation</source>
34-
<rationale>Legacy reference at $REPOS/rnqc/0.x (uses OpenSSL 1.1.1, deprecated)</rationale>
32+
<source>ncrypto Implementation</source>
33+
<rationale>reference at $REPOS/ncrypto (now a separate repo from nodejs)</rationale>
3534
</priority>
3635
<mustAcknowledge>true</mustAcknowledge>
3736
<instructions>
38-
Always check Node.js deps/ncrypto before implementing new features. It may need upgrading to OpenSSL 3.3+ patterns.
37+
Always check Node.js deps/ncrypto before implementing new features. It may need upgrading to OpenSSL 3.6+ patterns.
3938
</instructions>
4039
</rule>
4140

@@ -47,8 +46,8 @@
4746
<tool>TypeScript - Type system</tool>
4847
<tool>Nitro Modules - Native bridging</tool>
4948
<tool>C++20 or higher - Modern C++</tool>
50-
<tool>OpenSSL 3.3+ - Cryptographic library</tool>
51-
<tool>Bun 1.2+ - TypeScript package manager</tool>
49+
<tool>OpenSSL 3.6+ - Cryptographic library</tool>
50+
<tool>Bun 1.3+ - TypeScript package manager</tool>
5251
</stack>
5352
<instructions>
5453
Use modern features from each technology. No legacy patterns.
@@ -87,16 +86,16 @@
8786
<reference>
8887
<path>$REPOS/node</path>
8988
<description>Node.js source code</description>
90-
<focus>deps/ncrypto - Externalized crypto code, use as reference for implementations</focus>
89+
<focus>use as reference for crypto/subtle implementations</focus>
9190
</reference>
9291
<reference>
93-
<path>$REPOS/rnqc/0.x</path>
94-
<description>RNQC 0.x legacy branch</description>
95-
<focus>Uses OpenSSL 1.1.1 - migration reference only, don't copy patterns</focus>
92+
<path>$REPOS/ncrypto</path>
93+
<description>ncrypto sharable library used by Node.js</description>
94+
<focus>Abstracts OpenSSL calls and utilities from Node.js code</focus>
9695
</reference>
9796
</references>
9897
<instructions>
99-
Update this library's copy of ncrypto patterns occasionally when implementing new features.
98+
Update this library's submodule of ncrypto occasionally when implementing new features.
10099
</instructions>
101100
</rule>
102101

.claude/rules/code-cpp.xml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
</rule>
4646

4747
<rule severity="CRITICAL" enforcement="BLOCKING">
48-
<name>OpenSSL 3.3+ APIs Only</name>
49-
<description>Use OpenSSL 3.3+ or higher EVP APIs, no deprecated functions</description>
48+
<name>OpenSSL 3.6+ APIs Only</name>
49+
<description>Use OpenSSL 3.6+ or higher EVP APIs, no deprecated functions</description>
5050
<requirements>
5151
<requirement>EVP high-level APIs only</requirement>
5252
<requirement>No low-level deprecated APIs (AES_*, SHA256_*, etc.)</requirement>
@@ -69,7 +69,7 @@
6969
</migrations>
7070
<mustAcknowledge>true</mustAcknowledge>
7171
<rationale>
72-
OpenSSL 1.1.1 is deprecated. OpenSSL 3.x provides better security, performance, and future support.
72+
OpenSSL 3.6+ provides better security, performance, and future support.
7373
</rationale>
7474
</rule>
7575

@@ -146,18 +146,12 @@
146146
<name>Node.js ncrypto</name>
147147
<path>$REPOS/node/deps/ncrypto</path>
148148
<description>Node.js externalized crypto code - primary reference</description>
149-
<note>May need updating to OpenSSL 3.3+ patterns</note>
149+
<note>May need updating to OpenSSL 3.6+ patterns</note>
150150
</source>
151151
<source priority="2">
152-
<name>OpenSSL 3.3+ Documentation</name>
152+
<name>OpenSSL 3.6+ Documentation</name>
153153
<description>Official OpenSSL API documentation and migration guides</description>
154154
</source>
155-
<source priority="3">
156-
<name>RNQC 0.x</name>
157-
<path>$REPOS/rnqc/0.x</path>
158-
<description>Legacy implementation - migration reference only</description>
159-
<warning>Uses OpenSSL 1.1.1 - don't copy patterns directly</warning>
160-
</source>
161155
</sources>
162156
</rule>
163157

@@ -182,7 +176,7 @@
182176
<setting>C++20 minimum standard</setting>
183177
<setting>Enable all warnings (-Wall -Wextra)</setting>
184178
<setting>Treat warnings as errors</setting>
185-
<setting>Link against OpenSSL 3.3+</setting>
179+
<setting>Link against OpenSSL 3.6+</setting>
186180
</settings>
187181
</rule>
188182

CLAUDE.md

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This project uses the **4-Layer Orchestra Architecture** for efficient multi-age
1515
When implementing features, favor in this order:
1616
1. **WebCrypto API** - Modern standard, best for `subtle.*` methods
1717
2. **Node.js Implementation** - Use `$REPOS/node/deps/ncrypto` as reference
18-
3. **RNQC 0.x** - Legacy reference at `$REPOS/rnqc/0.x` (OpenSSL 1.1.1, deprecated)
18+
3. **ncrypto** - submodule code reference at `$REPOS/ncrypto` (do work w/ OpenSSL)
1919

2020
**Always check Node.js `deps/ncrypto` before implementing new features.**
2121

@@ -24,8 +24,8 @@ When implementing features, favor in this order:
2424
- **TypeScript** - Type system (strict mode, no `any`)
2525
- **Nitro Modules** - Native bridging
2626
- **C++20 or higher** - Modern C++ (smart pointers, RAII)
27-
- **OpenSSL 3.3+** - Cryptographic library (EVP APIs only)
28-
- **Bun 1.2+** - TypeScript package manager
27+
- **OpenSSL 3.6+** - Cryptographic library (EVP APIs only)
28+
- **Bun 1.3+** - TypeScript package manager
2929

3030
### 3. Code Philosophy
3131
- Minimize code rather than add more
@@ -40,26 +40,13 @@ When implementing features, favor in this order:
4040
- No key material in errors/logs
4141
- Validate against test vectors (NIST, RFC, Node.js)
4242

43-
## Project Structure
44-
45-
```
46-
react-native-quick-crypto/
47-
├── src/ # TypeScript source
48-
├── cpp/ # C++ native implementation
49-
├── example/ # React Native test app
50-
51-
├── .claude/ # Orchestration configuration
52-
├── agents/ # Specialist agent definitions
53-
└── rules/ # XML rules for context management
54-
```
55-
5643
## Rules Summary
5744

5845
For full details, see `.claude/rules/*.xml`:
5946

6047
### architecture.xml
6148
- Project context and goals
62-
- API priority order (WebCrypto → Node.js → 0.x)
49+
- API priority order (WebCrypto → Node.js → ncrypto)
6350
- Tech stack requirements
6451
- Code philosophy
6552
- Testing context (RN environment)
@@ -77,7 +64,7 @@ For full details, see `.claude/rules/*.xml`:
7764
### code-cpp.xml
7865
- C++20 minimum with modern features
7966
- Smart pointers for all ownership
80-
- OpenSSL 3.3+ EVP APIs only (no deprecated)
67+
- OpenSSL 3.6+ EVP APIs only (no deprecated)
8168
- RAII for all resources
8269
- Proper error handling (ERR_get_error)
8370
- Memory safety (no leaks, no raw ownership)
@@ -119,11 +106,11 @@ Use these instead of web searches:
119106

120107
- **Node.js**: `$REPOS/node`
121108
- `deps/ncrypto` - Use as bible for crypto operations
122-
- May need updating to OpenSSL 3.3+ patterns
109+
- May need updating to OpenSSL 3.6+ patterns
123110

124-
- **RNQC 0.x**: `$REPOS/rnqc/0.x`
125-
- Legacy branch (OpenSSL 1.1.1)
126-
- Migration reference only, don't copy patterns
111+
- **ncrypto**: `$REPOS/ncrypto`
112+
- separate crypto lib broken out from Node.js
113+
- Patterns and tools to access OpenSSL
127114

128115
## Testing
129116

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
A fast implementation of Node's `crypto` module.
1212

13-
> Note: This version `1.x` completed a major refactor, porting to OpenSSL 3.3+, New Architecture, Bridgeless, and [`Nitro Modules`](https://github.com/mrousavy/react-native-nitro). It should be at or above feature-parity compared to the `0.x` version. Status, as always, will be represented in [implementation-coverage.md](../main/docs/implementation-coverage.md).
13+
> Note: This version `1.x` completed a major refactor, porting to OpenSSL 3.6+, New Architecture, Bridgeless, and [`Nitro Modules`](https://github.com/mrousavy/react-native-nitro). It should be at or above feature-parity compared to the `0.x` version. Status, as always, will be represented in [implementation-coverage.md](../main/docs/implementation-coverage.md).
1414
1515
> Note: Minimum supported version of React Native is `0.75`. If you need to use earlier versions, please use `0.x` versions of this library.
1616

0 commit comments

Comments
 (0)