Botan bindings devlog

The sun has risen again. You know what that means. The repo has been updated again.

  • Added Botan.Mac module for Message Authentication Codes
    • Construction of Botan mac type strings (eg, “HMAC(SHA-256)”, “SipHash(2,4)”) is badly-documented.
    • Some MACs require nonces, but this is also badly documented.
  • Refined handling of foreign pointers of botan objects / initializers / finalizers
    • Accurate types for opaque struct, pointer, and foreign pointer.
    • Uses FinalizerPtr type
    • Avoids an extra pointer indirection
    • Still fiddling with standardizing the nomenclature, only applied to Botan.Mac
      • Botan.Hash and Botan.Random still need retrofitting
    • Thanks to @glguy for help

Today’s efforts are going to be focused on updating the foreign pointer handling in Botan.Hash and Botan.Random, and getting a better sense of what needs to be standardized - eg, whether I will continue with straight 1:1 bindings, or instead do some encapsulation, considering:

  • Things like the hash / mac / rng type strings. macInitName "HMAC(SHA-256)" are both incredibly simple, yet incredibly awkward, and need constants at the very least.
  • Checking for algorithm support is also awkward (read, effectively non-existent)so I need to pick a method of handling it, and standardize that as well.

So basically a grab-bag of things that I want to take care of before we get enough modules to make them difficult.

Also, by line count, we are almost 1/4 of the way through the botan ffi header! Things do get denser towards the bottom, especially with x509 certs, but still… :partying_face:


@david-christiansen
I’m glad you are! Tough work is so much less of a slog when there are people rooting for you along the way, and the community’s response has really been keeping me going :slight_smile:

6 Likes