Fix arm crypto logic issue in config_asm.h
The current logic for enabling or disabling the CRYPTOPP_ARM_*_AVAILABLE macros seems wrong, because we do an OR between all of the conditions following defined(__ARM_FEATURE_CRYPTO). Fix the logic so that the CRYPTOPP_ARM_*_AVAILABLE macros are set if __ARM_FEATURE_CRYPTO is set AND any of the following condition is true.
The current logic for enabling or disabling the
CRYPTOPP_ARM_*_AVAILABLEmacros seems wrong
OR'ed condition contains a list of known and allowed compilers; otherwise __ARM_FEATURE_CRYPTO could be used to force enabling of CRYPTOPP_ARM_*_AVAILABLE macros.
The current logic for enabling or disabling the
CRYPTOPP_ARM_*_AVAILABLEmacros seems wrongOR'ed condition contains a list of known and allowed compilers; otherwise
__ARM_FEATURE_CRYPTOcould be used to force enabling ofCRYPTOPP_ARM_*_AVAILABLEmacros.
That was the case before my patch, yes.
Now after my modification, a known and allowed compiler must be used and __ARM_FEATURE_CRYPTO must be set.
So I'm not sure I understand your comment.
Now after my modification, a known and allowed compiler must be used and
__ARM_FEATURE_CRYPTOmust be set.
Incorrect interpretation of code logic.
Should cryptopp need a single on/off switch here, then __ARM_FEATURE_CRYPTO would be checked before other conditions. In fact, all three blocks you suggested to change could have been placed under one check.
Should cryptopp need a single on/off switch here, then
__ARM_FEATURE_CRYPTOwould be checked before other conditions. In fact, all three blocks you suggested to change could have been placed under one check.
Sure, I can change the code so __ARM_FEATURE_CRYPTO is checked first, then the three compilers. This also makes sense to me. But I'm not sure that what we want after your comments.
This PR goes against portability, because any non-listed compiler would require source code changes.