File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -613,6 +613,10 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
613613 #define AESNI_ALIGN 16
614614 #endif
615615
616+ /* note that all write access to these static variables must be idempotent,
617+ * as arranged by Check_CPU_support_AES(), else they will be susceptible to
618+ * data races.
619+ */
616620 static int checkedAESNI = 0 ;
617621 static int haveAESNI = 0 ;
618622 static word32 intel_flags = 0 ;
Original file line number Diff line number Diff line change @@ -408,6 +408,10 @@ static int InitSha256(wc_Sha256* sha256)
408408 SHA256_SSE2 , SHA256_C };
409409
410410#ifndef WC_C_DYNAMIC_FALLBACK
411+ /* note that all write access to this static variable must be idempotent,
412+ * as arranged by Sha256_SetTransform(), else it will be susceptible to
413+ * data races.
414+ */
411415 static enum sha_methods sha_method = SHA256_UNSET ;
412416#endif
413417
Original file line number Diff line number Diff line change @@ -489,6 +489,10 @@ static int InitSha512_256(wc_Sha512* sha512)
489489 SHA512_AVX1_RORX , SHA512_AVX2_RORX , SHA512_C };
490490
491491#ifndef WC_C_DYNAMIC_FALLBACK
492+ /* note that all write access to this static variable must be idempotent,
493+ * as arranged by Sha512_SetTransform(), else it will be susceptible to
494+ * data races.
495+ */
492496 static enum sha_methods sha_method = SHA512_UNSET ;
493497#endif
494498
You can’t perform that action at this time.
0 commit comments