You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 🔒 Supports [hedged signatures](https://paulmillr.com/posts/deterministic-signatures/) guarding against fault attacks
11
-
- 🪶 4.94KB (gzipped, elliptic.js is 10x larger, tiny-secp256k1 is 25x larger)
11
+
- 🪶 4.94KB (gzipped) - 10-25x smaller than similar libraries
12
12
13
-
The module is a sister project of [noble-curves](https://github.com/paulmillr/noble-curves),
14
-
focusing on smaller attack surface & better auditability.
15
-
Curves are drop-in replacement and have more features:
16
-
MSM, DER encoding, endomorphism, prehashing, custom point precomputes, hash-to-curve, oprf.
17
-
To upgrade from earlier version, see [Upgrading](#upgrading).
13
+
The module is a sister project of [noble-curves](https://github.com/paulmillr/noble-curves).
14
+
Use noble-secp256k1 if you need smaller attack surface & better auditability.
15
+
Switch to noble-curves (drop-in) if you need features like MSM, DER encoding, custom point precomputes.
18
16
19
-
898-byte version of the library is available for learning purposes in `test/misc/1kb.min.js`,
17
+
898-byte version of the library is available for learning purposes in [`test/misc/1kb.min.js`](https://github.com/paulmillr/noble-secp256k1/blob/c38e57d17a2ecfdb9b8a80890a8e1a2cc140aa04/test/misc/1kb.min.js),
20
18
it was created for the article [Learning fast elliptic-curve cryptography](https://paulmillr.com/posts/noble-secp256k1-fast-ecc/).
21
19
22
20
### This library belongs to _noble_ cryptography
@@ -25,14 +23,16 @@ it was created for the article [Learning fast elliptic-curve cryptography](https
25
23
26
24
- Zero or minimal dependencies
27
25
- Highly readable TypeScript / JS code
28
-
- PGP-signed releases and transparent NPM builds with provenance
29
-
-Check out [homepage](https://paulmillr.com/noble/) & all libraries:
### React Native: polyfill getRandomValues and sha256
83
89
90
+
React Native does not provide secure getRandomValues by default.
91
+
This can't be securely polyfilled from our end, so one will need a RN-specific compile-time dep.
92
+
84
93
```ts
85
94
import'react-native-get-random-values';
86
95
import { hmac } from'@noble/hashes/hmac.js';
@@ -295,31 +304,27 @@ Use low-level libraries & languages.
295
304
296
305
### Supply chain security
297
306
298
-
-**Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures
299
-
-**Releases** are transparent and built on GitHub CI.
300
-
Check out [attested checksums of single-file builds](https://github.com/paulmillr/noble-secp256k1/attestations)
301
-
and [provenance logs](https://github.com/paulmillr/noble-secp256k1/actions/workflows/release.yml)
302
-
-**Rare releasing** is followed to ensure less re-audit need for end-users
303
-
-**Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install.
304
-
- We make sure to use as few dependencies as possible
305
-
- Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff`
306
-
-**Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code
307
+
-**Commits** are signed with PGP keys to prevent forgery. Be sure to verify the commit signatures
308
+
-**Releases** are made transparently through token-less GitHub CI and Trusted Publishing. Be sure to verify the [provenance logs](https://docs.npmjs.com/generating-provenance-statements) for authenticity.
309
+
-**Rare releasing** is practiced to minimize the need for re-audits by end-users.
310
+
-**Dependencies** are minimized and strictly pinned to reduce supply-chain risk.
311
+
- We use as few dependencies as possible.
312
+
- Version ranges are locked, and changes are checked with npm-diff.
313
+
-**Dev dependencies** are excluded from end-user installs; they’re only used for development and build steps.
307
314
308
315
For this package, there are 0 dependencies; and a few dev dependencies:
-micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author
312
-
- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size
318
+
- jsbt is used for benchmarking / testing / build tooling and developed by the same author
319
+
- prettier, fast-check and typescript are used for code quality / test generation / ts compilation
which is considered a cryptographically secure PRNG.
319
326
320
-
In the past, browsers had bugs that made it weak: it may happen again.
321
-
Implementing a userspace CSPRNG to get resilient to the weakness
322
-
is even worse: there is no reliable userspace source of quality entropy.
327
+
Browsers have had weaknesses in the past - and could again - but implementing a userspace CSPRNG is even worse, as there’s no reliable userspace source of high-quality entropy.
323
328
324
329
### Quantum computers
325
330
@@ -373,8 +378,8 @@ v3 brings the package closer to noble-curves v2.
0 commit comments