Back to index

glibc  2.9
Defines | Functions
crypt.c File Reference
#include "ufc-crypt.h"
#include "crypt.h"
#include "crypt-private.h"

Go to the source code of this file.

Defines

#define SBA(sb, v)   (*(long64*)((char*)(sb)+(v)))

Functions

void _ufc_doit_r (ufc_long itr, struct crypt_data *__restrict __data, ufc_long *res)

Define Documentation

#define SBA (   sb,
 
)    (*(long64*)((char*)(sb)+(v)))

Definition at line 83 of file crypt.c.


Function Documentation

void _ufc_doit_r ( ufc_long  itr,
struct crypt_data * __restrict  __data,
ufc_long res 
)

Definition at line 86 of file crypt.c.

{
  int i;
  long64 l, r, s, *k;
  register long64 *sb01 = (long64*)__data->sb0;
  register long64 *sb23 = (long64*)__data->sb2;

  l = (((long64)res[0]) << 32) | ((long64)res[1]);
  r = (((long64)res[2]) << 32) | ((long64)res[3]);

  while(itr--) {
    k = (long64*)__data->keysched;
    for(i=8; i--; ) {
      s = *k++ ^ r;
      l ^= SBA(sb23, (s       ) & 0xffff);
      l ^= SBA(sb23, (s >>= 16) & 0xffff);
      l ^= SBA(sb01, (s >>= 16) & 0xffff);
      l ^= SBA(sb01, (s >>= 16)         );

      s = *k++ ^ l;
      r ^= SBA(sb23, (s       ) & 0xffff);
      r ^= SBA(sb23, (s >>= 16) & 0xffff);
      r ^= SBA(sb01, (s >>= 16) & 0xffff);
      r ^= SBA(sb01, (s >>= 16)         );
    }
    s=l; l=r; r=s;
  }

  res[0] = l >> 32; res[1] = l & 0xffffffff;
  res[2] = r >> 32; res[3] = r & 0xffffffff;
}

Here is the caller graph for this function: