1First up, let me say I don't like writing in assembler. It is not portable, 2dependant on the particular CPU architecture release and is generally a pig 3to debug and get right. Having said that, the x86 architecture is probably 4the most important for speed due to number of boxes and since 5it appears to be the worst architecture to to get 6good C compilers for. So due to this, I have lowered myself to do 7assembler for the inner DES routines in libdes :-). 8 9The file to implement in assembler is des_enc.c. Replace the following 104 functions
| 1First up, let me say I don't like writing in assembler. It is not portable, 2dependant on the particular CPU architecture release and is generally a pig 3to debug and get right. Having said that, the x86 architecture is probably 4the most important for speed due to number of boxes and since 5it appears to be the worst architecture to to get 6good C compilers for. So due to this, I have lowered myself to do 7assembler for the inner DES routines in libdes :-). 8 9The file to implement in assembler is des_enc.c. Replace the following 104 functions
|
11des_encrypt(DES_LONG data[2],des_key_schedule ks, int encrypt);
| 11des_encrypt1(DES_LONG data[2],des_key_schedule ks, int encrypt);
|
12des_encrypt2(DES_LONG data[2],des_key_schedule ks, int encrypt); 13des_encrypt3(DES_LONG data[2],des_key_schedule ks1,ks2,ks3); 14des_decrypt3(DES_LONG data[2],des_key_schedule ks1,ks2,ks3); 15 16They encrypt/decrypt the 64 bits held in 'data' using 17the 'ks' key schedules. The only difference between the 4 functions is that 18des_encrypt2() does not perform IP() or FP() on the data (this is an 19optimization for when doing triple DES and des_encrypt3() and des_decrypt3()
--- 112 unchanged lines hidden --- | 12des_encrypt2(DES_LONG data[2],des_key_schedule ks, int encrypt); 13des_encrypt3(DES_LONG data[2],des_key_schedule ks1,ks2,ks3); 14des_decrypt3(DES_LONG data[2],des_key_schedule ks1,ks2,ks3); 15 16They encrypt/decrypt the 64 bits held in 'data' using 17the 'ks' key schedules. The only difference between the 4 functions is that 18des_encrypt2() does not perform IP() or FP() on the data (this is an 19optimization for when doing triple DES and des_encrypt3() and des_decrypt3()
--- 112 unchanged lines hidden --- |