--- a/SHA1Stream.st Thu Jan 17 23:41:35 2013 +0100
+++ b/SHA1Stream.st Fri Jan 18 00:54:04 2013 +0100
@@ -457,8 +457,7 @@
"reset the stream in order to compute a new hash value"
%{
- if (__isNonNilObject(__INST(hashContext)) &&
- __qClass(__INST(hashContext)) == @global(ByteArray) &&
+ if (__isByteArray(__INST(hashContext)) &&
__byteArraySize(__INST(hashContext)) == sizeof(SHA1_CTX)
) {
SHA1_CTX *ctx = (SHA1_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element;
@@ -486,15 +485,12 @@
digest := ByteArray new:HashSize.
%{
- if (__isNonNilObject(__INST(hashContext)) &&
- __qClass(__INST(hashContext)) == @global(ByteArray) &&
+ if (__isByteArray(__INST(hashContext)) &&
__byteArraySize(__INST(hashContext)) == sizeof(SHA1_CTX) &&
- __isNonNilObject(digest) &&
- __qClass(digest) == @global(ByteArray) &&
+ __isByteArray(digest) &&
__byteArraySize(digest) == 20
) {
- SHA1_CTX *ctx =
- (SHA1_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element;
+ SHA1_CTX *ctx = (SHA1_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element;
SHA1_CTX copyContext;
memcpy(©Context, ctx, sizeof(copyContext));
@@ -524,13 +520,11 @@
char *extPtr;
OBJ oClass;
- if (__isNonNilObject(__INST(hashContext))
- &&__qClass(__INST(hashContext)) == @global(ByteArray)
+ if (__isByteArray(__INST(hashContext))
&& __byteArraySize(__INST(hashContext)) == sizeof(SHA1_CTX)
&& __bothSmallInteger(count, start)
) {
- SHA1_CTX *ctx =
- (SHA1_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element;
+ SHA1_CTX *ctx = (SHA1_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element;
len = __intVal(count);
offs = __intVal(start) - 1;
@@ -582,11 +576,11 @@
!SHA1Stream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.29 2013-01-17 22:37:55 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.30 2013-01-17 23:54:04 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.29 2013-01-17 22:37:55 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.30 2013-01-17 23:54:04 cg Exp $'
! !
SHA1Stream initialize!