Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circuits V3: init commit. Update package deps. Replace test( ti it( #76

Closed
wants to merge 12 commits into from

Conversation

Kolezhniuk
Copy link
Collaborator

No description provided.

src/circuits/atomicV3.ts Outdated Show resolved Hide resolved
src/circuits/atomicV3.ts Outdated Show resolved Hide resolved
src/circuits/atomicV3.ts Outdated Show resolved Hide resolved
src/circuits/atomicV3.ts Show resolved Hide resolved
src/circuits/atomicV3.ts Outdated Show resolved Hide resolved
const isValidMTPType =
query.proofType === ProofType.Iden3SparseMerkleTreeProof && proofType === 2;

if (!isValidSigType || !isValidMTPType) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it will always fail (if isValidMTPType is true, isValidMTPType always would be false)

Copy link
Collaborator

@volodymyr-basiuk volodymyr-basiuk Jan 3, 2024

Choose a reason for hiding this comment

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

we need AND here I guess (as it was before)

@Kolezhniuk Kolezhniuk marked this pull request as ready for review January 18, 2024 12:39
const isValidMTPType =
query.proofType === ProofType.Iden3SparseMerkleTreeProof && proofType === 2;

if (!isValidSigType && !isValidMTPType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is wrong check.
if proofType == '' , then signal can be 1 or 2.
see https://github.com/iden3/go-iden3-auth/blob/8e8050511faf8384126ae6bb44641a5611b8e888/pubsignals/atomicV3.go#L57

throw new Error(`Nullifier id is generated but wasn't requested`);
}

if (typeof query.groupId === 'undefined' && this.pubSignals.linkID !== 0n) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we also need to check if groupId is provide linkNonce must not be zero

@@ -19,7 +18,7 @@ export class AuthPubSignalsV2 extends IDOwnershipPubSignals implements PubSignal
this.challenge = this.pubSignals.challenge;
}

async verifyQuery(_query: Query): Promise<void> {
async verifyQuery(): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

won't it throw error if we try to pass here query in auth.ts checks?

@Kolezhniuk Kolezhniuk closed this Jan 18, 2024
@Kolezhniuk Kolezhniuk deleted the feature/circuits-v3 branch January 18, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants