@@ -10,11 +10,9 @@ Fastest 5KB JS implementation of secp256k1 signatures & ECDH.
1010- 🔒 Supports [ hedged signatures] ( https://paulmillr.com/posts/deterministic-signatures/ ) guarding against fault attacks
1111- 🪶 4.94KB (gzipped, elliptic.js is 10x larger, tiny-secp256k1 is 25x larger)
1212
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.
1816
1917898-byte version of the library is available for learning purposes in ` test/misc/1kb.min.js ` ,
2018it was created for the article [ Learning fast elliptic-curve cryptography] ( https://paulmillr.com/posts/noble-secp256k1-fast-ecc/ ) .
@@ -81,6 +79,9 @@ secp.hashes.sha256 = sha256;
8179
8280### React Native: polyfill getRandomValues and sha256
8381
82+ React Native does not provide secure getRandomValues by default.
83+ This can't be securely polyfilled from our end, so one will need a RN-specific compile-time dep.
84+
8485``` ts
8586import ' react-native-get-random-values' ;
8687import { hmac } from ' @noble/hashes/hmac.js' ;
@@ -373,8 +374,8 @@ v3 brings the package closer to noble-curves v2.
373374
374375``` js
375376// before
376- // etc.hmacSha256Sync = (key, ...messages) => hmac(sha256, key, etc.concatBytes(...messages));
377- // etc.hmacSha256Async = (key, ...messages) => Promise.resolve(etc.hmacSha256Sync(key, ...messages));
377+ etc .hmacSha256Sync = (key , ... messages ) => hmac (sha256, key, etc .concatBytes (... messages));
378+ etc .hmacSha256Async = (key , ... messages ) => Promise .resolve (etc .hmacSha256Sync (key, ... messages));
378379// after
379380hashes .hmacSha256 = (key , msg ) => hmac (sha256, key, msg);
380381hashes .sha256 = sha256;
0 commit comments