Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace the internal usage of Cstruct.t by string (#146)
Originally, we used Cstruct.t (bigarray) for interfacing. Instead, we use string now. The benefit is that allocating a string is cheap, and in line with OCaml's GC. After some years of stalling, we included benchmarks in bench/speed.ml fot the EC operations in #192 (sign, verify, generate for EC/EdDSA; and ECDH). The result for thi change is a factor between 2 and 2.5. The external API (mirage_crypto_ec.mli) does not change at all. There are various other cleanups in the code, such as providing a layer to isolate the C calls (which receive a bytes buffer for the result value, and thus mutate this buffer) to be immutable. Co-authored-by: Pierre Alain <pierre.alain@tuta.io> Co-authored-by: Hannes Mehnert <hannes@mehnert.org> Co-authored-by: Reynir Björnsson <reynir@reynir.dk> Reviewed-by: Virgile Robles <virgile.robles@protonmail.ch> Reviewed-by: Pierre Alain <pierre.alain@tuta.io>
- Loading branch information