Replace the eay DES code with key scheule setup code by me and DES

s-box and p permutation from Richard Outerbridge implemtation (in
public domain).  The DES modes are implemented by me. ui.c code are
from appl/login.

The implementation is about 3 times slower then Eric for encryption,
and about the same speed for key setup.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14585 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-02-23 15:29:36 +00:00
parent 244ca04320
commit c93c4d1a8b
83 changed files with 1937 additions and 16046 deletions

View File

@@ -38,7 +38,6 @@ RCSID("$Id$");
#endif
#include <des.h>
#include <des_locl.h>
#ifdef KRB5
#include <krb5-types.h>
#endif
@@ -338,7 +337,7 @@ DES_rand_data_key(DES_cblock *key)
DES_rand_data(data, sizeof(data));
DES_rand_data((unsigned char*)key, sizeof(DES_cblock));
DES_set_odd_parity(key);
DES_key_sched(key, &sched);
DES_set_key(key, &sched);
DES_ecb_encrypt(&data, key, &sched, DES_ENCRYPT);
memset(&data, 0, sizeof(data));
memset(&sched, 0, sizeof(sched));
@@ -399,7 +398,7 @@ DES_set_sequence_number(unsigned char *ll)
void
DES_set_random_generator_seed(DES_cblock *seed)
{
DES_key_sched(seed, &sequence_seed);
DES_set_key(seed, &sequence_seed);
zero_long_long(sequence_index);
initialized = 1;
}