Avoid recomputing Ge normalized from Gej in Nonce process#168
Open
sanket1729 wants to merge 2 commits into
Open
Avoid recomputing Ge normalized from Gej in Nonce process#168sanket1729 wants to merge 2 commits into
sanket1729 wants to merge 2 commits into
Conversation
| @@ -450,7 +447,7 @@ int secp256k1_musig_nonce_process(const secp256k1_context* ctx, secp256k1_musig_ | |||
| } | |||
| secp256k1_gej_add_ge_var(&aggnonce_ptj[0], &aggnonce_ptj[0], &adaptorp, NULL); | |||
Member
There was a problem hiding this comment.
Thanks for the PR! I think you need to take this line into account. The [0] aggnonce may have changed, so we need to convert the changed nonce back to ge. (I don't think the same is necessary for [1])
Member
Author
There was a problem hiding this comment.
Moved the adaptor logic to the internal function.
- When the adaptor is NULL, there is no need to convert between
gejandge. - When the adaptor is not NULL, we only convert the required aggnonce[0]
1b971c0 to
9ce21fa
Compare
In secp256k1_musig_nonce_process(), we already have aggnonce in normalized form. We don't need to recompute them again in secp256k1_musig_nonce_process_internal().
9ce21fa to
a0aaee7
Compare
| } | ||
| if (!secp256k1_musig_nonce_process_internal(&session_i.fin_nonce_parity, fin_nonce, &session_i.noncecoef, aggnonce_ptj, agg_pk32, msg32)) { | ||
|
|
||
| if (!secp256k1_musig_nonce_process_internal(ctx, &session_i.fin_nonce_parity, fin_nonce, &session_i.noncecoef, aggnonce_ptj, aggnonce_pt, agg_pk32, msg32, adaptor)) { |
Member
There was a problem hiding this comment.
Wouldn't it be clearer to pass only the ges to secp256k1_musig_nonce_process_internal and compute the gejs only there?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In secp256k1_musig_nonce_process(), we already have aggnonce in
normalized form. We don't need to recompute them again in
secp256k1_musig_nonce_process_internal().
Moved the adaptor logic to the internal function.