diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2005-07-12 04:23:32 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2005-07-12 04:23:32 +0000 |
commit | d5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47 (patch) | |
tree | 4b03760892a97a9bc452ebe8b7793bbebd402ad4 /gfpcrypt.h | |
parent | fa39f51809b4da54a5c2adb3e183b1a625cefb92 (diff) | |
download | cryptopp-d5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47.tar.gz |
port to MSVC .NET 2005 beta 2
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@198 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'gfpcrypt.h')
-rw-r--r-- | gfpcrypt.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -421,13 +421,13 @@ class DL_EncryptionAlgorithm_Xor : public DL_SymmetricEncryptionAlgorithm { public: bool ParameterSupported(const char *name) const {return strcmp(name, Name::EncodingParameters()) == 0;} - unsigned int GetSymmetricKeyLength(unsigned int plaintextLength) const + size_t GetSymmetricKeyLength(size_t plaintextLength) const {return plaintextLength + MAC::DEFAULT_KEYLENGTH;} - unsigned int GetSymmetricCiphertextLength(unsigned int plaintextLength) const + size_t GetSymmetricCiphertextLength(size_t plaintextLength) const {return plaintextLength + MAC::DIGESTSIZE;} - unsigned int GetMaxSymmetricPlaintextLength(unsigned int ciphertextLength) const - {return SaturatingSubtract(ciphertextLength, (unsigned int)MAC::DIGESTSIZE);} - void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plaintext, unsigned int plaintextLength, byte *ciphertext, const NameValuePairs ¶meters) const + size_t GetMaxSymmetricPlaintextLength(size_t ciphertextLength) const + {return (unsigned int)SaturatingSubtract(ciphertextLength, (unsigned int)MAC::DIGESTSIZE);} + void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters) const { const byte *cipherKey, *macKey; if (DHAES_MODE) @@ -456,9 +456,9 @@ public: } mac.Final(ciphertext + plaintextLength); } - DecodingResult SymmetricDecrypt(const byte *key, const byte *ciphertext, unsigned int ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const + DecodingResult SymmetricDecrypt(const byte *key, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const { - unsigned int plaintextLength = GetMaxSymmetricPlaintextLength(ciphertextLength); + size_t plaintextLength = GetMaxSymmetricPlaintextLength(ciphertextLength); const byte *cipherKey, *macKey; if (DHAES_MODE) { @@ -497,7 +497,7 @@ class DL_KeyDerivationAlgorithm_P1363 : public DL_KeyDerivationAlgorithm<T> { public: bool ParameterSupported(const char *name) const {return strcmp(name, Name::KeyDerivationParameters()) == 0;} - void Derive(const DL_GroupParameters<T> ¶ms, byte *derivedKey, unsigned int derivedLength, const T &agreedElement, const T &ephemeralPublicKey, const NameValuePairs ¶meters) const + void Derive(const DL_GroupParameters<T> ¶ms, byte *derivedKey, size_t derivedLength, const T &agreedElement, const T &ephemeralPublicKey, const NameValuePairs ¶meters) const { SecByteBlock agreedSecret; if (DHAES_MODE) |