summaryrefslogtreecommitdiff
path: root/pubkey.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-29 01:18:33 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-29 01:18:33 +0000
commit483c74aaab7c20d82a48621f1dd8b300292d3404 (patch)
tree7a78ed3becd2c14f449d1cc66a58edd414256d94 /pubkey.h
parenta01d216aab60849e4581efd41820f18562085687 (diff)
downloadcryptopp-483c74aaab7c20d82a48621f1dd8b300292d3404.tar.gz
fix potential threading problem with initialization of static objects
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@118 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'pubkey.h')
-rw-r--r--pubkey.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/pubkey.h b/pubkey.h
index fcf3f50..1b7f047 100644
--- a/pubkey.h
+++ b/pubkey.h
@@ -414,7 +414,7 @@ public:
protected:
const typename BASE::MessageEncodingInterface & GetMessageEncodingInterface() const
- {static typename SCHEME_OPTIONS::MessageEncodingMethod messageEncodingMethod; return messageEncodingMethod;}
+ {return Singleton<CPP_TYPENAME SCHEME_OPTIONS::MessageEncodingMethod>().Ref();}
const TrapdoorFunctionBounds & GetTrapdoorFunctionBounds() const
{return GetKey();}
const typename BASE::TrapdoorFunctionInterface & GetTrapdoorFunctionInterface() const
@@ -1322,17 +1322,17 @@ public:
protected:
const DL_ElgamalLikeSignatureAlgorithm<Element> & GetSignatureAlgorithm() const
- {static typename SCHEME_OPTIONS::SignatureAlgorithm a; return a;}
+ {return Singleton<CPP_TYPENAME SCHEME_OPTIONS::SignatureAlgorithm>().Ref();}
const DL_KeyAgreementAlgorithm<Element> & GetKeyAgreementAlgorithm() const
- {static typename SCHEME_OPTIONS::KeyAgreementAlgorithm a; return a;}
+ {return Singleton<CPP_TYPENAME SCHEME_OPTIONS::KeyAgreementAlgorithm>().Ref();}
const DL_KeyDerivationAlgorithm<Element> & GetKeyDerivationAlgorithm() const
- {static typename SCHEME_OPTIONS::KeyDerivationAlgorithm a; return a;}
+ {return Singleton<CPP_TYPENAME SCHEME_OPTIONS::KeyDerivationAlgorithm>().Ref();}
const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const
- {static typename SCHEME_OPTIONS::SymmetricEncryptionAlgorithm a; return a;}
+ {return Singleton<CPP_TYPENAME SCHEME_OPTIONS::SymmetricEncryptionAlgorithm>().Ref();}
HashIdentifier GetHashIdentifier() const
{return HashIdentifier();}
const PK_SignatureMessageEncodingMethod & GetMessageEncodingInterface() const
- {static typename SCHEME_OPTIONS::MessageEncodingMethod a; return a;}
+ {return Singleton<CPP_TYPENAME SCHEME_OPTIONS::MessageEncodingMethod>().Ref();}
};
//! .