diff options
author | lloyd <[email protected]> | 2011-07-05 20:45:23 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-07-05 20:45:23 +0000 |
commit | 1dbbec7519d75f7bc5b8fa23eb175c8a8f96a9b5 (patch) | |
tree | 4b2096bb10cd4de87fcd8aef7549e39cc1a0c95d /src/block/gost_28147/gost_28147.h | |
parent | b16bd4ad156f954dbcd4299e298765eececac19d (diff) |
The Algorithm_Factory has this logic on looking for an object:
- Check the cache; if found, return value
- Populate cache, if the value is already there, delete the old
object and save the new one.
- Recheck the cache value
Raja <[email protected]> pointed out on the list that this could race
if multiple threads called a lookup function in close succession while
the cache was cold. All of them would fail the lookup, then each of
them would add it, but the values returned would be deleted by other
threads.
Instead, declare that first write wins. Then, the cache stays
consistent even if there is a race, the only issue is an extra search
and delete.
Modify GOST and Skein, as their name() function did not roundtrip
properly which caused failures otherwise.
Diffstat (limited to 'src/block/gost_28147/gost_28147.h')
-rw-r--r-- | src/block/gost_28147/gost_28147.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/block/gost_28147/gost_28147.h b/src/block/gost_28147/gost_28147.h index 75ba74c44..bc26da774 100644 --- a/src/block/gost_28147/gost_28147.h +++ b/src/block/gost_28147/gost_28147.h @@ -57,7 +57,7 @@ class BOTAN_DLL GOST_28147_89 : public Block_Cipher_Fixed_Params<8, 32> void clear() { zeroise(EK); } - std::string name() const { return "GOST-28147-89"; } + std::string name() const; BlockCipher* clone() const { return new GOST_28147_89(SBOX); } /** |