intel / isa-l_crypto

Other
267 stars 80 forks source link

sha256_mb_rand_ssl_test fails for various implementations (v2.24.0 & master) #101

Closed madMAx43v3r closed 2 years ago

madMAx43v3r commented 2 years ago

Changing sha256_ctx_mgr_init() to one of the following causes the sha256_mb_rand_ssl_test.c test to fail:

sha256_ctx_mgr_init_sse()
sha256_ctx_mgr_init_sse_ni()
sha256_ctx_mgr_init_avx()

The only working one is: sha256_ctx_mgr_init_avx2

Tested on: AMD Ryzen 7 5800H gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

gbtucker commented 2 years ago

Hi @madMAx43v3r,

You only mention changing one. The functions here must all run together with the same optimization. If you change just one like _init() and not match with the others it will certainly fail. This is one reason why we strongly suggest using the exported multi-binary functions sha256_ctx_mgr_{init, submit, flush}() that choose an appropriate version at run time.

madMAx43v3r commented 2 years ago

I see, rookie mistake there. Thx.