development line as well.
$R="esi";
&external_label("des_SPtrans");
-&des_encrypt("des_encrypt",1);
+&des_encrypt("des_encrypt1",1);
&des_encrypt("des_encrypt2",0);
&des_encrypt3("des_encrypt3",1);
&des_encrypt3("des_decrypt3",0);
-&cbc("des_ncbc_encrypt","des_encrypt","des_encrypt",0,4,5,3,5,-1);
+&cbc("des_ncbc_encrypt","des_encrypt1","des_encrypt1",0,4,5,3,5,-1);
&cbc("des_ede3_cbc_encrypt","des_encrypt3","des_decrypt3",0,6,7,3,4,5);
&asm_finish();
$L="edi";
$R="esi";
-&des_encrypt("des_encrypt",1);
+&des_encrypt("des_encrypt1",1);
&des_encrypt("des_encrypt2",0);
&des_encrypt3("des_encrypt3",1);
The file to implement in assembler is des_enc.c. Replace the following
4 functions
-des_encrypt(DES_LONG data[2],des_key_schedule ks, int encrypt);
+des_encrypt1(DES_LONG data[2],des_key_schedule ks, int encrypt);
des_encrypt2(DES_LONG data[2],des_key_schedule ks, int encrypt);
des_encrypt3(DES_LONG data[2],des_key_schedule ks1,ks2,ks3);
des_decrypt3(DES_LONG data[2],des_key_schedule ks1,ks2,ks3);
#undef DES_RISC2
#undef DES_PTR
#undef D_ENCRYPT
-#define des_encrypt des_encrypt_u4_cisc_idx
+#define des_encrypt1 des_encrypt_u4_cisc_idx
#define des_encrypt2 des_encrypt2_u4_cisc_idx
#define des_encrypt3 des_encrypt3_u4_cisc_idx
#define des_decrypt3 des_decrypt3_u4_cisc_idx
#undef DES_RISC2
#undef DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u16_cisc_idx
+#define des_encrypt1 des_encrypt_u16_cisc_idx
#define des_encrypt2 des_encrypt2_u16_cisc_idx
#define des_encrypt3 des_encrypt3_u16_cisc_idx
#define des_decrypt3 des_decrypt3_u16_cisc_idx
#undef DES_RISC2
#undef DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u4_risc1_idx
+#define des_encrypt1 des_encrypt_u4_risc1_idx
#define des_encrypt2 des_encrypt2_u4_risc1_idx
#define des_encrypt3 des_encrypt3_u4_risc1_idx
#define des_decrypt3 des_decrypt3_u4_risc1_idx
#define DES_RISC2
#undef DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u4_risc2_idx
+#define des_encrypt1 des_encrypt_u4_risc2_idx
#define des_encrypt2 des_encrypt2_u4_risc2_idx
#define des_encrypt3 des_encrypt3_u4_risc2_idx
#define des_decrypt3 des_decrypt3_u4_risc2_idx
#undef DES_RISC2
#undef DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u16_risc1_idx
+#define des_encrypt1 des_encrypt_u16_risc1_idx
#define des_encrypt2 des_encrypt2_u16_risc1_idx
#define des_encrypt3 des_encrypt3_u16_risc1_idx
#define des_decrypt3 des_decrypt3_u16_risc1_idx
#define DES_RISC2
#undef DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u16_risc2_idx
+#define des_encrypt1 des_encrypt_u16_risc2_idx
#define des_encrypt2 des_encrypt2_u16_risc2_idx
#define des_encrypt3 des_encrypt3_u16_risc2_idx
#define des_decrypt3 des_decrypt3_u16_risc2_idx
#undef DES_RISC2
#define DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u4_cisc_ptr
+#define des_encrypt1 des_encrypt_u4_cisc_ptr
#define des_encrypt2 des_encrypt2_u4_cisc_ptr
#define des_encrypt3 des_encrypt3_u4_cisc_ptr
#define des_decrypt3 des_decrypt3_u4_cisc_ptr
#undef DES_RISC2
#define DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u16_cisc_ptr
+#define des_encrypt1 des_encrypt_u16_cisc_ptr
#define des_encrypt2 des_encrypt2_u16_cisc_ptr
#define des_encrypt3 des_encrypt3_u16_cisc_ptr
#define des_decrypt3 des_decrypt3_u16_cisc_ptr
#undef DES_RISC2
#define DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u4_risc1_ptr
+#define des_encrypt1 des_encrypt_u4_risc1_ptr
#define des_encrypt2 des_encrypt2_u4_risc1_ptr
#define des_encrypt3 des_encrypt3_u4_risc1_ptr
#define des_decrypt3 des_decrypt3_u4_risc1_ptr
#define DES_RISC2
#define DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u4_risc2_ptr
+#define des_encrypt1 des_encrypt_u4_risc2_ptr
#define des_encrypt2 des_encrypt2_u4_risc2_ptr
#define des_encrypt3 des_encrypt3_u4_risc2_ptr
#define des_decrypt3 des_decrypt3_u4_risc2_ptr
#undef DES_RISC2
#define DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u16_risc1_ptr
+#define des_encrypt1 des_encrypt_u16_risc1_ptr
#define des_encrypt2 des_encrypt2_u16_risc1_ptr
#define des_encrypt3 des_encrypt3_u16_risc1_ptr
#define des_decrypt3 des_decrypt3_u16_risc1_ptr
#define DES_RISC2
#define DES_PTR
#undef D_ENCRYPT
-#undef des_encrypt
+#undef des_encrypt1
#undef des_encrypt2
#undef des_encrypt3
#undef des_decrypt3
-#define des_encrypt des_encrypt_u16_risc2_ptr
+#define des_encrypt1 des_encrypt_u16_risc2_ptr
#define des_encrypt2 des_encrypt2_u16_risc2_ptr
#define des_encrypt3 des_encrypt3_u16_risc2_ptr
#define des_decrypt3 des_decrypt3_u16_risc2_ptr
{
for (i=0; i<1000; i++) /**/
{
- des_encrypt(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
GetTSC(s1);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
GetTSC(e1);
GetTSC(s2);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
GetTSC(e2);
- des_encrypt(&data[0],key,1);
+ des_encrypt1(&data[0],key,1);
}
printf("des %d %d (%d)\n",