+byte *sha1_hmac_final(sha1_hmac_context *hd)
+{
+ // Finish the inner digest
+ byte *isha = sha1_final(&hd->ictx);
+
+ // Finish the outer digest
+ sha1_update(&hd->octx, isha, SHA1_SIZE);
+ return sha1_final(&hd->octx);
+}
+
+void
+sha1_hmac(byte *outbuf, const byte *key, uint keylen, const byte *data, uint datalen)
+{
+ sha1_hmac_context hd;
+ sha1_hmac_init(&hd, key, keylen);
+ sha1_hmac_update(&hd, data, datalen);
+ byte *osha = sha1_hmac_final(&hd);