334 %{ |
334 %{ |
335 INT len, offs; |
335 INT len, offs; |
336 INT objSize; |
336 INT objSize; |
337 int nInstBytes; |
337 int nInstBytes; |
338 char *extPtr; |
338 char *extPtr; |
339 |
339 OBJ _hashContext = __INST(hashContext); |
340 if (__isByteArray(__INST(hashContext)) |
340 |
341 &&__byteArraySize(__INST(hashContext)) == sizeof(MD5_CTX) |
341 // convert first, check later |
|
342 len = __intVal(count); |
|
343 offs = __intVal(start) - 1; |
|
344 |
|
345 if (__isByteArray(_hashContext) |
|
346 && __byteArraySize(_hashContext) == sizeof(MD5_CTX) |
342 && __bothSmallInteger(count, start) |
347 && __bothSmallInteger(count, start) |
343 ) { |
348 ) { |
344 MD5_CTX *ctx = (MD5_CTX *)__ByteArrayInstPtr(__INST(hashContext))->ba_element; |
349 MD5_CTX *ctx = (MD5_CTX *)__byteArrayVal(_hashContext); |
345 |
350 |
346 len = __intVal(count); |
351 if (__isByteArrayLike(anObject)) { |
347 offs = __intVal(start) - 1; |
352 extPtr = (char *)__byteArrayVal(anObject); |
348 |
353 objSize = __byteArraySize(anObject); |
349 if (__isExternalBytesLike(anObject)) { |
354 } else if (__isStringLike(anObject)) { |
|
355 extPtr = (char *)__stringVal(anObject); |
|
356 objSize = __stringSize(anObject); |
|
357 } else if (__isExternalBytesLike(anObject)) { |
350 OBJ sz; |
358 OBJ sz; |
351 |
359 |
352 nInstBytes = 0; |
360 nInstBytes = 0; |
353 extPtr = (char *)__externalBytesAddress(anObject); |
361 extPtr = (char *)__externalBytesAddress(anObject); |
354 if (extPtr == (char *)0) goto bad; |
362 if (extPtr == (char *)0) goto bad; |