Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"dependencies": {
"@babel/runtime": "^7.28.3",
"@ethersproject/shims": "^5.7.0",
"@noble/hashes": "^1.5.0",
"@noble/hashes": "^2.0.0",
"@openpassport/zk-kit-imt": "^0.0.5",
"@openpassport/zk-kit-lean-imt": "^0.0.6",
"@openpassport/zk-kit-smt": "^0.0.1",
Expand Down
10 changes: 6 additions & 4 deletions app/src/utils/ethers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

// https://docs.ethers.org/v6/cookbook/react-native/
import { ethers } from 'ethers';
import { hmac } from '@noble/hashes/hmac';
import { pbkdf2 as noblePbkdf2 } from '@noble/hashes/pbkdf2';
import { sha256 as nobleSha256 } from '@noble/hashes/sha256';
import { sha512 as nobleSha512 } from '@noble/hashes/sha512';
import { hmac } from '@noble/hashes/hmac.js';
import { pbkdf2 as noblePbkdf2 } from '@noble/hashes/pbkdf2.js';
import {
sha256 as nobleSha256,
sha512 as nobleSha512,
} from '@noble/hashes/sha2.js';

function randomBytes(length: number): Uint8Array {
if (typeof globalThis.crypto?.getRandomValues !== 'function') {
Expand Down
2 changes: 1 addition & 1 deletion circuits/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@anon-aadhaar/core": "npm:@selfxyz/anon-aadhaar-core@^0.0.1",
"@noble/curves": "^1.4.2",
"@noble/curves": "^2.0.0",
"@openpassport/zk-email-circuits": "^6.1.2",
"@openpassport/zk-kit-imt": "^0.0.4",
"@openpassport/zk-kit-lean-imt": "^0.0.4",
Expand Down
2 changes: 1 addition & 1 deletion common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
},
"dependencies": {
"@anon-aadhaar/core": "npm:@selfxyz/anon-aadhaar-core@^0.0.1",
"@noble/hashes": "^1.5.0",
"@noble/hashes": "^2.0.0",
"@openpassport/zk-kit-imt": "^0.0.5",
"@openpassport/zk-kit-lean-imt": "^0.0.6",
"@openpassport/zk-kit-smt": "^0.0.1",
Expand Down
10 changes: 4 additions & 6 deletions common/src/polyfills/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
* This replaces crypto-browserify with a more modern and secure implementation
*/

import { hmac } from '@noble/hashes/hmac';
import { md5 as nobleMd5 } from '@noble/hashes/legacy';
import { pbkdf2 as noblePbkdf2 } from '@noble/hashes/pbkdf2';
import { sha1 as nobleSha1 } from '@noble/hashes/sha1';
import { sha256 as nobleSha256 } from '@noble/hashes/sha256';
import { sha512 as nobleSha512 } from '@noble/hashes/sha512';
import { hmac } from '@noble/hashes/hmac.js';
import { md5 as nobleMd5, sha1 as nobleSha1 } from '@noble/hashes/legacy.js';
import { pbkdf2 as noblePbkdf2 } from '@noble/hashes/pbkdf2.js';
import { sha256 as nobleSha256, sha512 as nobleSha512 } from '@noble/hashes/sha2.js';

// Create hash instances that mimic Node.js crypto API
function createHash(algorithm: string) {
Expand Down
2 changes: 1 addition & 1 deletion common/tests/cryptoHash.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { createHash } from '../src/polyfills/crypto';

import { sha256 } from '@noble/hashes/sha256';
import { sha256 } from '@noble/hashes/sha2.js';

describe('Hash Finalization', () => {
const message = 'Hello World!';
Expand Down
4 changes: 2 additions & 2 deletions common/tests/cryptoHmac.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import { createHmac } from '../src/polyfills/crypto';

import { hmac } from '@noble/hashes/hmac';
import { sha256 } from '@noble/hashes/sha256';
import { hmac } from '@noble/hashes/hmac.js';
import { sha256 } from '@noble/hashes/sha2.js';

describe('HMAC Streaming', () => {
const key = 'test-key';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

import { sha256 } from '@noble/hashes/sha256';
import { sha256 } from '@noble/hashes/sha2.js';
import type { PropsWithChildren } from 'react';
import React, { useMemo } from 'react';

Expand Down
7 changes: 3 additions & 4 deletions packages/mobile-sdk-demo/src/utils/ethers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
// https://docs.ethers.org/v6/cookbook/react-native/
import { ethers } from 'ethers';

import { hmac } from '@noble/hashes/hmac';
import { pbkdf2 as noblePbkdf2 } from '@noble/hashes/pbkdf2';
import { sha256 as nobleSha256 } from '@noble/hashes/sha256';
import { sha512 as nobleSha512 } from '@noble/hashes/sha512';
import { hmac } from '@noble/hashes/hmac.js';
import { pbkdf2 as noblePbkdf2 } from '@noble/hashes/pbkdf2.js';
import { sha256 as nobleSha256, sha512 as nobleSha512 } from '@noble/hashes/sha2.js';

function randomBytes(length: number): Uint8Array {
if (typeof globalThis.crypto?.getRandomValues !== 'function') {
Expand Down
33 changes: 20 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4882,12 +4882,12 @@ __metadata:
languageName: node
linkType: hard

"@noble/curves@npm:^1.4.2":
version: 1.9.7
resolution: "@noble/curves@npm:1.9.7"
"@noble/curves@npm:^2.0.0":
version: 2.0.1
resolution: "@noble/curves@npm:2.0.1"
dependencies:
"@noble/hashes": "npm:1.8.0"
checksum: 10c0/150014751ebe8ca06a8654ca2525108452ea9ee0be23430332769f06808cddabfe84f248b6dbf836916bc869c27c2092957eec62c7506d68a1ed0a624017c2a3
"@noble/hashes": "npm:2.0.1"
checksum: 10c0/e0b329eb9229e862d3b7203e0444bd479e9ecf2d5990181908dad416aab69106717ca696fc7b12ad0eb19d710f58c454646b27ce517a4298ab9abc89a9bdb6ee
languageName: node
linkType: hard

Expand Down Expand Up @@ -4928,7 +4928,14 @@ __metadata:
languageName: node
linkType: hard

"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:^1.5.0":
"@noble/hashes@npm:2.0.1, @noble/hashes@npm:^2.0.0":
version: 2.0.1
resolution: "@noble/hashes@npm:2.0.1"
checksum: 10c0/e81769ce21c3b1c80141a3b99bd001f17edea09879aa936692ae39525477386d696101cd573928a304806efb2b9fa751e1dd83241c67d0c84d30091e85c79bdb
languageName: node
linkType: hard

"@noble/hashes@npm:^1.4.0, @noble/hashes@npm:^1.5.0":
version: 1.8.0
resolution: "@noble/hashes@npm:1.8.0"
checksum: 10c0/06a0b52c81a6fa7f04d67762e08b2c476a00285858150caeaaff4037356dd5e119f45b2a530f638b77a5eeca013168ec1b655db41bae3236cb2e9d511484fc77
Expand Down Expand Up @@ -7146,7 +7153,7 @@ __metadata:
resolution: "@selfxyz/circuits@workspace:circuits"
dependencies:
"@anon-aadhaar/core": "npm:@selfxyz/anon-aadhaar-core@^0.0.1"
"@noble/curves": "npm:^1.4.2"
"@noble/curves": "npm:^2.0.0"
"@openpassport/zk-email-circuits": "npm:^6.1.2"
"@openpassport/zk-kit-imt": "npm:^0.0.4"
"@openpassport/zk-kit-lean-imt": "npm:^0.0.4"
Expand All @@ -7161,8 +7168,8 @@ __metadata:
"@yarnpkg/sdks": "npm:^3.2.0"
"@zk-email/circuits": "npm:^6.3.2"
"@zk-email/helpers": "npm:^6.1.1"
"@zk-email/jwt-tx-builder-circuits": "npm:^0.1.0"
"@zk-email/jwt-tx-builder-helpers": "npm:^0.1.0"
"@zk-email/jwt-tx-builder-circuits": "npm:0.1.0"
"@zk-email/jwt-tx-builder-helpers": "npm:0.1.0"
"@zk-email/zk-regex-circom": "npm:^1.2.1"
"@zk-kit/binary-merkle-root.circom": "https://gitpkg.vercel.app/Vishalkulkarni45/zk-kit.circom/packages/binary-merkle-root?fix/bin-merkle-tree"
"@zk-kit/circuits": "npm:^1.0.0-beta"
Expand Down Expand Up @@ -7201,7 +7208,7 @@ __metadata:
resolution: "@selfxyz/common@workspace:common"
dependencies:
"@anon-aadhaar/core": "npm:@selfxyz/anon-aadhaar-core@^0.0.1"
"@noble/hashes": "npm:^1.5.0"
"@noble/hashes": "npm:^2.0.0"
"@openpassport/zk-kit-imt": "npm:^0.0.5"
"@openpassport/zk-kit-lean-imt": "npm:^0.0.6"
"@openpassport/zk-kit-smt": "npm:^0.0.1"
Expand Down Expand Up @@ -7346,7 +7353,7 @@ __metadata:
"@babel/preset-env": "npm:^7.28.3"
"@babel/runtime": "npm:^7.28.3"
"@ethersproject/shims": "npm:^5.7.0"
"@noble/hashes": "npm:^1.5.0"
"@noble/hashes": "npm:^2.0.0"
"@openpassport/zk-kit-imt": "npm:^0.0.5"
"@openpassport/zk-kit-lean-imt": "npm:^0.0.6"
"@openpassport/zk-kit-smt": "npm:^0.0.1"
Expand Down Expand Up @@ -13162,7 +13169,7 @@ __metadata:
languageName: node
linkType: hard

"@zk-email/jwt-tx-builder-circuits@npm:^0.1.0":
"@zk-email/jwt-tx-builder-circuits@npm:0.1.0":
version: 0.1.0
resolution: "@zk-email/jwt-tx-builder-circuits@npm:0.1.0"
dependencies:
Expand All @@ -13178,7 +13185,7 @@ __metadata:
languageName: node
linkType: hard

"@zk-email/jwt-tx-builder-helpers@npm:^0.1.0":
"@zk-email/jwt-tx-builder-helpers@npm:0.1.0":
version: 0.1.0
resolution: "@zk-email/jwt-tx-builder-helpers@npm:0.1.0"
dependencies:
Expand Down
Loading