summaryrefslogtreecommitdiff
path: root/test/crypto
diff options
context:
space:
mode:
authorMartin Ebourne <martin@ebourne.me.uk>2005-12-07 16:24:49 +0000
committerMartin Ebourne <martin@ebourne.me.uk>2005-12-07 16:24:49 +0000
commit065dc6f8cd168e3ee6e71ddfb06f42a92abfabbd (patch)
treeec09f9aff78d337b64ef4af7c7cba2d23a4ef0e9 /test/crypto
parent9950474440f85c5a35be8cfe7a85cee884209f20 (diff)
Merged chromi/diffopt at r116 to trunk
Diffstat (limited to 'test/crypto')
-rwxr-xr-xtest/crypto/testcrypto.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/crypto/testcrypto.cpp b/test/crypto/testcrypto.cpp
index 2b055f91..983ae57e 100755
--- a/test/crypto/testcrypto.cpp
+++ b/test/crypto/testcrypto.cpp
@@ -270,6 +270,12 @@ int test(int argc, const char *argv[])
RAND_pseudo_bytes(checkdata, CHECKSUM_DATA_SIZE);
for(int size = CHECKSUM_BLOCK_SIZE_BASE; size <= CHECKSUM_BLOCK_SIZE_LAST; ++size)
{
+ // Test skip-roll code
+ RollingChecksum rollFast(checkdata, size);
+ rollFast.RollForwardSeveral(checkdata, checkdata+size, size, CHECKSUM_ROLLS/2);
+ RollingChecksum calc(checkdata + (CHECKSUM_ROLLS/2), size);
+ TEST_THAT(calc.GetChecksum() == rollFast.GetChecksum());
+
//printf("size = %d\n", size);
// Checksum to roll
RollingChecksum roll(checkdata, size);