diff options
author | weidai <weidai11@users.noreply.github.com> | 2003-07-29 01:18:33 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2003-07-29 01:18:33 +0000 |
commit | 9c5c4769a9c7a16aecc6cc7dd297bfe243dd022f (patch) | |
tree | 7a78ed3becd2c14f449d1cc66a58edd414256d94 /xtr.cpp | |
parent | 259ee22eba4e4e6471caa088479a93fbee894e11 (diff) | |
download | cryptopp-git-9c5c4769a9c7a16aecc6cc7dd297bfe243dd022f.tar.gz |
fix potential threading problem with initialization of static objects
Diffstat (limited to 'xtr.cpp')
-rw-r--r-- | xtr.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -8,10 +8,9 @@ NAMESPACE_BEGIN(CryptoPP) -GFP2Element & GFP2Element::Zero() +const GFP2Element & GFP2Element::Zero() { - static GFP2Element zero; - return zero; + return Singleton<GFP2Element>().Ref(); } void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer &q, GFP2Element &g, unsigned int pbits, unsigned int qbits) |