vulpemventures / secp256k1-zkp

JavaScript bindings of libsecp256k1-zkp with support for pedersen commitments and range proofs.
MIT License
15 stars 10 forks source link

Update glue js/c #32

Closed altafan closed 1 year ago

altafan commented 1 year ago

In #85 we are changing the zkp interface, which is an effort to improve the usability, maintainability and readability of the this secp256k1-zkp lib.

Along with #31, we must also update the js/c glue to be compliant with the new interface:

The main changes involve:

  • renaming Ec as Ecc and declaring it as extension of tiny-secp interface
  • replacing Buffer with Uint8Array for browser support
  • replacing number with string to prevent any conversion issue from js to c
  • removing serialize/parse methods (implementation details that should be hided in out abstraction)
  • representing surjection proof as Uint8Array instead of object with low-level details
  • renaming and re-ordering some methods' args for readability
altafan commented 1 year ago

Closed by #33..#37