Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Represent signature subpackets in an ordered map #9

Open
cfcs opened this issue Sep 20, 2017 · 1 comment
Open

Represent signature subpackets in an ordered map #9

cfcs opened this issue Sep 20, 2017 · 1 comment

Comments

@cfcs
Copy link
Contributor

cfcs commented Sep 20, 2017

We only want one of each signature subpacket per signature, and we need to preserve ordering when parsing in order to compute correct hashes.

An ordered map of some sort would make this easier, and would get rid of the List.filter/List.for_all/List.exists mess. Typed functions to retrieve subpackets of a certain kind would also get rid of a lot of warnings.

TODO find some module that exposes a usable Map module, or write one.

@hannesm
Copy link
Contributor

hannesm commented Sep 21, 2017

you mean ordering as "the binary data received"? I presume keeping the binary data around for hashing purposes might be a valid way to deal with that (but then, you have both subpackets which are parts of the signature and some which are not -- are they mixed?).

for the other topic "typed functions to retrieve subpackets" - I'd recommend to read up on the heterogenous map http://erratique.ch/software/hmap library (see an example usage in the test http://erratique.ch/repos/hmap/tree/test/test.ml), which allows you to have disjoint value (types) for each key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants