Skip to content

Conversation

Faedon
Copy link
Collaborator

@Faedon Faedon commented Feb 7, 2025

The application implements Poseidon encryption to secure balance and transfer amount data. The encryption algorithm is detailed in the following paper: Encryption with Poseidon by Dmitry Khovratovich

During the decryption process, one of the verification steps is as follows:

If 3 does not divide l, verify that the last 3 − (l mod 3) elements of M are zero. If this condition is not met, the ciphertext must be rejected.

However, the decryption circuit lacks constraints to enforce this condition. Specifically, when the message length (l) is not a multiple of 3, the required zero-padding is not adequately validated."

Copy link
Collaborator

@furkan-ux furkan-ux left a comment

Choose a reason for hiding this comment

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

Do we need to constraint remainder here?

@Faedon
Copy link
Collaborator Author

Faedon commented Feb 10, 2025

Do we need to constraint remainder here?

We are not constrainting the remainder, its just the name of the variable here. I am making sure the paddings are zeroes if the message length not a multiple of 3.

@BeratOz01 BeratOz01 requested a review from furkan-ux February 13, 2025 10:21
@Faedon Faedon force-pushed the feat/hexens-poseidon-decryption-missing-constraints-on-padding branch from 4583d58 to e170e12 Compare March 10, 2025 12:15
@Faedon Faedon merged commit 6169b24 into main Mar 10, 2025
1 check passed
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