Keep an eye on this one: Botan in D, https://github.com/etcimon/botan
Should be finished in a couple weeks. e.g. from the TLS module: auto hmac = get_mac("HMAC(SHA-256)"); hmac.set_key(secret_key); hmac.update_be(client_hello_bits.length); hmac.update(client_hello_bits); hmac.update_be(client_identity.length); hmac.update(client_identity); m_cookie = unlock(hmac.flush());