Skip to content

Comments

Check inputs are in the field#33

Open
AndriianChestnykh wants to merge 1 commit intomainfrom
fix/inputs-in-the-field-check
Open

Check inputs are in the field#33
AndriianChestnykh wants to merge 1 commit intomainfrom
fix/inputs-in-the-field-check

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

@OBrezhniev OBrezhniev requested a review from Kolezhniuk March 28, 2025 10:24
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