Tool 128: HASH

Extending the Apple IIGS Toolbox


Generate industry standard checksums on the Apple IIGS
 

About

Reference

Support

Download

Tool Documentation


About



The Hash tool set allows GS/OS applications to create a "fingerprint" or message digest from a block of data. The tool set currently provides md5 and md4 checksums. This software is available as open-source based on a modified GNU Public License. License information is found attached to Tool128.asm as found in the downloadable archive.

Orca/M is needed to build the tool set.


References



MD4: http://www.ietf.org/rfc/rfc1320.txt
MD5: http://www.ietf.org/rfc/rfc1321.txt


Support



Support for the Hash Tool can be found on the A2 Central Forums. An active account is needed for access. Membership has its privledges.


Download



June 2004: Hash Tool 128 1.0.2. Fixes a memory corruption bug in both md5 and md4 if the DBR and the PBR are the same.

Apple IIGS Disk Image: HashTool.po    Note: Real Apple IIGS users will need to use Disk Maker to convert this disk image to a floppy disk.

You may need to set your Web Browser's MIME type to allow download of this file. MIME type is application/vnd.apple2-prodos-disk-image with the extension of "po". This type should always be set to save to disk. Please review your Web Browser's help documentation to set MIME types.


Tool
Documentation



Tool 128 Reference

$0180 hashBootInit
 
Initializes the Hash Tool Set; called only by the Tool Locator.
Applications must never make this call.
 
Parameters:
 
The stack is not effected by this call.  There are no input or output
parameters.
 
Errors:
 
None
 
C
 
extern pascal void hashBootInit();
 
 
$0280 hashStartUp
 
Starts up the Hash Tool Set for use by an application.
 
Parameters:
 
The stack is not effected by this call.  There are no input or output
parameters.
 
Errors:
 
None
 
C
 
extern pascal void hashStartUp();
 
 
$0380 hashShutDown
 
Shuts down the Hash Tool Set for use by an application.  If your
application has started up the Hash Tool Set, the application must
make this call before it quits.
 
Parameters:
 
The stack is not effected by this call.  There are no input or output
parameters.
 
Errors:
 
None
 
C
 
extern pascal void hashShutDown();
 
 
$0480 hashVersion
 
Returns the version number of the Hash Tool Set.
 
Parameters:
 
Stack Before Call
|________________________________|
|           wordspace            | word -- space for result
|________________________________|
|                                | <- SP
 
Stack After Call
|________________________________|
|          versionInfo           | word -- version number
|________________________________|
|                                | <- SP
 
Errors:
 
None
 
C
 
extern pascal Word hashVersion();
 
 
$0580 hashReset
 
Sends a reset to the Hash Tool Set; called only when the system is reset.
Applications must never make this call.
 
Parameters:
 
The stack is not effected by this call.  There are no input or output
parameters.
 
Errors:
 
None
 
C
 
extern pascal void hashReset();
 
 
$0680 hashStatus
 
Indicates whether the Hash Tool Set is active.
 
Parameters:
 
Stack Before Call
|________________________________|
|           wordspace            | word -- space for result
|________________________________|
|                                | <- SP
 
Stack After Call
|________________________________|
|          activeFlag            | word -- BOOLEAN; True if tool set is 
|________________________________|         active, false if not.
|                                | <- SP
 
Errors:
 
None
 
C
 
extern pascal Word hashStatus();
 
 
$0980 md5Init
 
This call initializes the work block for md5 use.  This must be called before
any md5Append.  The message digest will generate incorrectly if this call is
not made.
 
Parameters:
 
Stack Before Call
|________________________________|
|          md5WorkBlkPtr         | mdWorkBlockPtr -- pointer to a
|__                           ___|                   mdWorkBlock
|                                |
|________________________________|
|                                | <- SP
 
Stack After Call
|________________________________|
|                                | <- SP
 
Errors:
 
None
 
C
 
extern pascal void md5Init(md5WorkBlkPtr);
mdWorkBlockPtr md5WorkBlkPtr;
 
 
$0A80 md5Append
 
This takes a block of data and takes the message digest of its contents and
appends the information to the mdWorkBlock.  The block of memory can be 0
bytes long.  This call may be used multiple times before calling md5Finish.
 
Parameters:
 
Stack Before Call
|________________________________|
|          md5WorkBlkPtr         | mdWorkBlockPtr -- pointer to a 
|__                           ___|                   mdWorkBlock
|                                |
|________________________________|
|            memoryPtr           | Ptr -- pointer to a block of memory
|__                           ___|
|                                |
|________________________________|
|          memoryLength          | long -- Length of block
|__                           ___|
|                                |
|________________________________|
|                                | <- SP
 
Stack After Call
|________________________________|
|                                | <- SP
 
Errors:
 
None
 
C
 
extern pascal void md5Append(md5WorkBlkPtr, memoryPtr, memoryLength);
mdWorkBlockPtr md5WorkBlkPtr;
Ptr memoryPtr;
Long memoryLength;
 
 
$0B80 md5Finish
 
This produces the final md5 message digest.
 
Parameters:
 
Stack Before Call
|________________________________|
|          md5WorkBlkPtr         | mdWorkBlockPtr -- pointer to a
|__                           ___|                   mdWorkBlock
|                                |
|________________________________|
|            digestPtr           | Ptr -- pointer to digest space
|__                           ___|
|                                |
|________________________________|
|                                | <- SP
 
Stack After Call
|________________________________|
|                                | <- SP
 
Errors:
 
None
 
C
 
extern pascal void md5Finish(md5WorkBlkPtr, digestPtr);
mdWorkBlockPtr md5WorkBlkPtr;
Ptr digestPtr;
 
 
$0C80 md4Init
 
This call initializes the md4 work block.  This must be called before any
md4Append.  The message digest will generate incorrectly if this call is
not made.
 
Parameters:
 
Stack Before Call
|________________________________|
|          md4WorkBlkPtr         | mdWorkBlockPtr -- pointer to a
|__                           ___|                   mdWorkBlock
|                                |
|________________________________|
|                                | <- SP
 
Stack After Call
|________________________________|
|                                | <- SP
 
Errors:
 
None
 
C
 
extern pascal void md4Init(md4WorkBlkPtr);
mdWorkBlockPtr md4WorkBlkPtr;
 
 
$0D80 md4Append
 
This takes a block of data and takes the message digest of its contents and
appends the information to the mdWorkBlock.  The block of memory can be 0
bytes long.  This call may be used multiple times before calling md4Finish.
 
Parameters:
 
Stack Before Call
|________________________________|
|          md4WorkBlkPtr         | mdWorkBlockPtr -- pointer to a 
|__                           ___|                   mdWorkBlock
|                                |
|________________________________|
|            memoryPtr           | Ptr -- pointer to a block of memory
|__                           ___|
|                                |
|________________________________|
|          memoryLength          | long -- Length of block
|__                           ___|
|                                |
|________________________________|
|                                | <- SP
 
Stack After Call
|________________________________|
|                                | <- SP
 
Errors:
 
None
 
C
 
extern pascal void md4Append(md4WorkBlkPtr, memoryPtr, memoryLength);
mdWorkBlockPtr md4WorkBlkPtr;
Ptr memoryPtr;
Long memoryLength;
 
 
$0E80 md4Finish
 
This produces the final md4 message digest.
 
Parameters:
 
Stack Before Call
|________________________________|
|          md4WorkBlkPtr         | mdWorkBlockPtr -- pointer to a
|__                           ___|                   mdWorkBlock
|                                |
|________________________________|
|            digestPtr           | Ptr -- pointer to digest space
|__                           ___|
|                                |
|________________________________|
|                                | <- SP
 
Stack After Call
|________________________________|
|                                | <- SP
 
Errors:
 
None
 
C
 
extern pascal void md4Finish(md4WorkBlkPtr, digestPtr);
mdWorkBlockPtr md4WorkBlkPtr;
Ptr digestPtr;
 
 
---------------------------------------------------------------------------
 
Known Bugs:
            None.