|
From: Christian B. <bor...@de...> - 2011-04-20 11:01:04
|
Am 20.04.2011 11:24, schrieb Julian Seward: > Can you explain more about the instruction(s)? What exactly are the > inputs and the outputs? I am wondering if this can be done somehow > using clean helpers. One example is the KM (Cipher Message) instruction: KM R1,R2 Register 0 contains the function code(e.g. KM-AES-256) Register 1 contains the parameter block (e.g. the key) Register R1 contains the address of the target Register R2 contains the address of the source Register R2+1 contains the length of the source Your comment about clean helper made me rethink and I was rereading that stuff again. The encryption functions seem to be ok. It seems that the length must be a multiple of the basic data block size (e.g. 16 for AES) and for the ones I checked, the output is really calculated blockwise. (the chaining value is updated in the parameter block). These instructions have a startup cost, so just doing 8 or 16 bytes at a time is slower but it probably should work reasonably enough. Then I have to find a good way to let a clean helper return a 128 bit value. The message digest functions (e.g. SHA512) will be a little more tricky, since they have up to 128byte as data block size. Here we might need a dirty helper instead of a clean one. And I still dont know how to pass back 512bits without going over memory. Christian For reference the instructions KM, KMC, KLMD, KMAC etc. are in http://publibfi.boulder.ibm.com/epubs/pdf/dz9zr008.pdf |