des.c
/*
 * Fill a DES context with subkeys calculated from a 64bit key.
 * Does not check parity bits, but simply ignore them.
 * Does not check for weak keys.
 */
Fill a DES context with subkeys calculated from a 64bit key.
Does not check parity bits, but simply ignore them.
Does not check for weak keys.
Fill a DES context with subkeys calculated from a 64bit key . Does not check parity bits but simply ignore them . Does not check for weak keys .
int
des_setkey (struct _des_ctx *ctx, const unsigned char * key)
{
  int i;
  des_key_schedule (key, ctx->encrypt_subkeys);
  burn_stack (32);
  for(i=0; i<32; i+=2)
    {
      ctx->decrypt_subkeys[i]	= ctx->encrypt_subkeys[30-i];
      ctx->decrypt_subkeys[i+1] = ctx->encrypt_subkeys[31-i];
    }
  return 0;
}
int des_setkey ( struct _des_ctx * ctx , const unsigned char * key ) { int i ; des_key_schedule ( key , ctx -> encrypt_subkeys ) ; burn_stack ( 32 ) ; for ( i = 0 ; i < 32 ; i += 2 ) { ctx -> decrypt_subkeys [ i ] = ctx -> encrypt_subkeys [ 30 - i ] ; ctx -> decrypt_subkeys [ i + 1 ] = ctx -> encrypt_subkeys [ 31 - i ] ; } return 0 ; }
Fill a DES context with subkeys calculated from a 64bit key.
Fill a DES context with subkeys calculated from a 64bit key .