Skip to content

Commit f07a46e

Browse files
authored
Merge pull request #16 from paulmillr/master
Use top-level modules from @noble/hashes
2 parents 9d2f6b2 + d54629c commit f07a46e

13 files changed

+46
-46
lines changed

Diff for: package.json

+24-24
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,8 @@
1212
"url": "https://paulmillr.com"
1313
}
1414
],
15-
"repository": "github:ethereum/js-ethereum-cryptography",
15+
"repository": "https://github.com/ethereum/js-ethereum-cryptography",
1616
"license": "MIT",
17-
"keywords": [
18-
"ethereum",
19-
"cryptography",
20-
"digital signature",
21-
"hash",
22-
"encryption",
23-
"prng",
24-
"keccak",
25-
"scrypt",
26-
"pbkdf2",
27-
"sha-256",
28-
"ripemd-160",
29-
"blake2b",
30-
"aes",
31-
"advanced encryption standar",
32-
"secp256k1",
33-
"ecdsa",
34-
"bip32",
35-
"hierarchical deterministic keys",
36-
"hdwallet",
37-
"hdkeys"
38-
],
3917
"main": "./index.js",
4018
"files": [
4119
"src",
@@ -47,7 +25,7 @@
4725
],
4826
"dependencies": {
4927
"micro-base": "^0.10.0",
50-
"@noble/hashes": "^0.4.4",
28+
"@noble/hashes": "^0.5.1",
5129
"@noble/secp256k1": "^1.3.3"
5230
},
5331
"browser": {
@@ -97,6 +75,28 @@
9775
"webpack": "^4.39.3",
9876
"webpack-cli": "^3.3.8"
9977
},
78+
"keywords": [
79+
"ethereum",
80+
"cryptography",
81+
"digital signature",
82+
"hash",
83+
"encryption",
84+
"prng",
85+
"keccak",
86+
"scrypt",
87+
"pbkdf2",
88+
"sha-256",
89+
"ripemd-160",
90+
"blake2b",
91+
"aes",
92+
"advanced encryption standar",
93+
"secp256k1",
94+
"ecdsa",
95+
"bip32",
96+
"hierarchical deterministic keys",
97+
"hdwallet",
98+
"hdkeys"
99+
],
100100
"targets": {
101101
"parcel_tests": {
102102
"context": "browser"

Diff for: src/bip39/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { pbkdf2, pbkdf2Async } from "@noble/hashes/lib/pbkdf2";
2-
import { sha256 } from "@noble/hashes/lib/sha256";
3-
import { sha512 } from "@noble/hashes/lib/sha512";
4-
import { assertNumber } from "@noble/hashes/lib/utils";
1+
import { pbkdf2, pbkdf2Async } from "@noble/hashes/pbkdf2";
2+
import { sha256 } from "@noble/hashes/sha256";
3+
import { sha512 } from "@noble/hashes/sha512";
4+
import { assertNumber } from "@noble/hashes/utils";
55
import { utils as baseUtils } from "micro-base";
66
import { getRandomBytesSync } from "../random";
77
import { assertBytes } from "../utils";

Diff for: src/blake2b.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { blake2b as _blake2b } from "@noble/hashes/lib/blake2b";
1+
import { blake2b as _blake2b } from "@noble/hashes/blake2b";
22
import { assertBytes } from "./utils";
33

44
export const blake2b = (msg: Uint8Array, outputLength = 64): Uint8Array => {

Diff for: src/hdkey.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { hmac } from "@noble/hashes/lib/hmac";
2-
import { ripemd160 } from "@noble/hashes/lib/ripemd160";
3-
import { sha256 } from "@noble/hashes/lib/sha256";
4-
import { sha512 } from "@noble/hashes/lib/sha512";
5-
import { bytesToHex } from "@noble/hashes/lib/utils";
1+
import { hmac } from "@noble/hashes/hmac";
2+
import { ripemd160 } from "@noble/hashes/ripemd160";
3+
import { sha256 } from "@noble/hashes/sha256";
4+
import { sha512 } from "@noble/hashes/sha512";
5+
import { bytesToHex } from "@noble/hashes/utils";
66
import { base58check } from "micro-base";
77
import * as secp from "./secp256k1";
88
import {

Diff for: src/keccak.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as sha3 from "@noble/hashes/lib/sha3";
1+
import * as sha3 from "@noble/hashes/sha3";
22
import { wrapHash } from "./utils";
33

44
export const keccak224 = wrapHash(sha3.keccak_224);

Diff for: src/pbkdf2.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
22
pbkdf2 as _pbkdf2,
33
pbkdf2Async as _pbkdf2Async
4-
} from "@noble/hashes/lib/pbkdf2";
5-
import { sha256 } from "@noble/hashes/lib/sha256";
6-
import { sha512 } from "@noble/hashes/lib/sha512";
4+
} from "@noble/hashes/pbkdf2";
5+
import { sha256 } from "@noble/hashes/sha256";
6+
import { sha512 } from "@noble/hashes/sha512";
77
import { assertBytes } from "./utils";
88

99
export async function pbkdf2(

Diff for: src/ripemd160.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ripemd160 as _ripemd160 } from "@noble/hashes/lib/ripemd160";
1+
import { ripemd160 as _ripemd160 } from "@noble/hashes/ripemd160";
22
import { wrapHash } from "./utils";
33

44
export const ripemd160 = wrapHash(_ripemd160);

Diff for: src/scrypt.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
scrypt as _scrypt,
33
scryptAsync as _scryptAsync
4-
} from "@noble/hashes/lib/scrypt";
4+
} from "@noble/hashes/scrypt";
55
import { assertBytes } from "./utils";
66

77
export async function scrypt(

Diff for: src/secp256k1-compat.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sha256 } from "@noble/hashes/lib/sha256";
1+
import { sha256 } from "@noble/hashes/sha256";
22
import * as secp from "./secp256k1";
33
import { assertBool, assertBytes, hexToBytes, toHex } from "./utils";
44

Diff for: src/secp256k1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { hmac } from "@noble/hashes/lib/hmac";
2-
import { sha256 } from "@noble/hashes/lib/sha256";
1+
import { hmac } from "@noble/hashes/hmac";
2+
import { sha256 } from "@noble/hashes/sha256";
33
import { utils as _utils } from "@noble/secp256k1";
44
export {
55
getPublicKey,

Diff for: src/sha256.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sha256 as _sha256 } from "@noble/hashes/lib/sha256";
1+
import { sha256 as _sha256 } from "@noble/hashes/sha256";
22
import { wrapHash } from "./utils";
33

44
export const sha256 = wrapHash(_sha256);

Diff for: src/sha512.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sha512 as _sha512 } from "@noble/hashes/lib/sha512";
1+
import { sha512 as _sha512 } from "@noble/hashes/sha512";
22
import { wrapHash } from "./utils";
33

44
export const sha512 = wrapHash(_sha512);

Diff for: src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// buf.toString('hex') -> toHex(buf)
2-
export { bytesToHex as toHex, createView } from "@noble/hashes/lib/utils";
2+
export { bytesToHex as toHex, createView } from "@noble/hashes/utils";
33
// Buffer.from(hex, 'hex') -> hexToBytes(hex)
44
export function hexToBytes(hex: string): Uint8Array {
55
if (typeof hex !== "string") {

0 commit comments

Comments
 (0)