Skip to content

Commit bf54e78

Browse files
authored
feat: subtle.sign/verify for ec (#791)
1 parent 940daaf commit bf54e78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2484
-3147
lines changed

.cursorrules

Lines changed: 0 additions & 1 deletion
This file was deleted.

.windsurf/rules/cpp.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
trigger: glob
3+
globs: *.cpp,*.hpp
4+
---
5+
6+
## C++
7+
- Use smart pointers in C++.
8+
- Use modern C++ features.
9+
- Set up builds for C++ 20, no lower

.windsurf/rules/local.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
trigger: always_on
3+
---
4+
5+
# Local Codebases
6+
7+
Use these instead of web searches for Node and 0.x branch:
8+
9+
- NodeJS code is located at `$HOME/dev/node`
10+
- use its `deps/ncrypto` code as a bible for crypto operations, and update this library's copy occasionally when we're implementing new features
11+
12+
- The old 0.x branch codebase is located at `$HOME/dev/rnqc/0.x`
Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
trigger: always_on
3+
---
4+
15
# React Native Quick Crypto
26

37
Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
@@ -10,6 +14,7 @@ Every time you choose to apply a rule(s), explicitly state the rule(s) in the ou
1014
- Part of the API strives to be a polyfill of the Node.js `{crypto}` module.
1115
- When in doubt, favor in order: WebCrypto API, NodeJS implementation, 0.x implementation
1216
- The goal is to migrate 0.x of this library that uses OpenSSL 1.1.1 to now use OpenSSL 3.3 and modern C++ with Nitro Modules.
17+
- NodeJS code has the `deps/ncrypto` library where they are externalizing cryptography code using OpenSSL from the main guts of Node. Try to use this before anything else when adding new features and/or troubleshooting. It may still need upgrading to OpenSSL 3.3+
1318

1419
## Tech Stack
1520

@@ -19,39 +24,11 @@ Every time you choose to apply a rule(s), explicitly state the rule(s) in the ou
1924
- C++ 20 and higher, modern
2025
- OpenSSL 3.3 and higher
2126
- TypeScript package manager is `bun` 1.2 or higher
22-
- Don't ask to run tests. They have to be run in an example React Native app.
2327

2428
## Rules
2529

26-
- Use smart pointers in C++.
27-
- Use modern C++ features.
2830
- Attempt to reduce the amount of code rather than add more.
2931
- Prefer iteration and modularization over code duplication.
3032
- Do not add comments unless explicitly told to do so, or the code is sufficiently complex to warrant comments.
33+
- Don't ask to run tests. They have to be run in an example React Native app.
3134

32-
## TypeScript Best Practices
33-
34-
- Use TypeScript for all code; prefer interfaces over types.
35-
- Use lowercase with dashes for directories (e.g., `components/auth-wizard`).
36-
- Favor named exports for components.
37-
- Avoid `any` and enums; use explicit types and maps instead.
38-
- Do not cast to `unknown` and then another type.
39-
- Use functional components with TypeScript interfaces.
40-
- Enable strict mode in TypeScript for better type safety.
41-
- Suggest the optimal implementation considering:
42-
- Performance impact
43-
- Maintenance overhead
44-
- Testing strategy
45-
- Code examples should follow TypeScript best practices.
46-
47-
## React Best Practices
48-
49-
- Minimize the use of `useEffect`. They should be a last resort.
50-
- Use named functions for `useEffect`s with a meaningful function name. Avoid adding unnecessary comments on effect behavior.
51-
52-
## Syntax & Formatting
53-
54-
- Use the `function` keyword for pure functions.
55-
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
56-
- Use declarative JSX.
57-
- Use Prettier for consistent code formatting.

.windsurf/rules/typescript.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
trigger: glob
3+
globs: *.ts,*.tsx
4+
---
5+
6+
## TypeScript Best Practices
7+
8+
- Use TypeScript for all code; prefer interfaces over types.
9+
- Use lowercase with dashes for directories (e.g., `components/auth-wizard`).
10+
- Favor named exports for components.
11+
- Avoid `any` and enums; use explicit types and maps instead.
12+
- Do not cast to `unknown` and then another type.
13+
- Use functional components with TypeScript interfaces.
14+
- Enable strict mode in TypeScript for better type safety.
15+
- Suggest the optimal implementation considering:
16+
- Performance impact
17+
- Maintenance overhead
18+
- Testing strategy
19+
- Code examples should follow TypeScript best practices.
20+
21+
## React Best Practices
22+
23+
- Minimize the use of `useEffect`. They should be a last resort.
24+
- Use named functions for `useEffect`s with a meaningful function name. Avoid adding unnecessary comments on effect behavior.
25+
26+
## Syntax & Formatting
27+
28+
- Use the `function` keyword for pure functions.
29+
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
30+
- Use declarative JSX.
31+
- Use Prettier for consistent code formatting.

.windsurfrules

Lines changed: 0 additions & 1 deletion
This file was deleted.

bun.lock

Lines changed: 342 additions & 144 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/implementation-coverage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ This document attempts to describe the implementation status of Crypto APIs/Inte
400400
## `subtle.sign`
401401
| Algorithm | Status |
402402
| --------- | :----: |
403-
| `ECDSA` | |
403+
| `ECDSA` | |
404404
| `Ed25519` ||
405405
| `Ed448` ||
406406
| `HMAC` ||
@@ -452,7 +452,7 @@ This document attempts to describe the implementation status of Crypto APIs/Inte
452452
## `subtle.verify`
453453
| Algorithm | Status |
454454
| --------- | :----: |
455-
| `ECDSA` | |
455+
| `ECDSA` | |
456456
| `Ed25519` ||
457457
| `Ed448` ||
458458
| `HMAC` ||

example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,7 @@ SPEC CHECKSUMS:
20572057
hermes-engine: 4f8246b1f6d79f625e0d99472d1f3a71da4d28ca
20582058
NitroModules: e74e119e5c9f75902ef828936f75e4e078f0c4fc
20592059
OpenSSL-Universal: 6082b0bf950e5636fe0d78def171184e2b3899c2
2060-
QuickCrypto: 55910fe2f97dc24a4e72cc1f1038a4a5b3fb8ebe
2060+
QuickCrypto: 4bd633b3a4532e137a53087da836e5c09d26ef62
20612061
RCTDeprecation: 24056820c873bf5115c0441651440bfde2b82d51
20622062
RCTRequired: d0b6e766be3c17896d92059c917d682433ff8a34
20632063
RCTTypeSafety: 1954dcf545fe67e969e11e1b4fe6cf864e1ac632

packages/react-native-quick-crypto/QuickCrypto.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Pod::Spec.new do |s|
9393
# implementation (C++)
9494
"cpp/**/*.{hpp,cpp}",
9595
# dependencies (C++)
96-
"deps/**/*.{hpp,cpp}",
96+
"deps/**/*.{h,cc,c}",
9797
# dependencies (C)
9898
"deps/**/*.{h,c}",
9999
]

0 commit comments

Comments
 (0)