summaryrefslogtreecommitdiff
path: root/cryptopp/crypto/emsa2.cpp
diff options
context:
space:
mode:
authorwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-26 14:19:43 +0000
committerwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-26 14:19:43 +0000
commit7aff1e4cb053394db57c2814d5fe1e6493e0cc75 (patch)
treec8585e44049b37e4da152495c954242204c2c38d /cryptopp/crypto/emsa2.cpp
parent6f3d69266933ef120d229e0daf2da164b77214d0 (diff)
Project folders rename part 2
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@214 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'cryptopp/crypto/emsa2.cpp')
-rw-r--r--cryptopp/crypto/emsa2.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/cryptopp/crypto/emsa2.cpp b/cryptopp/crypto/emsa2.cpp
deleted file mode 100644
index 4397435..0000000
--- a/cryptopp/crypto/emsa2.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-// emsa2.cpp - written and placed in the public domain by Wei Dai
-
-#include "pch.h"
-#include "emsa2.h"
-
-#ifndef CRYPTOPP_IMPORTS
-
-NAMESPACE_BEGIN(CryptoPP)
-
-void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator &rng,
- const byte *recoverableMessage, size_t recoverableMessageLength,
- HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
- byte *representative, size_t representativeBitLength) const
-{
- assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize()));
-
- if (representativeBitLength % 8 != 7)
- throw PK_SignatureScheme::InvalidKeyLength("EMSA2: EMSA2 requires a key length that is a multiple of 8");
-
- size_t digestSize = hash.DigestSize();
- size_t 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;
-}
-
-NAMESPACE_END
-
-#endif