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

Batch verification discrepancy? #17

Open
ghost opened this issue May 3, 2014 · 3 comments
Open

Batch verification discrepancy? #17

ghost opened this issue May 3, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented May 3, 2014

I'm getting strange results with ed25519_sign_open_batch vs ed25519_sign_open.

I'm generating signatures with your library and js-nacl, and I've tried to follow your batch example as best as I can despite my inexperience.

In this case, I'm verifying 3 signatures. The arrays for batch verification are built from a single loop except for the first position in the array.

When verifying individually, all check out. The total batch verification does not return 0. The first in the valid array returns 1, the second 0, and the third 1.

I noticed from the docs that /* valid[i] will be set to 1 if the individual signature was valid, 0 otherwise */. Is that correct?

Regardless of what the values are, it returns in this same pattern, but I always have 3 signatures to batch verify for easy testing. I could setup a larger test, but that would take some time.

Am I doing something obviously wrong based upon this information?

Thank you so much for this great library! The individual signing and verifying is incredibly fast!

@ghost
Copy link
Author

ghost commented May 4, 2014

Also, is there a limit to the size of the batch?

Thank you again so very much in advance!

@floodyberry
Copy link
Owner

Can you add the data for the 3 signatures so I can take a look at what's happening?

There is no limit on the size of the batch. Internally the signatures are broken in to blocks of 64 signatures to try at once, but that is an arbitrary number selected for performance. I DO notice I only use the batch verification if the number of signatures to test is MORE than 3, while the SUPERCOP version does 3 or more. I'll see if that is affecting your tests as well

@ghost
Copy link
Author

ghost commented May 6, 2014

I'll get up an example as soon as I can.

Thank you for your great support!

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

No branches or pull requests

1 participant