SHA1Stream.st
branchjv
changeset 18017 7fef9e17913f
parent 18011 deb0c3355881
parent 14723 8657c48a4c03
child 18027 3621469cc5e8
--- a/SHA1Stream.st	Wed Jan 23 10:08:55 2013 +0000
+++ b/SHA1Stream.st	Mon Jan 28 21:53:19 2013 +0000
@@ -320,7 +320,8 @@
 	Stefan Vogel
 
     [see also:]
-	MD5Stream SHA256Stream SHA512Stream
+	MD5Stream
+	SHA256Stream SHA512Stream (in libcrypt)
 
     [class variables:]
 	HashSize        size of returned hash value
@@ -518,7 +519,6 @@
     INT objSize;
     int nInstVars, nInstBytes;
     char *extPtr;
-    OBJ oClass;
 
    if (__isByteArray(__INST(hashContext))
        && __byteArraySize(__INST(hashContext)) == sizeof(SHA1_CTX)
@@ -529,8 +529,7 @@
 	len = __intVal(count);
 	offs = __intVal(start) - 1;
 
-	oClass = __Class(anObject);
-	if (oClass == ExternalBytes) {
+	if (__isExternalBytesLike(anObject)) {
 	    OBJ sz;
 
 	    nInstBytes = 0;
@@ -543,6 +542,9 @@
 		objSize = 0; /* unknown */
 	    }
 	} else {
+	    OBJ oClass;
+
+	    oClass = __Class(anObject);
 	    switch (__intVal(__ClassInstPtr(oClass)->c_flags) & ARRAYMASK) {
 		case BYTEARRAY:
 		case WORDARRAY:
@@ -563,7 +565,7 @@
 	    extPtr = (char *)__byteArrayVal(anObject)+nInstBytes;
 	}
 	if ((offs >= 0) && (len >= 0) && (objSize >= (len + offs))) {
-	    SHA1Update(ctx, extPtr+offs, len);
+	    SHA1Update(ctx, extPtr+offs, (unsigned int)len);
 	    RETURN (count);
 	}
     }
@@ -576,11 +578,12 @@
 !SHA1Stream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.30 2013-01-17 23:54:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.33 2013-01-27 13:55:22 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.30 2013-01-17 23:54:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.33 2013-01-27 13:55:22 cg Exp $'
 ! !
 
+
 SHA1Stream initialize!