Skip to content

Commit 170fddb

Browse files
authored
Merge pull request #22 from paulmillr/master
Audit
2 parents c2987b3 + cb3c763 commit 170fddb

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22

33
[![npm version][1]][2] [![Travis CI][3]][4] [![license][5]][6] [![Types][7]][8]
44

5-
This package contains all pure-js cryptographic primitives normally used when
5+
All pure-js cryptographic primitives normally used when
66
developing Javascript / TypeScript applications and tools for Ethereum.
77

8+
**January 2022 update:** Version 1.0 of the package will be out soon. The module has been completely rewritten:
9+
10+
- **6x smaller:** 4,000 lines of code instead of 22,438 (with all deps); 185KB instead of 755KB
11+
- 3 dependencies by one author instead of 38 by 5 authors
12+
- [Audited](#security) by an independent security firm
13+
- Check out the [Upgrading](#upgrading) section for breaking changes (there are almost none)
14+
815
The cryptographic primitives included are:
916

1017
* [Hashes: SHA256, keccak-256, RIPEMD160, BLAKE2b](#hashes-sha256-keccak-256-ripemd160-blake2b)
@@ -15,20 +22,6 @@ The cryptographic primitives included are:
1522
* [BIP39 Mnemonic phrases](#bip39-mnemonic-phrases)
1623
* [AES Encryption](#aes-encryption)
1724

18-
**October 2021 update:** We're releasing **experimental** version 0.2 of the package.
19-
The module has been completely rewritten:
20-
21-
- ~6x smaller: 4,000 lines of code instead of 22,438 (with all deps); 185KB instead of 755KB
22-
- 3 dependencies (pending an audit) instead of 38
23-
- **Same functionality**, all old APIs remain the same except for two breaking changes:
24-
1. We return `Uint8Array` from all methods that worked with `Buffer` before.
25-
`Buffer` has never been supported in browsers, while `Uint8Array`s are supported natively in both
26-
browsers and node.js. See [Upgrading](#upgrading)
27-
2. We target runtimes with [bigint](https://caniuse.com/bigint) support,
28-
which is Chrome 67+, Edge 79+, Firefox 68+, Safari 14+, node.js 10+. If you need to support older runtimes, use `[email protected]`
29-
3. If you've used `secp256k1`, [rename it to `secp256k1-compat`](#legacy-secp256k1-compatibility-layer)
30-
- The new module [has not been audited yet](#security), but it's in the process of getting the audit. Use it at your own risk
31-
3225
## Usage
3326

3427
Use NPM / Yarn in node.js / browser:
@@ -205,6 +198,9 @@ Note: if you've been using ethereum-cryptography v0.1, it had different API. We'
205198

206199
## BIP32 HD Keygen
207200

201+
Hierarchical deterministic (HD) wallets that conform to BIP32 standard.
202+
Also available as standalone package [micro-bip32](https://github.com/paulmillr/micro-bip32).
203+
208204
This module exports a single class `HDKey`, which should be used like this:
209205

210206
```ts
@@ -283,6 +279,8 @@ function mnemonicToSeedSync(mnemonic: string, passphrase: string = ""): Uint8Arr
283279
The `bip39` submodule provides functions to generate, validate and use seed
284280
recovery phrases according to [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki).
285281

282+
Also available as standalone package [micro-bip39](https://github.com/paulmillr/micro-bip39).
283+
286284
```js
287285
const { generateMnemonic } = require("ethereum-cryptography/bip39");
288286
const { wordlist } = require("ethereum-cryptography/bip39/wordlists/english");
@@ -449,14 +447,16 @@ you found another primitive that is missing.
449447

450448
## Upgrading
451449

452-
Version 0.2 changes from 0.1:
450+
Version 1.0 changes from 0.1:
451+
452+
**Same functionality**, all old APIs remain the same except for the breaking changes:
453453

454-
- **Breaking:** we target runtimes with [bigint](https://caniuse.com/bigint) support,
455-
which is Chrome 67+, Edge 79+, Firefox 68+, Safari 14+, node.js 10+. If you need to support
456-
older runtimes, use `[email protected]`
457-
- **Breaking:** we return `Uint8Array` from all methods that worked with `Buffer` before.
458-
`Buffer` has never been supported in browsers, while `Uint8Array`s are supported natively in both
459-
browsers and node.js:
454+
1. We return `Uint8Array` from all methods that worked with `Buffer` before.
455+
`Buffer` has never been supported in browsers, while `Uint8Array`s are supported natively in both
456+
browsers and node.js. See [Upgrading](#upgrading)
457+
2. We target runtimes with [bigint](https://caniuse.com/bigint) support,
458+
which is Chrome 67+, Edge 79+, Firefox 68+, Safari 14+, node.js 10+. If you need to support older runtimes, use `[email protected]`
459+
3. If you've used `secp256k1`, [rename it to `secp256k1-compat`](#legacy-secp256k1-compatibility-layer)
460460

461461
```
462462
const { sha256 } = require("ethereum-cryptography/sha256");
@@ -475,7 +475,7 @@ const hashbo = hashb.toString("hex");
475475

476476
## Security
477477

478-
This library is in the process of getting a security audit.
478+
Audited by Cure53 on Jan 5, 2022. Check out the audit [PDF](./audit/2022-01-05-cure53-audit-nbl2.pdf) & [URL](https://cure53.de/pentest-report_hashing-libs.pdf).
479479

480480
## License
481481

312 KB
Binary file not shown.

audit/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Audit
2+
3+
The PDF was saved from cure53.de site: [URL](https://cure53.de/pentest-report_hashing-libs.pdf). See information about audit and fuzzing in root [README](../README.md).

0 commit comments

Comments
 (0)