◐ Shell
clean mode source ↗

gh-130213: POC let blake2module.c see far less internals by chris-eibl · Pull Request #130483 · python/cpython

Just a POC, because this is touching generated code.

Limit the view of the blake2module.c to the internals of the SIMD* implementations by using void *.

For me this now works for clang-cl 18.1.8, which does not "allow to see" the needed intrinsics without compiling for the proper architecture. I just temporarily use #undef HACL_CAN_COMPILE_SIMD128, because I did the POC only for the SIMD256 case.

And test_hashlib is still green :)

And the fast SIMD256 path is used, if the host where the binary is running supports it, without the need of SIMD flags when compiling blake2module.c.

I've checked in a debugging session during running test_hashlib, that the void * "public" functions are still invoked, and that they work like before after casting back to Hacl_Hash_Blake2b_Simd256_state_t *.