author | Claus Gittinger <cg@exept.de> |
Fri, 30 Sep 2016 17:26:46 +0200 | |
changeset 20486 | 8e25a1394997 |
parent 19608 | 1a12b69abe9c |
child 19611 | b1aaf1175f51 |
child 21153 | f573eac03390 |
permissions | -rw-r--r-- |
6864 | 1 |
" |
2 |
COPYRIGHT (c) 1999 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
7041 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
19608 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
6864 | 16 |
HashStream subclass:#MD5Stream |
17 |
instanceVariableNames:'hashContext' |
|
18 |
classVariableNames:'HashSize ContextSize' |
|
19 |
poolDictionaries:'' |
|
12419 | 20 |
category:'System-Crypt-Hashing' |
6864 | 21 |
! |
22 |
||
23 |
!MD5Stream primitiveDefinitions! |
|
24 |
%{ |
|
25 |
||
26 |
/* |
|
27 |
* includes, defines, structure definitions |
|
28 |
* and typedefs come here. |
|
29 |
*/ |
|
30 |
||
31 |
#include "md5.h" |
|
32 |
||
33 |
%} |
|
34 |
! ! |
|
35 |
||
36 |
!MD5Stream class methodsFor:'documentation'! |
|
37 |
||
38 |
copyright |
|
39 |
" |
|
40 |
COPYRIGHT (c) 1999 by eXept Software AG |
|
41 |
All Rights Reserved |
|
42 |
||
43 |
This software is furnished under a license and may be used |
|
44 |
only in accordance with the terms of that license and with the |
|
45 |
inclusion of the above copyright notice. This software may not |
|
46 |
be provided or otherwise made available to, or used by, any |
|
47 |
other person. No title to or ownership of the software is |
|
48 |
hereby transferred. |
|
49 |
" |
|
50 |
||
51 |
||
52 |
! |
|
53 |
||
54 |
documentation |
|
55 |
" |
|
56 |
Generate a MD5 hash value as defined in RFC 1321. |
|
12756 | 57 |
This may be used as checksum or for generating cryptographic signatures. |
58 |
||
59 |
Note: |
|
14787 | 60 |
in August 2004, some researchers have found a way to generate full collisions for MD5. |
61 |
Therefore, for new applications, it may be wise to choose another hash function for security stuff. |
|
62 |
See a hash-collision example in the examples method. |
|
6864 | 63 |
|
14787 | 64 |
So, the MD5 algorithm has severe weaknesses, for example it is easy to compute two messages yielding |
65 |
the same hash (collision attack). |
|
66 |
The use of this algorithm is only justified for non-cryptographic application. |
|
13932 | 67 |
|
68 |
||
12265 | 69 |
performance: roughly |
14787 | 70 |
104000 Kb/s on a 2.5Ghz 64X2 Athlon 4800+ (64bit) |
71 |
80000 Kb/s on a 2Ghz Duo |
|
72 |
27200 Kb/s on a 1.2Ghz Athlon |
|
73 |
12600 Kb/s on a 400Mhz PIII |
|
74 |
9150 Kb/s on a 300Mhz Sparc. |
|
75 |
performance is almost completely limited by the speed of the md5-routine, which is the reference |
|
76 |
implementation in C from md5lib. |
|
12756 | 77 |
|
6864 | 78 |
[author:] |
14787 | 79 |
Stefan Vogel |
6864 | 80 |
|
19608 | 81 |
[references:] |
82 |
* Ronald L. Rivest, http://www.roxen.com/rfc/rfc1321.html |
|
83 |
''The MD5 Message-Digest Algorithm'', IETF RFC-1321 (informational). |
|
84 |
* Bruce Schneier, Section 18.5 MD5, ''Applied Cryptography, 2nd edition'', John Wiley & Sons, 1996 |
|
85 |
||
6864 | 86 |
[see also:] |
14787 | 87 |
SHA1Stream |
88 |
SHA256Stream SHA512Stream (in libcrypt) |
|
6864 | 89 |
|
90 |
[class variables:] |
|
14787 | 91 |
HashSize size of returned hash value |
92 |
ContextSize (implementation) size of hash context |
|
6864 | 93 |
|
94 |
[instance variables:] |
|
14787 | 95 |
hashContext (implementation) |
96 |
internal buffer for computation of the hash value |
|
6864 | 97 |
" |
98 |
! |
|
99 |
||
100 |
examples |
|
101 |
" |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
102 |
[exBegin] |
10782 | 103 |
Test Vectors (from FIPS PUB 180-1); results are: |
7041 | 104 |
|
10782 | 105 |
'abc' |
106 |
-> #[90 1 50 98 3C D2 4F B0 D6 96 3F 7D 28 E1 7F 72] |
|
6864 | 107 |
|
10782 | 108 |
'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq' |
109 |
-> #[82 15 EF 7 96 A2 B CA AA E1 16 D3 87 6C 66 4A] |
|
7041 | 110 |
|
10782 | 111 |
A million repetitions of 'a' |
112 |
-> #[77 7 D6 AE 4E 2 7C 70 EE A2 A9 35 C2 29 6F 21] |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
113 |
[exEnd] |
6864 | 114 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
115 |
[exBegin] |
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
116 |
Transcript showCR:(MD5Stream hashValueOf:'abc') hexPrintString |
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
117 |
[exEnd] |
13001 | 118 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
119 |
[exBegin] |
12265 | 120 |
(MD5Stream hashValueOf:'abc') |
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
121 |
printOn:Transcript base:16. |
10782 | 122 |
Transcript cr. |
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
123 |
[exEnd] |
6864 | 124 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
125 |
[exBegin] |
12265 | 126 |
(MD5Stream hashValueOfStream:('abc' readStream)) |
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
127 |
printOn:Transcript base:16. |
10782 | 128 |
Transcript cr. |
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
129 |
[exEnd] |
6864 | 130 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
131 |
[exBegin] |
6864 | 132 |
|hashStream| |
133 |
||
134 |
hashStream := MD5Stream new. |
|
135 |
hashStream nextPut:'abc'. |
|
136 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
137 |
hashStream nextPut:'dbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'. |
|
138 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
139 |
[exEnd] |
6864 | 140 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
141 |
[exBegin] |
6864 | 142 |
|hashStream| |
143 |
||
144 |
hashStream := MD5Stream new. |
|
7041 | 145 |
hashStream nextPut:'a' asByteArray. |
146 |
hashStream nextPut:'bc' asByteArray. |
|
6864 | 147 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
148 |
hashStream nextPut:'dbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq' asByteArray. |
|
149 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
150 |
[exEnd] |
6864 | 151 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
152 |
[exBegin] |
6864 | 153 |
|hashStream| |
154 |
||
155 |
hashStream := MD5Stream new. |
|
156 |
1000000 timesRepeat:[ hashStream nextPut:$a ]. |
|
157 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
158 |
[exEnd] |
6864 | 159 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
160 |
[exBegin] |
6864 | 161 |
|hashStream| |
162 |
||
163 |
hashStream := MD5Stream new. |
|
164 |
hashStream nextPut:'a'. |
|
165 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
166 |
[exEnd] |
6864 | 167 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
168 |
[exBegin] |
6864 | 169 |
|hashStream| |
170 |
||
171 |
hashStream := MD5Stream new. |
|
172 |
hashStream nextPut:$a. |
|
173 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
174 |
[exEnd] |
6864 | 175 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
176 |
[exBegin] |
6864 | 177 |
|hashStream| |
178 |
||
179 |
hashStream := MD5Stream new. |
|
180 |
hashStream nextPut:'abc'. |
|
181 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
182 |
hashStream reset. |
|
183 |
hashStream nextPut:'abc'. |
|
184 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
185 |
[exEnd] |
6864 | 186 |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
187 |
a collision: |
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
188 |
[exBegin] |
13896 | 189 |
|hashStream| |
190 |
||
191 |
hashStream := MD5Stream new. |
|
192 |
hashStream nextPut:(ByteArray fromHexStringWithSeparators:' |
|
193 |
d131dd02c5e6eec4693d9a0698aff95c 2fcab58712467eab4004583eb8fb7f89 |
|
194 |
55ad340609f4b30283e488832571415a 085125e8f7cdc99fd91dbdf280373c5b |
|
195 |
d8823e3156348f5bae6dacd436c919c6 dd53e2b487da03fd02396306d248cda0 |
|
196 |
e99f33420f577ee8ce54b67080a80d1e c69821bcb6a8839396f9652b6ff72a70'). |
|
197 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
198 |
hashStream reset. |
|
199 |
||
200 |
hashStream nextPut:(ByteArray fromHexStringWithSeparators:' |
|
201 |
d131dd02c5e6eec4693d9a0698aff95c 2fcab50712467eab4004583eb8fb7f89 |
|
202 |
55ad340609f4b30283e4888325f1415a 085125e8f7cdc99fd91dbd7280373c5b |
|
203 |
d8823e3156348f5bae6dacd436c919c6 dd53e23487da03fd02396306d248cda0 |
|
204 |
e99f33420f577ee8ce54b67080280d1e c69821bcb6a8839396f965ab6ff72a70'). |
|
205 |
hashStream hashValue printOn:Transcript base:16. Transcript cr. |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
206 |
[exEnd] |
13896 | 207 |
|
6864 | 208 |
timing throughput: |
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
209 |
[exBegin] |
6864 | 210 |
|hashStream n t| |
211 |
||
212 |
hashStream := MD5Stream new. |
|
213 |
n := 1000000. |
|
214 |
t := Time millisecondsToRun:[ |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
215 |
n timesRepeat:[ |
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
216 |
hashStream nextPutAll:'12345678901234567890123456789012345678901234567890'. |
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
217 |
]. |
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
218 |
]. |
6864 | 219 |
t := (t / 1000) asFloat. |
220 |
Transcript show:t; show:' seconds for '; show:(50*n/1024) asFloat; showCR:' Kb'. |
|
221 |
Transcript show:(n*50/1024 / t); showCR:' Kb/s' |
|
14667
f6a830b971f3
care for externalAddress being NULL before accessing an external buffer's contents
Claus Gittinger <cg@exept.de>
parents:
13932
diff
changeset
|
222 |
[exEnd] |
7041 | 223 |
" |
6864 | 224 |
! ! |
225 |
||
226 |
!MD5Stream class methodsFor:'initialization'! |
|
227 |
||
228 |
initialize |
|
229 |
|ctxSize| |
|
230 |
||
231 |
%{ |
|
8913 | 232 |
ctxSize = __mkSmallInteger(sizeof(MD5_CTX)); |
6864 | 233 |
%}. |
234 |
ContextSize := ctxSize. |
|
235 |
HashSize := 16. |
|
236 |
||
237 |
" |
|
238 |
self initialize |
|
239 |
" |
|
240 |
||
241 |
||
242 |
||
243 |
! ! |
|
244 |
||
245 |
!MD5Stream class methodsFor:'queries'! |
|
246 |
||
15624
11ce1e9cf098
Rename #blockSize to #hashBlockSize
Stefan Vogel <sv@exept.de>
parents:
14787
diff
changeset
|
247 |
hashBlockSize |
6864 | 248 |
"return the block size used internally by the compression function" |
15624
11ce1e9cf098
Rename #blockSize to #hashBlockSize
Stefan Vogel <sv@exept.de>
parents:
14787
diff
changeset
|
249 |
|
6864 | 250 |
^ 64 |
251 |
||
252 |
"Created: / 18.3.1999 / 08:36:44 / stefan" |
|
253 |
! |
|
254 |
||
255 |
hashSize |
|
256 |
"return the size of the hashvalue returned by instances of this class" |
|
257 |
||
258 |
^ HashSize |
|
259 |
||
260 |
"Created: / 18.3.1999 / 08:02:16 / stefan" |
|
261 |
! ! |
|
262 |
||
263 |
!MD5Stream methodsFor:'initialization'! |
|
264 |
||
265 |
initialize |
|
266 |
||
267 |
hashContext := ByteArray new:ContextSize. |
|
268 |
self reset. |
|
269 |
||
270 |
"Modified: / 18.3.1999 / 08:03:42 / stefan" |
|
271 |
! ! |
|
272 |
||
273 |
!MD5Stream methodsFor:'positioning'! |
|
274 |
||
275 |
reset |
|
276 |
"reset the stream in order to compute a new hash value" |
|
277 |
||
278 |
%{ |
|
14723 | 279 |
if (__isByteArray(__INST(hashContext)) && |
6864 | 280 |
__byteArraySize(__INST(hashContext)) == sizeof(MD5_CTX) |
281 |
) { |
|
14723 | 282 |
MD5_CTX *ctx = (MD5_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element; |
6864 | 283 |
|
284 |
MD5Init(ctx); |
|
285 |
RETURN(self); |
|
286 |
} |
|
287 |
%}. |
|
288 |
^ self primitiveFailed |
|
289 |
||
290 |
||
291 |
||
292 |
! ! |
|
293 |
||
294 |
!MD5Stream methodsFor:'queries'! |
|
295 |
||
296 |
hashValue |
|
297 |
"Get the value hashed so far. |
|
298 |
The context is kept, so that more objects may be hashed after |
|
299 |
retrieving a hash value" |
|
300 |
||
301 |
||
302 |
|digest| |
|
303 |
||
304 |
digest := ByteArray new:HashSize. |
|
305 |
||
306 |
%{ |
|
14723 | 307 |
if (__isByteArray(__INST(hashContext)) && |
6864 | 308 |
__byteArraySize(__INST(hashContext)) == sizeof(MD5_CTX) && |
14723 | 309 |
__isByteArray(digest) && |
6864 | 310 |
__byteArraySize(digest) == 16 |
311 |
) { |
|
14723 | 312 |
MD5_CTX *ctx = (MD5_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element; |
6864 | 313 |
MD5_CTX copyContext; |
314 |
||
315 |
memcpy(©Context, ctx, sizeof(copyContext)); |
|
316 |
MD5Final(__ByteArrayInstPtr(digest)->ba_element, ©Context); |
|
317 |
RETURN(digest); |
|
318 |
} |
|
319 |
%}. |
|
320 |
||
12265 | 321 |
^ self primitiveFailed |
6864 | 322 |
! ! |
323 |
||
324 |
!MD5Stream methodsFor:'writing'! |
|
325 |
||
7042 | 326 |
nextPutBytes:count from:anObject startingAt:start |
327 |
"update the hash value with count bytes from an object starting at index start. |
|
12265 | 328 |
The object must have non-pointer indexed instvars |
7042 | 329 |
(i.e. be a ByteArray, String, Float- or DoubleArray), |
330 |
or an externalBytes object (with known size)" |
|
331 |
||
332 |
%{ |
|
14723 | 333 |
INT len, offs; |
334 |
INT objSize; |
|
15988 | 335 |
int nInstBytes; |
7042 | 336 |
char *extPtr; |
337 |
||
14723 | 338 |
if (__isByteArray(__INST(hashContext)) |
7042 | 339 |
&&__byteArraySize(__INST(hashContext)) == sizeof(MD5_CTX) |
340 |
&& __bothSmallInteger(count, start) |
|
7197
a68adb223592
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
7042
diff
changeset
|
341 |
) { |
15988 | 342 |
MD5_CTX *ctx = (MD5_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element; |
7042 | 343 |
|
15988 | 344 |
len = __intVal(count); |
345 |
offs = __intVal(start) - 1; |
|
7042 | 346 |
|
15988 | 347 |
if (__isExternalBytesLike(anObject)) { |
348 |
OBJ sz; |
|
7042 | 349 |
|
15988 | 350 |
nInstBytes = 0; |
351 |
extPtr = (char *)__externalBytesAddress(anObject); |
|
352 |
if (extPtr == (char *)0) goto bad; |
|
353 |
sz = __externalBytesSize(anObject); |
|
354 |
if (__isSmallInteger(sz)) { |
|
355 |
objSize = __intVal(sz); |
|
356 |
} else { |
|
357 |
objSize = 0; /* unknown */ |
|
358 |
} |
|
359 |
} else { |
|
360 |
OBJ oClass = __Class(anObject); |
|
361 |
int nInstVars = __intVal(__ClassInstPtr(oClass)->c_ninstvars); |
|
7197
a68adb223592
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
7042
diff
changeset
|
362 |
|
16003 | 363 |
nInstBytes = OHDR_SIZE + __OBJS2BYTES__(nInstVars); |
15988 | 364 |
switch (__intVal(__ClassInstPtr(oClass)->c_flags) & ARRAYMASK) { |
365 |
case BYTEARRAY: |
|
366 |
case WORDARRAY: |
|
367 |
case LONGARRAY: |
|
368 |
case SWORDARRAY: |
|
369 |
case SLONGARRAY: |
|
370 |
case FLOATARRAY: |
|
15992 | 371 |
break; |
15988 | 372 |
case DOUBLEARRAY: |
373 |
#ifdef __NEED_DOUBLE_ALIGN |
|
374 |
nInstBytes = (nInstBytes-1+__DOUBLE_ALIGN) &~ (__DOUBLE_ALIGN-1); |
|
375 |
#endif |
|
376 |
break; |
|
377 |
case LONGLONGARRAY: |
|
378 |
case SLONGLONGARRAY: |
|
379 |
#ifdef __NEED_LONGLONG_ALIGN |
|
380 |
nInstBytes = (nInstBytes-1+__LONGLONG_ALIGN) &~ (__LONGLONG_ALIGN-1); |
|
381 |
#endif |
|
15992 | 382 |
break; |
15988 | 383 |
default: |
384 |
goto bad; |
|
385 |
} |
|
386 |
// nInstBytes is the number of bytes occupied by pointer instance variables |
|
387 |
// subtract from size and add to byte-pointer |
|
16003 | 388 |
objSize = __Size(anObject) - nInstBytes; |
16008 | 389 |
extPtr = (char *)anObject + nInstBytes; |
15988 | 390 |
} |
391 |
if ((offs >= 0) && (len >= 0) && (objSize >= (len + offs))) { |
|
392 |
MD5Update(ctx, extPtr+offs, len); |
|
393 |
RETURN (count); |
|
394 |
} |
|
7042 | 395 |
} |
396 |
bad: ; |
|
397 |
%}. |
|
398 |
||
399 |
^ self primitiveFailed |
|
6864 | 400 |
! ! |
401 |
||
402 |
!MD5Stream class methodsFor:'documentation'! |
|
403 |
||
404 |
version |
|
19608 | 405 |
^ '$Header$' |
12204 | 406 |
! |
407 |
||
408 |
version_CVS |
|
19608 | 409 |
^ '$Header$' |
6864 | 410 |
! ! |
411 |
||
14716 | 412 |
|
6864 | 413 |
MD5Stream initialize! |