X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=arcfour%2Farcfour-asm.S;h=63932abe2d25a87a644e8e1b3e907a9877001c1c;hp=1ef8218ce971a608ffaf096959dc40fb63141804;hb=66c915087d1f7b8eb7280be43c16e9588faf2e55;hpb=3f759a542ce8ba4ffbeb6d336a3557a8abbd3ad4 diff --git a/arcfour/arcfour-asm.S b/arcfour/arcfour-asm.S index 1ef8218..63932ab 100644 --- a/arcfour/arcfour-asm.S +++ b/arcfour/arcfour-asm.S @@ -40,8 +40,8 @@ * this function initialises the context * param1: 16-bit pointer to the key * given in r24:r25 - * param2: 8-bit integer indicating keylength in byte - * given in r22 + * param2: 8-bit integer indicating keylength in bits + * given in r22:r23 * param3: 16-bit pointer to a ctx struct * given in r20:r21 */ @@ -52,7 +52,12 @@ arcfour_init: st X+, r1 st X+, r1 /* X points to S */ movw r20, r26 /* store pointer to S in r21:r20 */ - + lsr r23 + ror r22 + lsr r23 + ror r22 + lsr r23 + ror r22 1: st X+, r1 inc r1