Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2815,7 +2815,7 @@ SPEC CHECKSUMS:
NitroMmkv: afbc5b2fbf963be567c6c545aa1efcf6a9cec68e
NitroModules: 11bba9d065af151eae51e38a6425e04c3b223ff3
OpenSSL-Universal: 9110d21982bb7e8b22a962b6db56a8aa805afde7
QuickCrypto: 6da296072ca4df238901a2055023af9558ae1d01
QuickCrypto: 6b271caaa2f24335a4bc545bb856984f1001d7e4
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
RCTDeprecation: c4b9e2fd0ab200e3af72b013ed6113187c607077
RCTRequired: e97dd5dafc1db8094e63bc5031e0371f092ae92a
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@noble/ciphers": "2.0.1",
"@noble/curves": "1.7.0",
"@noble/hashes": "1.5.0",
"@noble/hashes": "2.2.0",
"@react-navigation/bottom-tabs": "7.16.0",
"@react-navigation/native": "7.2.4",
"@react-navigation/native-stack": "7.15.0",
Expand Down
2 changes: 1 addition & 1 deletion example/src/benchmarks/blake3/blake3.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import rnqc from 'react-native-quick-crypto';
import { blake3 as nobleBlake3 } from '@noble/hashes/blake3';
import { blake3 as nobleBlake3 } from '@noble/hashes/blake3.js';
import type { BenchFn } from '../../types/benchmarks';
import { Bench } from 'tinybench';

Expand Down
7 changes: 4 additions & 3 deletions example/src/benchmarks/hash/hash.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import rnqc from 'react-native-quick-crypto';
import { sha256 } from '@noble/hashes/sha2';
import { sha256 } from '@noble/hashes/sha2.js';
import { utf8ToBytes } from '@noble/hashes/utils.js';
// @ts-expect-error - crypto-browserify is not typed
import browserify from 'crypto-browserify';
import type { BenchFn } from '../../types/benchmarks';
Expand All @@ -21,7 +22,7 @@ const hash_sha256_8mb_string: BenchFn = () => {
hash.digest('hex');
})
.add('@noble/hashes/sha256', () => {
sha256(text8MB);
sha256(utf8ToBytes(text8MB));
})
.add('browserify', () => {
const hash = browserify.createHash('sha256');
Expand All @@ -47,7 +48,7 @@ const hash_sha256_1mb_string: BenchFn = () => {
hash.digest('hex');
})
.add('@noble/hashes/sha256', () => {
sha256(text1MB);
sha256(utf8ToBytes(text1MB));
})
.add('browserify', () => {
const hash = browserify.createHash('sha256');
Expand Down
4 changes: 2 additions & 2 deletions example/src/benchmarks/hkdf/hkdf.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import rnqc, { Buffer } from 'react-native-quick-crypto';
import { hkdf } from '@noble/hashes/hkdf';
import { sha256 } from '@noble/hashes/sha2';
import { hkdf } from '@noble/hashes/hkdf.js';
import { sha256 } from '@noble/hashes/sha2.js';
import type { BenchFn } from '../../types/benchmarks';
import { Bench } from 'tinybench';

Expand Down
14 changes: 8 additions & 6 deletions example/src/benchmarks/hmac/hmac.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import rnqc from 'react-native-quick-crypto';
// @ts-expect-error - crypto-browserify is not typed
import browserify from 'crypto-browserify';
import { hmac } from '@noble/hashes/hmac';
import { sha256 } from '@noble/hashes/sha2';
import { hmac } from '@noble/hashes/hmac.js';
import { sha256 } from '@noble/hashes/sha2.js';
import { utf8ToBytes } from '@noble/hashes/utils.js';
import type { BenchFn } from '../../types/benchmarks';
import { Bench } from 'tinybench';
import { text1MB, text8MB, buffer1MB, buffer8MB } from '../testData';

const hmacKey = 'test-key-for-hmac-benchmarks';
const hmacKeyBytes = utf8ToBytes(hmacKey);

const hmac_sha256_8mb_string: BenchFn = () => {
const bench = new Bench({
Expand All @@ -24,7 +26,7 @@ const hmac_sha256_8mb_string: BenchFn = () => {
h.digest('hex');
})
.add('@noble/hashes/hmac', () => {
hmac(sha256, hmacKey, text8MB);
hmac(sha256, hmacKeyBytes, utf8ToBytes(text8MB));
})
.add('browserify', () => {
const h = browserify.createHmac('sha256', hmacKey);
Expand All @@ -50,7 +52,7 @@ const hmac_sha256_1mb_string: BenchFn = () => {
h.digest('hex');
})
.add('@noble/hashes/hmac', () => {
hmac(sha256, hmacKey, text1MB);
hmac(sha256, hmacKeyBytes, utf8ToBytes(text1MB));
})
.add('browserify', () => {
const h = browserify.createHmac('sha256', hmacKey);
Expand All @@ -76,7 +78,7 @@ const hmac_sha256_8mb_buffer: BenchFn = () => {
h.digest('hex');
})
.add('@noble/hashes/hmac', () => {
hmac(sha256, hmacKey, buffer8MB);
hmac(sha256, hmacKeyBytes, buffer8MB);
})
.add('browserify', () => {
const h = browserify.createHmac('sha256', hmacKey);
Expand All @@ -102,7 +104,7 @@ const hmac_sha256_1mb_buffer: BenchFn = () => {
h.digest('hex');
})
.add('@noble/hashes/hmac', () => {
hmac(sha256, hmacKey, buffer1MB);
hmac(sha256, hmacKeyBytes, buffer1MB);
})
.add('browserify', () => {
const h = browserify.createHmac('sha256', hmacKey);
Expand Down
4 changes: 2 additions & 2 deletions example/src/benchmarks/pbkdf2/pbkdf2.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import rnqc from 'react-native-quick-crypto';
import * as noble from '@noble/hashes/pbkdf2';
import { sha256 } from '@noble/hashes/sha2';
import * as noble from '@noble/hashes/pbkdf2.js';
import { sha256 } from '@noble/hashes/sha2.js';
// @ts-expect-error - crypto-browserify is not typed
import browserify from 'crypto-browserify';
import type { BenchFn } from '../../types/benchmarks';
Expand Down
2 changes: 1 addition & 1 deletion example/src/benchmarks/scrypt/scrypt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import rnqc from 'react-native-quick-crypto';
import * as noble from '@noble/hashes/scrypt';
import * as noble from '@noble/hashes/scrypt.js';
import type { BenchFn } from '../../types/benchmarks';
import { Bench } from 'tinybench';

Expand Down
Loading