summaryrefslogtreecommitdiff
path: root/filters.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2004-02-05 03:35:13 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2004-02-05 03:35:13 +0000
commit64375b0c68b0bc184a2e88b75645699dca09b745 (patch)
treea076c2010d88ca94643e23eb8e1f3d5cfde4afd7 /filters.cpp
parent0deac093474ebd1dd5138b25ca7dd65b845f55c5 (diff)
downloadcryptopp-64375b0c68b0bc184a2e88b75645699dca09b745.tar.gz
fix ONE_AND_ZEROS_PADDING
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@146 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'filters.cpp')
-rw-r--r--filters.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/filters.cpp b/filters.cpp
index 7928abf..ee372bb 100644
--- a/filters.cpp
+++ b/filters.cpp
@@ -617,7 +617,7 @@ void StreamTransformationFilter::LastPut(const byte *inString, unsigned int leng
}
else
{
- space[length] = 1;
+ space[length] = 0x80;
memset(space+length+1, 0, s-length-1);
}
m_cipher.ProcessData(space, space, s);
@@ -637,9 +637,9 @@ void StreamTransformationFilter::LastPut(const byte *inString, unsigned int leng
}
else
{
- while (length > 1 && space[length-1] == '\0')
+ while (length > 1 && space[length-1] == 0)
--length;
- if (space[--length] != '\1')
+ if (space[--length] != 0x80)
throw InvalidCiphertext("StreamTransformationFilter: invalid ones-and-zeros padding found");
}
AttachedTransformation()->Put(space, length);