paritytech / libsecp256k1

Pure Rust Implementation of secp256k1.
Apache License 2.0
176 stars 84 forks source link

Support serde w/o std and update base64 dependency #153

Open mina86 opened 1 year ago

mina86 commented 1 year ago

By using base64’s encode_slice and decode_slice it’s possible to implement serde serialisation without std or alloc. Take advantage of that and allow enabling serde support separate from std. This is gated by a new serde feature which.

To maintain backwards-compatibility make std feature enables serde feature. Ideally, it should be possible to enable std without bringing in serde support. We're still in 0.x releases so there’s technically no semver issue in breaking builds, but for now it’s probably nicer to keep std enabling serde support. It probably makes sense to remove that in 0.8.

With all that, make serde and base64 dependencies optional. Previously, they were always included even though they were only used if std feature was enabled. Now, they are enabled only if explicitly requested.

While at it, update base64 dependency to the newest 0.21.2 release.

mina86 commented 11 months ago

@sorpaas, @alvicsam, friendly ping