This is an example of code that can be compiled; you are really more likely to get help. When you post a short but complete program. Or at least a complete function.
FYI: You helper functions are junk; you need to document them and test them.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "openssl/des.h"
int main() {
unsigned char out[8]={0};
des_cblock key1 = {0x13,0x13,0x23,0x23,0x23,0x23,0x13,0x13};
des_cblock key3 = {0x13,0x13,0x23,0x23,0x23,0x23,0x13,0x13};
des_cblock key2 = {0x67,0x89,0x67,0x89,0x67,0x89,0x67,0x89};
des_key_schedule ks1,ks2,ks3;
unsigned char in[8]= {0x05, 0x92, 0x78, 0x9F, 0xFF, 0xED, 0xCB, 0xA9};
int i=0;
DES_set_key((C_Block *)key1,&ks1);
DES_set_key((C_Block *)key2,&ks2);
DES_set_key((C_Block *)key3,&ks3);
for (i=0; i<7; i++) {
printf("0x%02X, ", in[i]);
}
printf("0x%02X\n", in[i]);
DES_ecb3_encrypt((C_Block *)in,(C_Block *)out,&ks1,&ks2,&ks3, DES_ENCRYPT);
for (i=0; i<7; i++) {
printf("0x%02X, ", out[i]);
}
printf("0x%02X\n", out[i]);
return 0;
}
My output.
Code:
0x05, 0x92, 0x78, 0x9F, 0xFF, 0xED, 0xCB, 0xA9
0x90, 0xDE, 0xBD, 0x82, 0x7C, 0xEE, 0x4F, 0xDD