[BACK]Return to cipher.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/cipher.c between version 1.36 and 1.37

version 1.36, 2000/10/14 10:01:15 version 1.37, 2000/10/23 19:31:54
Line 218 
Line 218 
  * and after encryption/decryption. Thus the swap_bytes stuff (yuk).   * and after encryption/decryption. Thus the swap_bytes stuff (yuk).
  */   */
 static void  static void
 swap_bytes(const unsigned char *src, unsigned char *dst_, int n)  swap_bytes(const unsigned char *src, unsigned char *dst, int n)
 {  {
         /* dst must be properly aligned. */          char c[4];
         u_int32_t *dst = (u_int32_t *) dst_;  
         union {  
                 u_int32_t i;  
                 char c[4];  
         } t;  
   
         /* Process 8 bytes every lap. */          /* Process 4 bytes every lap. */
         for (n = n / 8; n > 0; n--) {          for (n = n / 4; n > 0; n--) {
                 t.c[3] = *src++;                  c[3] = *src++;
                 t.c[2] = *src++;                  c[2] = *src++;
                 t.c[1] = *src++;                  c[1] = *src++;
                 t.c[0] = *src++;                  c[0] = *src++;
                 *dst++ = t.i;  
   
                 t.c[3] = *src++;                  *dst++ = c[0];
                 t.c[2] = *src++;                  *dst++ = c[1];
                 t.c[1] = *src++;                  *dst++ = c[2];
                 t.c[0] = *src++;                  *dst++ = c[3];
                 *dst++ = t.i;  
         }          }
 }  }
   

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37