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

fix(eddsa-poseidon): fixes carry handling of g function by introducing wrapper over original implementation #361

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Arch0125
Copy link
Contributor

Description

  • This PR replaces the existing blake-hash implementation with a TS wrapper over the original blake-hash npm package
  • Also includes required types for the blake-hash repo which was missing

Related Issue(s)

Closes #344

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run yarn style without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

…g original blake-hash imp

This commit replaces the existing implementation of blake-hash with a TS wrapper over original
blake-hash package and exposing required methods along with specified types for each

re privacy-scaling-explorations#344
Copy link
Collaborator

@artwyman artwyman left a comment

Choose a reason for hiding this comment

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

I'll defer to @cedoor to drive the real review here with more context.
For my thoughts/concerns, see my commentary in the related issue here: #344 (comment)

@@ -60,6 +60,7 @@
"dependencies": {
"@zk-kit/baby-jubjub": "1.0.3",
"@zk-kit/utils": "1.2.1",
"blake-hash": "^2.0.0",
"blakejs": "^1.2.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Does the blakejs library provide a blake1 hash which could be used here instead?
  • Alternately, have you checked whether the blakejs library might have the same error that this PR is fixing, and need its own update for the blake2b use case?

Copy link
Member

Choose a reason for hiding this comment

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

Does the blakejs library provide a blake1 hash which could be used here instead?

blakejs should only provide the following implementations: BLAKE2b and BLAKE2s.

Alternately, have you checked whether the blakejs library might have the same error that this PR is fixing, and need its own update for the blake2b use case?

Let me tag @thogiti for this question.

Copy link
Member

@cedoor cedoor left a comment

Choose a reason for hiding this comment

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

Following up on the @artwyman's comment: #344 (comment).

It would be nice to have a test for this fix.

Copy link
Member

Choose a reason for hiding this comment

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

Why this type in the poseidon-chipher lib?

@@ -60,6 +60,7 @@
"dependencies": {
"@zk-kit/baby-jubjub": "1.0.3",
"@zk-kit/utils": "1.2.1",
"blake-hash": "^2.0.0",
"blakejs": "^1.2.1",
Copy link
Member

Choose a reason for hiding this comment

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

Does the blakejs library provide a blake1 hash which could be used here instead?

blakejs should only provide the following implementations: BLAKE2b and BLAKE2s.

Alternately, have you checked whether the blakejs library might have the same error that this PR is fixing, and need its own update for the blake2b use case?

Let me tag @thogiti for this question.

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.

Fix carry handling in the g function in blake.ts
3 participants