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

Use the same method that we generate private keys in BLS #239

Open
jonas-lj opened this issue Nov 20, 2022 · 1 comment
Open

Use the same method that we generate private keys in BLS #239

jonas-lj opened this issue Nov 20, 2022 · 1 comment

Comments

@jonas-lj
Copy link
Contributor

jonas-lj commented Nov 20, 2022

we could use the same method that we generate private keys in BLS where some 32 bytes entropy bytes are an input, in our case the whole digest. However @asonnino it's very common for rogue key protection to use half scalars, because we care about pre-image attacks; you try to cancel-out another pub key, so combinatorics are already very expensive.

We do use half scalars in many apps (ie in the EdDSA half aggregation) for performance reasons to make that exponentiation half-expensive. In fact though, here we don't care, as this applies once at private key randomization (and with our mode where new-priv_key = old_priv_key \times this_scalar, we don't even have an ECC operation).

@asonnino: You remember the discussion we had at overleaf, shall we update the private key or for each signature we multiply by this scalar? if we do the former half or full scalar doesn't really matter. In the second you have to pay that cost every time you sign.

Originally posted by @kchalkias in #236 (comment)

@jonas-lj
Copy link
Contributor Author

@kchalkias There's a method called get_128bit_scalar given an RNG in the bls12381 module which is used to randomise signatures in verify_batch_empty_fail_different_msg. If half scalars are enough, we could change this method to take 16 bytes instead. Using the generate method, as you suggest, is also possible but then we would have to either extract the scalar from the private key afterwards, or use the private key type to represent the scalar.

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