mirleft / ocaml-asn1-combinators

Embed typed ASN.1 grammars in OCaml
ISC License
35 stars 20 forks source link

remove zarith dependency, an Integer is now just a Cstruct.t #42

Closed hannesm closed 6 months ago

hannesm commented 6 months ago

Most of the time (apart from in X.509 certificates or other PKCS forms), an Integer is just a serial number, and decoding/encoding as a big number is not necessary.

This PR removes the dependency on zarith. The small integers (Asn.S.int) are still present and conform to OCaml's builtin int type.

hannesm commented 6 months ago

Thanks @reynir, I revised the code and added some test cases at the edges of what we can read/write.

reynir commented 6 months ago

Did you mean to push c881f18b5c02db612915f63db3c8c760e0432333? It looks like printf debugging ;-)

hannesm commented 6 months ago

Did you mean to push c881f18? It looks like printf debugging ;-)

yes, there was a failure in one CI (the lower bound), and I intended to figure out the internals since I wasn't able to reproduce. Now, I think I figured -- we need ptime 0.8.6 (where truncate has been fixed).

hannesm commented 6 months ago

I force-pushed (separated the commits into sensible parts).