Conversation
…ile streaming HMAC
|
[CI] Important!
|
|
@picnixz can you take a look at the API? This is not the final form, but it should allow you to confirm this is headed in the right direction. What I have on my list is:
There's also a |
|
APIs for |
|
The digest function was missing! It's now in there, with the caveat that the implementation of |
|
Ok the key is no longer kept at runtime. We still have one issue which is that mmalloc_partial is unsound (CC @tahina-pro) so we need to remove that function and expose mmalloc_partial_uninitialized. See https://github.com/hacl-star/hacl-star/pull/1007/files#diff-6575620b2a57a4b1ceed2b0a54e8d51f8c4e29225d5e7ac991568dcf8ad251b3R230-R231 -- I'll say more on Monday I'll do another round later with the more minor fixes related to enums and excessive inlining. |
|
Ok so the problem is that My proposed fix is in FStarLang/karamel#513 and I just pushed a refresh C package that incorporates this fix. |
|
hey @picnixz I think I've fixed all of your comments and this should be in good shape -- when you get a chance, can you tell me whether this looks good for python? if so, I'll work on fixing the last few tidbits to get a green, then merge... thanks! |
|
Thank you! I am currently travelling and will be back next week. I have some work for the upcoming CRYPTO deadline but I'll definitely look at it after the 15th, if not before. |
|
Just talked about this with @R1kM and the plan is to merge this so that we have consistent null-checking across all those APIs now, then we can do follow-up touch-ups as you see fit if you have further tweaks requested. Cheers. |
|
The build issue is that there is now an incorrect dependency from SHA1 towards Blake2, most likely owing to type monomorphizations. Looking into it. |
|
@R1kM this turned out to be a lot more complicated than I thought: the fact that the streaming functor now relies on the option type means that various monomorphizations of What I ended up doing is lifting some of the state type definitions (which, upon being visited, would generate monomorphizations of option) into a separate file, and grouping all type definitions into one file. The net result is that all types now live in Hacl_Streaming_Types.h, including state types that contain pointers to arrays of vec128/vec256. This still compiles, because libintvector.h is always safe to include (vec256 becomes void* on platforms that don't support it, precisely for this use-case), but it's not ideal. Worse, because I can no longer eliminate unused declarations from this module (because their presence now has a side-effect), I get a C file with the discriminators (is_UU...). But @mtzguido has given me a secret attribute to remove that last bit so hopefully I can fix that. |
In support of python/cpython#126359, this is an implementation of streaming (incremental) HMAC for all known fixed-length hash algorithms in HACL*.
This went relatively smoothly (insofar as wrestling with Low* goes), with only a tiny modification to the streaming functor.
This is a work in progress, and I still want to clean up the toplevel API, but this verifies, extracts, and compiles.