HomePhabricator

[ecash-lib] Add `compressPk` to `Ecc`

Description

[ecash-lib] Add compressPk to Ecc

Summary:
Sometimes we receive an uncompressed pubkey (e.g. the pubkey in the genesis tx, or in X509), but Ecc expects compressed pubkeys.

Therefore, we add compressPk. This is very simple to implement in pure TS (no WASM needed), but since the reverse operation (uncompressPk) would require WASM, we add it to Ecc for consistency.

Depends on D17732.

Test Plan: npm test

Reviewers: bytesofman, #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17733

Details

Provenance
tobias_ruckAuthored on Sun, Mar 2, 21:13
tobias_ruckPushed on Tue, Mar 4, 09:42
Reviewer
Restricted Project
Differential Revision
D17733: [ecash-lib] Add `compressPk` to `Ecc`
Parents
rABCa9ecc915ff89: [ecash-lib] Add `ecdsaVerify` and `schnorrVerify` to `Ecc`
Branches
Unknown
Tags
Unknown