# HG changeset patch # User Claus Gittinger # Date 1385132662 -3600 # Node ID a1a9948420e12402d115fad97f8b707e993f7563 # Parent 4b9f34ce8cc547e9415a22ad199e6a71dc8b2c7d class: RegressionTests::CryptTests added: #test10_des diff -r 4b9f34ce8cc5 -r a1a9948420e1 RegressionTests__CryptTests.st --- a/RegressionTests__CryptTests.st Tue Nov 19 20:13:58 2013 +0100 +++ b/RegressionTests__CryptTests.st Fri Nov 22 16:04:22 2013 +0100 @@ -241,6 +241,30 @@ self run:#test09_sha512 self new test09_sha512 " +! + +test10_des + |des crypt s s2| + + des := DesCipher new key:#[12 34 56 78 90 12 34 56]. + crypt := des encrypt:'12345678'. + self assert:(crypt = #[85 205 168 117 136 155 222 239]). + + "/ ------------------------------------------------ + + des := DesCipher new key:#[12 34 56 78 90 12 34 56]. + s := '12345678'. + 10 timesRepeat:[ + s2 := ByteArray new:s size. + des cryptBlock:s from:1 into:s2 startingAt:1 encrypt:true. + s := s2. + ]. + self assert:(s = #[212 114 83 160 109 1 37 83]). + + " + self run:#test10_des + self new test10_des + " ! ! !CryptTests class methodsFor:'documentation'!