Skip to content

Commit

Permalink
fix: rename format utils for consistency, improve vmb_tests, fix issu…
Browse files Browse the repository at this point in the history
…es in BCH vm
  • Loading branch information
bitjson committed May 14, 2022
1 parent 94cc43c commit 6f2e782
Show file tree
Hide file tree
Showing 25 changed files with 183 additions and 89 deletions.
4 changes: 3 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"bcoin",
"bcrypto",
"bech",
"benchmarkjs",
"bigint",
"bindgen",
"bitauth",
Expand Down Expand Up @@ -165,7 +166,8 @@
"yarn.lock",
"tsconfig.json",
"node_modules/**",
"src/**/*.base64.ts"
"src/**/*.base64.ts",
"src/**/script_tests.json"
],
"ignoreRegExpList": ["Base64", "HexValues"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
},
"files": [
"build",
"!build/.tsbuildinfo",
"!**/*.spec.*",
"!**/*.json",
"CHANGELOG.md",
Expand Down
14 changes: 7 additions & 7 deletions src/lib/format/numbers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
binToNumberUint16LE,
binToNumberUint32LE,
binToNumberUintLE,
decodeVarInt,
hexToBin,
numberToBinInt16LE,
numberToBinInt32LE,
Expand All @@ -30,6 +29,7 @@ import {
numberToBinUint32LEClamped,
numberToBinUintLE,
varIntPrefixToSize,
varIntToBigInt,
} from '../lib.js';

test('numberToBinUint16LE', (t) => {
Expand Down Expand Up @@ -436,8 +436,8 @@ test('binToBigIntUint64LE', (t) => {
);
});

test('decodeVarInt: index is optional', (t) => {
t.deepEqual(decodeVarInt(hexToBin('00')), {
test('varIntToBigInt: index is optional', (t) => {
t.deepEqual(varIntToBigInt(hexToBin('00')), {
nextIndex: 1,
value: BigInt(0x00),
});
Expand All @@ -446,13 +446,13 @@ test('decodeVarInt: index is optional', (t) => {
const varIntVector = test.macro<[string, bigint, number, number?, string?]>({
// eslint-disable-next-line max-params
exec: (t, hex, value, nextIndex, start = 0, expected = hex) => {
t.deepEqual(decodeVarInt(hexToBin(hex), start), {
t.deepEqual(varIntToBigInt(hexToBin(hex), start), {
nextIndex,
value,
});
t.deepEqual(bigIntToVarInt(value), hexToBin(expected));
},
title: (_, string) => `decodeVarInt/bigIntToVarInt: ${string}`,
title: (_, string) => `varIntToBigInt/bigIntToVarInt: ${string}`,
});

/* spell-checker: disable */
Expand Down Expand Up @@ -492,13 +492,13 @@ test(varIntVector, 'ff1111111111111111', BigInt('0x1111111111111111'), 9);
test(varIntVector, 'ff1234567890abcdef', BigInt('0xefcdab9078563412'), 9);

testProp(
'[fast-check] bigIntToVarInt <-> decodeVarInt',
'[fast-check] bigIntToVarInt <-> varIntToBigInt',
[fc.bigUintN(64)],
(t, uint64) => {
const varInt = bigIntToVarInt(uint64);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const expectedIndex = varIntPrefixToSize(varInt[0]!);
const result = decodeVarInt(varInt);
const result = varIntToBigInt(varInt);
t.deepEqual(result, { nextIndex: expectedIndex, value: uint64 });
}
);
10 changes: 9 additions & 1 deletion src/lib/format/numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ export const varIntPrefixToSize = (firstByte: number) => {
* @param bin - the Uint8Array from which to read the VarInt
* @param index - the index at which the VarInt begins
*/
export const decodeVarInt = (bin: Uint8Array, index = 0) => {
export const varIntToBigInt = (bin: Uint8Array, index = 0) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const bytes = varIntPrefixToSize(bin[index]!);
const hasPrefix = bytes !== 1;
Expand Down Expand Up @@ -503,3 +503,11 @@ export const bigIntToVarInt = (value: bigint) =>
...numberToBinUint32LE(Number(value)),
])
: Uint8Array.from([VarInt.uint64Prefix, ...bigIntToBinUint64LE(value)]);

export const int32SignedToUnsigned = (int32: number) =>
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Uint32Array.from(Int32Array.of(int32))[0]!;

export const int32UnsignedToSigned = (int32: number) =>
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Int32Array.from(Uint32Array.of(int32))[0]!;
2 changes: 1 addition & 1 deletion src/lib/language/language-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ test.failing('extractEvaluationSamples: documentation example', (t) => {
});
});

test('extractEvaluationSamples: error in initial validation', (t) => {
test.failing('extractEvaluationSamples: error in initial validation', (t) => {
const result = compiler.generateBytecode({
data: {},
debug: true,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/language/language-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import type {
import {
authenticationInstructionIsMalformed,
decodeAuthenticationInstructions,
decodeVmNumber,
encodeAuthenticationInstructionMalformed,
OpcodesBCH,
vmNumberToBigInt,
} from '../vm/vm.js';

const pluckStartPosition = (range: Range) => ({
Expand Down Expand Up @@ -803,7 +803,7 @@ export const extractUnexecutedRanges = <
*/
export const summarizeStack = (stack: Uint8Array[]) =>
stack.map((item) => {
const asNumber = decodeVmNumber(item);
const asNumber = vmNumberToBigInt(item);
return `0x${binToHex(item)}${
typeof asNumber === 'string' ? '' : `(${asNumber.toString()})`
}`;
Expand Down
10 changes: 5 additions & 5 deletions src/lib/message/transaction-encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
bigIntToVarInt,
binToHex,
binToNumberUint32LE,
decodeVarInt,
flattenBinArray,
numberToBinUint32LE,
varIntToBigInt,
} from '../format/format.js';
import type { Input, Output, Sha256, TransactionCommon } from '../lib';

Expand Down Expand Up @@ -46,7 +46,7 @@ export const decodeTransactionInputUnsafe = (
bin.subarray(indexAfterTxHash, indexAfterOutpointIndex)
);
const { nextIndex: indexAfterBytecodeLength, value: bytecodeLength } =
decodeVarInt(bin, indexAfterOutpointIndex);
varIntToBigInt(bin, indexAfterOutpointIndex);
const indexAfterBytecode = indexAfterBytecodeLength + Number(bytecodeLength);
const unlockingBytecode = bin.slice(
indexAfterBytecodeLength,
Expand Down Expand Up @@ -82,7 +82,7 @@ export const encodeTransactionInputs = (inputs: readonly Input[]) =>
]);

/**
* Decode an array of items following a VarInt (see {@link decodeVarInt}). A
* Decode an array of items following a VarInt (see {@link varIntToBigInt}). A
* VarInt will be read beginning at `index`, and then the encoded number of
* items will be decoded using `itemDecoder`.
*
Expand All @@ -101,7 +101,7 @@ export const createVarIntItemUnsafeDecoder =
keyPlural: KeyPlural
) =>
(bin: Uint8Array, index = 0) => {
const { nextIndex: indexAfterItemCount, value: itemCount } = decodeVarInt(
const { nextIndex: indexAfterItemCount, value: itemCount } = varIntToBigInt(
bin,
index
);
Expand Down Expand Up @@ -168,7 +168,7 @@ export const decodeTransactionOutputUnsafe = (
const uint64Bytes = 8;
const indexAfterSatoshis = index + uint64Bytes;
const valueSatoshis = bin.slice(index, indexAfterSatoshis);
const { nextIndex: indexAfterScriptLength, value } = decodeVarInt(
const { nextIndex: indexAfterScriptLength, value } = varIntToBigInt(
bin,
indexAfterSatoshis
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
disassembleBytecodeBCH,
stackItemIsTruthy,
stringify,
stringifyDebugTraceSummary,
summarizeDebugTrace,
} from '../../../../lib.js';

// eslint-disable-next-line import/no-restricted-paths, import/no-internal-modules
Expand Down Expand Up @@ -139,7 +141,10 @@ pendingTests.map((expectation) => {
t.log(`lockingBytecodeText: "${expectation.lockingBytecodeText}"`);
t.log(`disassembled: "${disassembleBytecodeBCH(lockingBytecode)}"`);
t.log('result:', stringify(result));
t.log('debug:', stringify(vm.debug(program)));
t.log(
'debug:',
stringifyDebugTraceSummary(summarizeDebugTrace(vm.debug(program)))
);
if (expectation.expectedError === false) {
t.fail('Expected a valid state, but this result is invalid.');
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
],
"minimalIf": [1447, 1449, 1460, 1463, 1465, 1477],
"useStrict": [
593, 910, 1079, 1080, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092,
1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104,
1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116,
1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128,
1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140,
1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152,
1153, 1154, 1155, 1156, 1157, 1158
910, 1079, 1080, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093,
1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105,
1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117,
1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129,
1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141,
1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153,
1154, 1155, 1156, 1157, 1158
]
}
19 changes: 12 additions & 7 deletions src/lib/vm/instruction-sets/bch/2022/bch-2022-instruction-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,16 @@ export const createInstructionSetBCH2022 = (
AuthenticationErrorCommon.malformedLockingBytecode
);
}
if (standard && !isPushOnly(unlockingBytecode)) {
return applyError(
initialState,
AuthenticationErrorCommon.requiresPushOnly
);
}
const unlockingResult = stateEvaluate(initialState);
if (unlockingResult.error !== undefined) {
return unlockingResult;
}
if (unlockingResult.controlStack.length !== 0) {
return applyError(
initialState,
AuthenticationErrorCommon.nonEmptyControlStack
);
}
const lockingResult = stateEvaluate(
createAuthenticationProgramStateCommon({
instructions: lockingInstructions,
Expand All @@ -243,7 +243,12 @@ export const createInstructionSetBCH2022 = (
if (!isPayToScriptHash20(lockingBytecode)) {
return lockingResult;
}

if (!isPushOnly(unlockingBytecode)) {
return applyError(
initialState,
AuthenticationErrorCommon.requiresPushOnly
);
}
const p2shStack = cloneStack(unlockingResult.stack);
// eslint-disable-next-line functional/immutable-data
const p2shScript = p2shStack.pop() ?? Uint8Array.of();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/vm/instruction-sets/common/combinators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { ConsensusCommon } from './consensus.js';
import { applyError, AuthenticationErrorCommon } from './errors.js';
import {
bigIntToVmNumber,
decodeVmNumber,
isVmNumberError,
vmNumberToBigInt,
} from './instruction-sets-utils.js';

export const incrementOperationCount =
Expand Down Expand Up @@ -178,7 +178,7 @@ export const useOneVmNumber = <
}
) =>
useOneStackItem(state, (nextState, [item]) => {
const value = decodeVmNumber(item, {
const value = vmNumberToBigInt(item, {
maximumVmNumberByteLength,
requireMinimalEncoding,
});
Expand Down
2 changes: 1 addition & 1 deletion src/lib/vm/instruction-sets/common/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export enum AuthenticationErrorCommon {
malformedPush = 'Program must be long enough to push the requested number of bytes.',
malformedUnlockingBytecode = 'The provided unlocking bytecode is malformed.',
negativeLocktime = 'Program called an OP_CHECKLOCKTIMEVERIFY or OP_CHECKSEQUENCEVERIFY operation with a negative locktime.',
nonEmptyControlStack = 'Program completed with a non-empty control stack (missing `OP_ENDIF`).',
nonEmptyControlStack = 'The active bytecode completed with a non-empty control stack (missing `OP_ENDIF`).',
nonMinimalPush = 'Push operations must use the smallest possible encoding.',
nonNullSignatureFailure = 'Program failed a signature verification with a non-null signature (violating the "NULLFAIL" rule).',
overflowsVmNumberRange = 'Program attempted an arithmetic operation which exceeds the range of VM Numbers.',
Expand Down
10 changes: 8 additions & 2 deletions src/lib/vm/instruction-sets/common/inspection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { binToBigIntUint64LE } from '../../../format/format.js';
import {
binToBigIntUint64LE,
int32UnsignedToSigned,
} from '../../../format/format.js';
import type {
AuthenticationProgramStateCommon,
Input,
Expand Down Expand Up @@ -32,7 +35,10 @@ export const opActiveBytecode = <
export const opTxVersion = <State extends AuthenticationProgramStateCommon>(
state: State
) =>
pushToStackVmNumberChecked(state, BigInt(state.program.transaction.version));
pushToStackVmNumberChecked(
state,
BigInt(int32UnsignedToSigned(state.program.transaction.version))
);

export const opTxInputCount = <State extends AuthenticationProgramStateCommon>(
state: State
Expand Down
4 changes: 2 additions & 2 deletions src/lib/vm/instruction-sets/common/instruction-sets-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ const typicalMaximumVmNumberByteLength = 8;
* @param bytes - a Uint8Array from the stack
*/
// eslint-disable-next-line complexity
export const decodeVmNumber = (
export const vmNumberToBigInt = (
bytes: Uint8Array,
{
maximumVmNumberByteLength = typicalMaximumVmNumberByteLength,
Expand Down Expand Up @@ -548,7 +548,7 @@ export const decodeVmNumber = (
};

/**
* Convert a BigInt into the VM Number format. See {@link decodeVmNumber} for
* Convert a BigInt into the VM Number format. See {@link vmNumberToBigInt} for
* more information.
*
* @param integer - the BigInt to encode as a VM Number
Expand Down
4 changes: 2 additions & 2 deletions src/lib/vm/instruction-sets/common/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
} from '../../../lib';

import { applyError, AuthenticationErrorCommon } from './errors.js';
import { decodeVmNumber, isVmNumberError } from './instruction-sets-utils.js';
import { isVmNumberError, vmNumberToBigInt } from './instruction-sets-utils.js';

const enum Bits {
sequenceLocktimeDisableFlag = 31,
Expand Down Expand Up @@ -36,7 +36,7 @@ export const useLocktime = <
if (item === undefined) {
return applyError(state, AuthenticationErrorCommon.emptyStack);
}
const decodedLocktime = decodeVmNumber(item, {
const decodedLocktime = vmNumberToBigInt(item, {
maximumVmNumberByteLength: Constants.locktimeVmNumberByteLength,
requireMinimalEncoding: true,
});
Expand Down
Loading

1 comment on commit 6f2e782

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Benchmark.js Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 6f2e782 Previous: 94cc43c Ratio
hash.js 132934 ops/sec (±2.37%) 286709 ops/sec (±0.47%) 2.16
libauth 96770 ops/sec (±1.13%) 386776 ops/sec (±0.89%) 4.00
hash.js 18200 ops/sec (±1.17%) 286709 ops/sec (±0.47%) 15.75
asmcrypto.js 11740 ops/sec (±1.65%) 28246 ops/sec (±1.94%) 2.41
libauth 10723 ops/sec (±1.20%) 386776 ops/sec (±0.89%) 36.07
hash.js 1767 ops/sec (±1.11%) 286709 ops/sec (±0.47%) 162.26
asmcrypto.js 8.24 ops/sec (±1.71%) 28246 ops/sec (±1.94%) 3427.91
libauth 3.49 ops/sec (±1.63%) 386776 ops/sec (±0.89%) 110824.07
hash.js 0.44 ops/sec (±1.22%) 286709 ops/sec (±0.47%) 651611.36
hash.js 131825 ops/sec (±1.18%) 286709 ops/sec (±0.47%) 2.17
libauth 56793 ops/sec (±0.92%) 386776 ops/sec (±0.89%) 6.81
hash.js 17370 ops/sec (±1.14%) 286709 ops/sec (±0.47%) 16.51
crypto.subtle 10886 ops/sec (±1.72%) 22952 ops/sec (±1.95%) 2.11
asmcrypto.js 7155 ops/sec (±2.23%) 28246 ops/sec (±1.94%) 3.95
libauth 6273 ops/sec (±1.01%) 386776 ops/sec (±0.89%) 61.66
hash.js 1803 ops/sec (±1.68%) 286709 ops/sec (±0.47%) 159.02
asmcrypto.js 3.32 ops/sec (±1.86%) 28246 ops/sec (±1.94%) 8507.83
libauth 2.3 ops/sec (±1.76%) 386776 ops/sec (±0.89%) 168163.48
hash.js 0.45 ops/sec (±1.22%) 286709 ops/sec (±0.47%) 637131.11
hash.js 72349 ops/sec (±1.55%) 286709 ops/sec (±0.47%) 3.96
hash.js 77401 ops/sec (±1.11%) 286709 ops/sec (±0.47%) 3.70
libauth 92075 ops/sec (±0.84%) 386776 ops/sec (±0.89%) 4.20
asmcrypto.js 11749 ops/sec (±2.09%) 28246 ops/sec (±1.94%) 2.40
hash.js 5790 ops/sec (±1.02%) 286709 ops/sec (±0.47%) 49.52
libauth 10748 ops/sec (±0.97%) 386776 ops/sec (±0.89%) 35.99
asmcrypto.js 1494 ops/sec (±1.30%) 28246 ops/sec (±1.94%) 18.91
hash.js 595 ops/sec (±0.89%) 286709 ops/sec (±0.47%) 481.86
libauth 3.35 ops/sec (±2.20%) 386776 ops/sec (±0.89%) 115455.52
asmcrypto.js 0.67 ops/sec (±1.14%) 28246 ops/sec (±1.94%) 42158.21
hash.js 0.19 ops/sec (±1.34%) 286709 ops/sec (±0.47%) 1508994.74
hash.js 120847 ops/sec (±1.61%) 286709 ops/sec (±0.47%) 2.37
hash.js 15655 ops/sec (±1.08%) 286709 ops/sec (±0.47%) 18.31
libauth 25681 ops/sec (±1.17%) 386776 ops/sec (±0.89%) 15.06
hash.js 1649 ops/sec (±1.43%) 286709 ops/sec (±0.47%) 173.87
libauth 7.85 ops/sec (±2.00%) 386776 ops/sec (±0.89%) 49270.83
hash.js 0.43 ops/sec (±1.14%) 286709 ops/sec (±0.47%) 666765.12
bcoin 149103 ops/sec (±2.58%) 669558 ops/sec (±1.70%) 4.49
node.js native 134772 ops/sec (±2.06%) 388715 ops/sec (±2.74%) 2.88
hash.js 30061 ops/sec (±1.46%) 286709 ops/sec (±0.47%) 9.54
libauth 26236 ops/sec (±1.44%) 386776 ops/sec (±0.89%) 14.74
node.js native 20721 ops/sec (±0.81%) 388715 ops/sec (±2.74%) 18.76
bcoin 19451 ops/sec (±1.31%) 669558 ops/sec (±1.70%) 34.42
hash.js 3310 ops/sec (±0.91%) 286709 ops/sec (±0.47%) 86.62
libauth 8.32 ops/sec (±1.53%) 386776 ops/sec (±0.89%) 46487.50
node.js native 6.97 ops/sec (±1.35%) 388715 ops/sec (±2.74%) 55769.73
hash.js 0.66 ops/sec (±1.08%) 286709 ops/sec (±0.47%) 434407.58
libauth 4168 ops/sec (±0.91%) 386776 ops/sec (±0.89%) 92.80
libauth 3821 ops/sec (±1.28%) 386776 ops/sec (±0.89%) 101.22
libauth 12694 ops/sec (±1.49%) 386776 ops/sec (±0.89%) 30.47
libauth 5519 ops/sec (±1.02%) 386776 ops/sec (±0.89%) 70.08
bcoin 216102 ops/sec (±2.85%) 669558 ops/sec (±1.70%) 3.10
libauth 98152 ops/sec (±0.96%) 386776 ops/sec (±0.89%) 3.94
hash.js 34844 ops/sec (±1.36%) 286709 ops/sec (±0.47%) 8.23
node.js native 63475 ops/sec (±1.70%) 388715 ops/sec (±2.74%) 6.12
bcoin 32946 ops/sec (±2.82%) 669558 ops/sec (±1.70%) 20.32
asmcrypto.js 11484 ops/sec (±3.36%) 28246 ops/sec (±1.94%) 2.46
libauth 10953 ops/sec (±1.16%) 386776 ops/sec (±0.89%) 35.31
hash.js 3823 ops/sec (±1.39%) 286709 ops/sec (±0.47%) 75.00
node.js native 24.01 ops/sec (±2.19%) 388715 ops/sec (±2.74%) 16189.71
asmcrypto.js 8.25 ops/sec (±1.83%) 28246 ops/sec (±1.94%) 3423.76
libauth 3.41 ops/sec (±1.99%) 386776 ops/sec (±0.89%) 113424.05
hash.js 0.71 ops/sec (±4.18%) 286709 ops/sec (±0.47%) 403815.49
node.js native 157955 ops/sec (±5.26%) 388715 ops/sec (±2.74%) 2.46
bcoin 122724 ops/sec (±2.10%) 669558 ops/sec (±1.70%) 5.46
libauth 67706 ops/sec (±0.94%) 386776 ops/sec (±0.89%) 5.71
hash.js 29251 ops/sec (±0.97%) 286709 ops/sec (±0.47%) 9.80
node.js native 32155 ops/sec (±1.09%) 388715 ops/sec (±2.74%) 12.09
bcoin 15643 ops/sec (±1.15%) 669558 ops/sec (±1.70%) 42.80
libauth 7291 ops/sec (±0.97%) 386776 ops/sec (±0.89%) 53.05
asmcrypto.js 6533 ops/sec (±3.45%) 28246 ops/sec (±1.94%) 4.32
hash.js 3236 ops/sec (±0.90%) 286709 ops/sec (±0.47%) 88.60
node.js native 11.3 ops/sec (±0.98%) 388715 ops/sec (±2.74%) 34399.56
asmcrypto.js 3.38 ops/sec (±2.29%) 28246 ops/sec (±1.94%) 8356.80
libauth 2.25 ops/sec (±2.21%) 386776 ops/sec (±0.89%) 171900.44
hash.js 0.64 ops/sec (±1.64%) 286709 ops/sec (±0.47%) 447982.81
hash.js 109026 ops/sec (±1.09%) 286709 ops/sec (±0.47%) 2.63
hash.js 104257 ops/sec (±0.99%) 286709 ops/sec (±0.47%) 2.75
bcoin 165554 ops/sec (±2.14%) 669558 ops/sec (±1.70%) 4.04
libauth 93189 ops/sec (±0.82%) 386776 ops/sec (±0.89%) 4.15
asmcrypto.js 10719 ops/sec (±2.11%) 28246 ops/sec (±1.94%) 2.64
hash.js 7953 ops/sec (±0.81%) 286709 ops/sec (±0.47%) 36.05
node.js native 44577 ops/sec (±1.07%) 388715 ops/sec (±2.74%) 8.72
bcoin 23231 ops/sec (±1.06%) 669558 ops/sec (±1.70%) 28.82
libauth 10639 ops/sec (±0.99%) 386776 ops/sec (±0.89%) 36.35
asmcrypto.js 1890 ops/sec (±1.93%) 28246 ops/sec (±1.94%) 14.94
hash.js 752 ops/sec (±1.10%) 286709 ops/sec (±0.47%) 381.26
node.js native 15.82 ops/sec (±1.60%) 388715 ops/sec (±2.74%) 24571.11
libauth 3.41 ops/sec (±1.93%) 386776 ops/sec (±0.89%) 113424.05
asmcrypto.js 0.68 ops/sec (±1.24%) 28246 ops/sec (±1.94%) 41538.24
hash.js 0.21 ops/sec (±1.27%) 286709 ops/sec (±0.47%) 1365280.95

This comment was automatically generated by workflow using github-action-benchmark.

CC: @bitjson

Please sign in to comment.