HashStream.st
changeset 19644 b1ca9bfcb4ac
parent 19439 6015d8264192
child 19659 0f585374259a
child 21394 52c5888621c2
--- a/HashStream.st	Fri Apr 22 15:36:25 2016 +0200
+++ b/HashStream.st	Sat Apr 23 18:13:55 2016 +0200
@@ -186,15 +186,15 @@
 
 !HashStream class methodsFor:'utilities'!
 
-cryptBlock:aStringOrByteArray from:srcIdx into:resultOrNil startingAt:dstIdx encrypt:encryptMode
+cryptBlock:aStringOrByteArray from:srcIdx to:srcEndOrNil into:resultOrNil startingAt:dstIdx encrypt:encryptMode
     "one-way encryption of aStringOrByteArray.
-     Used when a HashStream is used as the block copher with OFB or CTR mode.
+     Used when a HashStream is used as the block cipher with OFB or CTR mode.
 
      encryptMode is ignored here."
 
     |hashValue|
 
-    srcIdx == 1 ifTrue:[
+    (srcIdx == 1 and:[srcEndOrNil isNil]) ifTrue:[
         hashValue := self hashValueOf:aStringOrByteArray.
     ] ifFalse:[
         |bytesToEncrypt|