hyperledger-archives / ursa

Hyperledger Ursa (a shared cryptographic library) has moved to end-of-life status, with the components of Ursa still in use moved to their relevant Hyperledger projects (AnonCreds, Indy, Aries and Iroha).
https://wiki.hyperledger.org/display/ursa
Apache License 2.0
321 stars 142 forks source link

Avoid reallocation when creating BBS public key #176

Closed andrewwhitehead closed 3 years ago

andrewwhitehead commented 3 years ago

Currently the vec is one byte short, so it reallocates from 201 to 402 bytes.

hartm commented 3 years ago

Oh, that's a nice catch.

What kind of impact are you seeing on performance?

andrewwhitehead commented 3 years ago

@hartm I just ran quick benchmark but I don't think the difference is measurable given the other work the function is doing. The BBS vs PS benchmarks in libzmix don't compile at the moment.

I just added another commit that fixes a similar issue in BlindSignature::new.

dhuseby commented 3 years ago

I'll go ahead and try to fix and merge this.