-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add combinePubkeys and privkeyAddTweak #5
base: master
Are you sure you want to change the base?
Conversation
003176e
to
e72635f
Compare
feat: add privkeyMulTweak feat: new methods
e72635f
to
c96488a
Compare
|
@@ -46,6 +46,7 @@ secp256k1Async().then(function (secp256k1Wasm) { | |||
|
|||
new benchmark.Suite('Verify') | |||
.add('Secp256k1 WASM (current)', () => secp256k1Wasm.verify(msg, sig.signature, pubkey)) | |||
.add('Secp256k1 0.2.1 WASM (current)', () => secp256k121Wasm.verify(msg, sig.signature, pubkey)) |
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.
Is there any changes that add another benchmark of verify?
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 see, it's for memory scratch.
And I have these questions:
- Should we wipe the scratch buffer before calling
copyToBuffer
(or incopyToBuffer
)? - Should we free these memory when the object destroy?
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 took the idea from libauth https://github.com/bitauth/libauth/blob/13454f1f6b3d9e87b6361cc71f082950fe6abf3a/src/lib/crypto/secp256k1.ts#L56-L64
I think wiping the memory is not necessary before calling copyToBuffer, overwriting is fine.
Private key buffers could be wiped out after used just-in-case
WebAssembly mostly reserves a big chunk of memory on the instantiate() call. GC should free the whole chunk when possible, no matter how much malloc
is used inside WASM
Sorry for not being that active responding
Also, I didn't get around benchmarking some of the new methods |
#!/bin/bash
. Otherwise it would fail on /bin/sh