mirage / digestif

Simple hash algorithms in OCaml
MIT License
87 stars 26 forks source link

Feed a hmac #154

Open reynir opened 5 months ago

reynir commented 5 months ago

It could be useful to be able to feed a hmac in a similar way to how a digest is fed. This allows computing a hmac over data that can't fit in memory at once. I can probably suggest a change.

dinosaure commented 5 months ago

Actually, hmac is just an other way to initialise the ctx (which can be used to feed_*).

PS: We probably can expose something like: val with_key : key -> ctx

reynir commented 5 months ago

I later found the hmaci_* functions which would fit my current needs. Indeed, a val with_key : key -> ctx (or hmac_ctx if needed) would be nice to have.

dinosaure commented 5 months ago

Let's open this PR and see if someone else is interesting by such value.