Use sha3 from noble
This commit is contained in:
parent
4a6253f16b
commit
218c341f67
14
.pnp.cjs
generated
14
.pnp.cjs
generated
@ -1770,10 +1770,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"jest-worker",
|
||||
"npm:26.6.2"
|
||||
],
|
||||
[
|
||||
"js-sha3",
|
||||
"npm:0.8.0"
|
||||
],
|
||||
[
|
||||
"js-sha512",
|
||||
"npm:0.8.0"
|
||||
@ -3400,7 +3396,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["jasmine", "npm:3.8.0"],
|
||||
["jasmine-core", "npm:3.8.0"],
|
||||
["jasmine-spec-reporter", "npm:6.0.0"],
|
||||
["js-sha3", "npm:0.8.0"],
|
||||
["karma", "npm:6.3.2"],
|
||||
["karma-chrome-launcher", "npm:3.1.0"],
|
||||
["karma-firefox-launcher", "npm:2.1.0"],
|
||||
@ -9241,15 +9236,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD",
|
||||
}]
|
||||
]],
|
||||
["js-sha3", [
|
||||
["npm:0.8.0", {
|
||||
"packageLocation": "./.yarn/cache/js-sha3-npm-0.8.0-decf3ddcfa-75df77c1fc.zip/node_modules/js-sha3/",
|
||||
"packageDependencies": [
|
||||
["js-sha3", "npm:0.8.0"]
|
||||
],
|
||||
"linkType": "HARD",
|
||||
}]
|
||||
]],
|
||||
["js-sha512", [
|
||||
["npm:0.8.0", {
|
||||
"packageLocation": "./.yarn/cache/js-sha512-npm-0.8.0-48a1a122ac-32ca371ebd.zip/node_modules/js-sha512/",
|
||||
|
||||
BIN
.yarn/cache/js-sha3-npm-0.8.0-decf3ddcfa-75df77c1fc.zip
(Stored with Git LFS)
vendored
BIN
.yarn/cache/js-sha3-npm-0.8.0-decf3ddcfa-75df77c1fc.zip
(Stored with Git LFS)
vendored
Binary file not shown.
@ -48,7 +48,6 @@
|
||||
"bip39": "^3.0.2",
|
||||
"bn.js": "^5.2.0",
|
||||
"elliptic": "^6.5.3",
|
||||
"js-sha3": "^0.8.0",
|
||||
"libsodium-wrappers": "^0.7.6",
|
||||
"sha.js": "^2.4.11"
|
||||
},
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
import jssha3 from "js-sha3";
|
||||
import { keccak_256 } from "@noble/hashes/sha3";
|
||||
|
||||
import { HashFunction } from "./hash";
|
||||
|
||||
export class Keccak256 implements HashFunction {
|
||||
public readonly blockSize = 512 / 8;
|
||||
|
||||
private readonly impl: jssha3.Hasher;
|
||||
private readonly impl = keccak_256.create();
|
||||
|
||||
public constructor(firstData?: Uint8Array) {
|
||||
this.impl = jssha3.keccak256.create();
|
||||
|
||||
if (firstData) {
|
||||
this.update(firstData);
|
||||
}
|
||||
@ -21,7 +19,7 @@ export class Keccak256 implements HashFunction {
|
||||
}
|
||||
|
||||
public digest(): Uint8Array {
|
||||
return new Uint8Array(this.impl.digest());
|
||||
return this.impl.digest();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -483,7 +483,6 @@ __metadata:
|
||||
jasmine: ^3.8
|
||||
jasmine-core: ^3.7.1
|
||||
jasmine-spec-reporter: ^6
|
||||
js-sha3: ^0.8.0
|
||||
karma: ^6.1.1
|
||||
karma-chrome-launcher: ^3.1.0
|
||||
karma-firefox-launcher: ^2.1.0
|
||||
@ -4848,13 +4847,6 @@ fsevents@~2.3.1:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"js-sha3@npm:^0.8.0":
|
||||
version: 0.8.0
|
||||
resolution: "js-sha3@npm:0.8.0"
|
||||
checksum: 75df77c1fc266973f06cce8309ce010e9e9f07ec35ab12022ed29b7f0d9c8757f5a73e1b35aa24840dced0dea7059085aa143d817aea9e188e2a80d569d9adce
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"js-sha512@npm:^0.8.0":
|
||||
version: 0.8.0
|
||||
resolution: "js-sha512@npm:0.8.0"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user