summaryrefslogtreecommitdiff
path: root/strciphr.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-16 22:01:24 -0400
committerGitHub <noreply@github.com>2021-03-16 22:01:24 -0400
commitca123d14c1972fadc5865e114946414e75caac74 (patch)
treef525c2a1b62bdaf71b1979333b7b56b1936d57e7 /strciphr.h
parent4d15863b7195974e86427af4d4d4e3ce9d3e8ae7 (diff)
downloadcryptopp-git-ca123d14c1972fadc5865e114946414e75caac74.tar.gz
Avoid memcpy in AdditiveCipherTemplate<S>::ProcessData (GH #683, GH #1010, PR #1019)
We found we can avoid the memcpy in the previous workaround by using a volatile pointer. The pointer appears to tame the optimizer so the compiler does not short-circuit some calls when outString == inString.
Diffstat (limited to 'strciphr.h')
-rw-r--r--strciphr.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/strciphr.h b/strciphr.h
index 23cfbca9..7a71159a 100644
--- a/strciphr.h
+++ b/strciphr.h
@@ -702,13 +702,16 @@ public:
NAMESPACE_END
+// Used by dll.cpp to ensure objects are in dll.o, and not strciphr.o.
#ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
-#include "strciphr.cpp"
+# include "strciphr.cpp"
#endif
NAMESPACE_BEGIN(CryptoPP)
+
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractPolicyHolder<AdditiveCipherAbstractPolicy, SymmetricCipher>;
CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, SymmetricCipher> >;
+
CRYPTOPP_DLL_TEMPLATE_CLASS CFB_CipherTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, SymmetricCipher> >;
CRYPTOPP_DLL_TEMPLATE_CLASS CFB_EncryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, SymmetricCipher> >;
CRYPTOPP_DLL_TEMPLATE_CLASS CFB_DecryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, SymmetricCipher> >;