]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - arcfour/arcfour-asm.S
[performance-reports] switching to printf
[avr-crypto-lib.git] / arcfour / arcfour-asm.S
index 1ef8218ce971a608ffaf096959dc40fb63141804..30769d4002f960d232eb489cffa816708dd5e507 100644 (file)
@@ -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
@@ -96,7 +101,7 @@ uint8_t arcfour_gen(arcfour_ctx_t *c){
 .global arcfour_gen
 
 ;== arcfour_gen ==
-;  this function initialises the context
+; this function generates a keystream byte
 ; param1: 16-bit pointer to a ctx struct
 ;      given in r25,r24