Commit 06178bb5 authored by Niels Möller's avatar Niels Möller
Browse files

* des.c (make_des_instance): Fix _odd_ parity.

Rev: src/des.c:1.4
parent a9e60f04
......@@ -66,14 +66,14 @@ make_des_instance(struct crypto_algorithm *algorithm UNUSED, int mode,
UINT8 pkey[DES_KEYSIZE];
unsigned i;
/* Fix parity */
/* Fix odd parity */
for (i=0; i<DES_KEYSIZE; i++)
{
UINT8 p = key[i];
p ^= (p >> 4);
p ^= (p >> 2);
p ^= (p >> 1);
pkey[i] = key[i] ^ (p & 1);
pkey[i] = key[i] ^ (p & 1) ^ 1;
}
self->super.block_size = DES_BLOCKSIZE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment