version 1.1, 2005/06/19 15:30:00 |
version 1.3, 2005/07/15 16:41:31 |
|
|
/* $OpenXM$ */ |
/* $OpenXM: OpenXM/src/ox_ntl/crypt/des/des3.c,v 1.2 2005/06/19 15:45:38 iwane Exp $ */ |
/* |
/* |
* Triple-DES |
* Triple-DES |
* see des.c |
* see des.c |
|
|
|
|
#define BLOCK 8 |
#define BLOCK 8 |
|
|
|
#define PRT(x) printf("%5s: %02x%02x%02x%02x %02x%02x%02x%02x\n", #x, x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]) |
|
|
/*===========================================================* |
/*===========================================================* |
* KEY STRUCT |
* KEY STRUCT |
Line 75 des3_dec_c(const des3_key *key, const unsigned char *e |
|
Line 76 des3_dec_c(const des3_key *key, const unsigned char *e |
|
unsigned char b1[8]; |
unsigned char b1[8]; |
unsigned char b2[8]; |
unsigned char b2[8]; |
|
|
des_dec_c(key->key + 0, enc, b1); |
des_dec_c(key->key + 2, enc, b1); |
des_enc_c(key->key + 1, b1, b2); |
des_enc_c(key->key + 1, b1, b2); |
des_dec_c(key->key + 2, b2, data); |
des_dec_c(key->key + 0, b2, data); |
|
|
return (0); |
return (0); |
} |
} |
Line 109 des3_dec_ecb(const des3_key *key, int len, const unsig |
|
Line 110 des3_dec_ecb(const des3_key *key, int len, const unsig |
|
|
|
|
|
int |
int |
des3_enc_cbc(const des3_key *key, const unsigned char *iv, int len, |
des3_enc_cbc(const des3_key *key, unsigned char *iv, int len, |
const unsigned char *data, unsigned char *buf) |
const unsigned char *data, unsigned char *buf) |
{ |
{ |
int ret; |
int ret; |