-
Notifications
You must be signed in to change notification settings - Fork 104
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
xmrswap: Remove C deps for signature encryption and dleq #2936
Conversation
Glad to see this! I did notice the dependency has various inefficiencies looking through it, but given that it won't be used in any type of hot paths, that is unlikely to matter much. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow.
closes #2918
a14385a
to
b16275a
Compare
@davecgh Thanks for the review! |
c0e9f55
to
c0b6848
Compare
@JoeGruffins since these adaptor signatures use schnorr signatures rather than ecdsa as was in the C library, I've updated the tx scripts to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the DLEQ dep for correctness, but aside from the last nit in my most recent comment, the adaptor sig code looks accurate and reasonably efficient.
|
||
import "github.com/decred/dcrd/txscript/v4" | ||
|
||
func LockRefundTxScript(kal, kaf []byte, locktime int64) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since probably nothing other than the internal code will use it, I'm sure you guys probably aren't worried about it, but I'd point out that with no function comment and variables named kal
and kaf
, it's pretty unclear what they are here without looking at the code to determine they're Schnorr sigs over secp256k1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @JoeGruffins will do some refactor regarding variable names throughout after this one is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
OK thanks for the reviews! I think DLEQ dep will have to be audited before we release anything, but I think it is fine for this POC currently. |
I followed up a bit on this comment, but it's resolved, so I figured I'd post a link to it here so it doesn't get missed. |
@martonp is on vacay, we'll pick up when they're back |
134d9ce
to
4fdfbb8
Compare
@martonp srry, conflicts need rebase |
Adds functions for encrypting / decrypting Schnorr signatures, and uses the athanorlabs/go-dleq library for discrete log equivalence.