fix multithreading bug
parent
0ad5a52c9a
commit
1b953a6a6c
9
esign.h
9
esign.h
|
|
@ -93,17 +93,14 @@ public:
|
||||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||||
byte *representative, unsigned int representativeBitLength) const
|
byte *representative, unsigned int representativeBitLength) const
|
||||||
{
|
{
|
||||||
m_digest.New(hash.DigestSize());
|
SecByteBlock digest(hash.DigestSize());
|
||||||
hash.Final(m_digest);
|
hash.Final(digest);
|
||||||
unsigned int representativeByteLength = BitsToBytes(representativeBitLength);
|
unsigned int representativeByteLength = BitsToBytes(representativeBitLength);
|
||||||
T mgf;
|
T mgf;
|
||||||
mgf.GenerateAndMask(hash, representative, representativeByteLength, m_digest, m_digest.size(), false);
|
mgf.GenerateAndMask(hash, representative, representativeByteLength, digest, digest.size(), false);
|
||||||
if (representativeBitLength % 8 != 0)
|
if (representativeBitLength % 8 != 0)
|
||||||
representative[0] = (byte)Crop(representative[0], representativeBitLength % 8);
|
representative[0] = (byte)Crop(representative[0], representativeBitLength % 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
mutable SecByteBlock m_digest;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! EMSA5, for use with ESIGN
|
//! EMSA5, for use with ESIGN
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue