summaryrefslogtreecommitdiff
path: root/rw.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2005-01-20 04:19:35 +0000
committerweidai <weidai11@users.noreply.github.com>2005-01-20 04:19:35 +0000
commitb3924f2108c0b0825060e91f6fde8202ce35624d (patch)
tree1f61e8bf59450a028415e5a3f08565a6ceb86afe /rw.cpp
parent79e29d0de49969af44474cc890cffd7b1d6b1a4b (diff)
downloadcryptopp-git-b3924f2108c0b0825060e91f6fde8202ce35624d.tar.gz
changes done for FIPS-140 lab code drop
Diffstat (limited to 'rw.cpp')
-rw-r--r--rw.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/rw.cpp b/rw.cpp
index 16534c81..2e565496 100644
--- a/rw.cpp
+++ b/rw.cpp
@@ -5,32 +5,9 @@
#include "nbtheory.h"
#include "asn.h"
-NAMESPACE_BEGIN(CryptoPP)
-
-void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator &rng,
- const byte *recoverableMessage, unsigned int recoverableMessageLength,
- HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
- byte *representative, unsigned int representativeBitLength) const
-{
- if (representativeBitLength % 8 != 7)
- throw PK_SignatureScheme::InvalidKeyLength("EMSA2: EMSA2 requires a key length that is a multiple of 8");
-
- unsigned int digestSize = hash.DigestSize();
- if (representativeBitLength < 8*digestSize + 31)
- throw PK_SignatureScheme::KeyTooShort();
-
- unsigned int representativeByteLength = BitsToBytes(representativeBitLength);
-
- representative[0] = messageEmpty ? 0x4b : 0x6b;
- memset(representative+1, 0xbb, representativeByteLength-digestSize-4); // pad with 0xbb
- byte *afterP2 = representative+representativeByteLength-digestSize-3;
- afterP2[0] = 0xba;
- hash.Final(afterP2+1);
- representative[representativeByteLength-2] = *hashIdentifier.first;
- representative[representativeByteLength-1] = 0xcc;
-}
+#ifndef CRYPTOPP_IMPORTS
-// *****************************************************************************
+NAMESPACE_BEGIN(CryptoPP)
void RWFunction::BERDecode(BufferedTransformation &bt)
{
@@ -201,3 +178,5 @@ void InvertibleRWFunction::AssignFrom(const NameValuePairs &source)
}
NAMESPACE_END
+
+#endif