00001
00002
00003
00004
00005 #ifdef _MSC_VER
00006 #include "des_locl.h"
00007 #else
00008 #include "libdes/des_locl.h"
00009 #endif
00010
00011
00012 int des_3ecb_encrypt(input,output,ks1,ks2,encrypt)
00013 des_cblock *input;
00014 des_cblock *output;
00015 des_key_schedule ks1,ks2;
00016 int encrypt;
00017 {
00018 register unsigned long l0,l1;
00019 register unsigned char *in,*out;
00020 unsigned long ll[2];
00021
00022 in=(unsigned char *)input;
00023 out=(unsigned char *)output;
00024 c2l(in,l0);
00025 c2l(in,l1);
00026 ll[0]=l0;
00027 ll[1]=l1;
00028 des_encrypt(ll,ll,ks1,encrypt);
00029 des_encrypt(ll,ll,ks2,!encrypt);
00030 des_encrypt(ll,ll,ks1,encrypt);
00031 l0=ll[0];
00032 l1=ll[1];
00033 l2c(l0,out);
00034 l2c(l1,out);
00035 return(0);
00036 }