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

Check inputs are in the field #33

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

Conversation

AndriianChestnykh
Copy link

No description provided.

const chunkSize = 32;
const chunks = [];
for (let i = 0; i < buff.length; i += chunkSize) {
chunks.push(buff.slice(i, i + chunkSize));
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess conversion to big int and check could be implemented in the same loop

}

chunks.forEach((chunk) => {
const bi = chunk.reduceRight((acc, n) => (acc << 8n) | BigInt(n), 0n);
Copy link
Contributor

Choose a reason for hiding this comment

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

@AndriianChestnykh better to use bigint to bytes conversions from library iden3/ffjavascript/src/utils.js
@OBrezhniev better to clarify with someone if little endian is valid here

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.

2 participants