feat: add combinePubkeys and privkeyAddTweak - #5
Conversation
003176e to
e72635f
Compare
feat: add privkeyMulTweak feat: new methods
e72635f to
c96488a
Compare
|
|
|
||
| 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.
Is there any changes that add another benchmark of verify?
There was a problem hiding this comment.
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.
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