thoughtpolice / salt

Fast cryptographic networking for Haskell
http://thoughtpolice.github.com/salt
MIT License
24 stars 1 forks source link

Pinned key types #21

Open tel opened 11 years ago

tel commented 11 years ago

Instead of using Bytestring to store keys a representation using Data.Vector.Storable is pinned in memory and never swapped making their use somewhat safer.

If this is a good fit I could write up a diff.

thoughtpolice commented 11 years ago

Sure. One thing to be aware of is that mlock(2) works on a page sized boundary. I am not sure how many private keys you would expect in a typical application, but a typical 4k to 8k for a single key is a bit wasteful. So you may want to manage that as you wish. I'd certainly accept a patch changing the underlying representation to storable, though.

See issue #10 (although it's pretty pie in the sky.)

thoughtpolice commented 11 years ago

Hm, also be aware that I'm currently working on changing the key types to be more parametric and type safe. The effects of this should mostly be localized, but I may or may not be done before you are, so just be aware (in the worst case I'll do the merge myself no matter what.)