tiny-secp256k1 icon indicating copy to clipboard operation
tiny-secp256k1 copied to clipboard

ecc library invalid

Open bucko13 opened this issue 9 months ago • 0 comments

I'm trying to use this to init bitcoinjs-lib. When running in a test (see #62) I get an error : ecc library invalid.

Versions:

[email protected]
[email protected]

When digging in to this a little, I was able to get the validation to pass by changing the isUint8Array function. If that becomes a no_op then the rest of the validations pass. If I change it to:

function isUint8Array(value) {
    return value instanceof Buffer
}

it passes.

It's possible there's some weird polyfill going on in my environment which is why it's passing for some and not others. That said, when looking at the validation in bitcoinjs-lib (which maybe this should be filed there?) it does convert a point hex to a Buffer but then the validation library here checks to see if it's an instance of Uint8Array.

bucko13 avatar May 03 '24 07:05 bucko13