From 5a89963bde91d7696738372bd16fa981d1121e58 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Tue, 28 Nov 1995 01:15:23 +0000 Subject: [PATCH] Added Triple-DES function prototypes and structures git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7131 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/des/des_int.h | 57 +++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/src/lib/crypto/des/des_int.h b/src/lib/crypto/des/des_int.h index e0f901436..dc9ccd22c 100644 --- a/src/lib/crypto/des/des_int.h +++ b/src/lib/crypto/des/des_int.h @@ -42,13 +42,17 @@ #endif #endif -typedef krb5_octet mit_des_cblock[8]; /* crypto-block size */ +typedef krb5_octet mit_des_cblock[8]; /* crypto-block size */ /* Key schedule--used internally by DES routines to gain some speed */ typedef struct mit_des_ks_struct { mit_des_cblock _; } mit_des_key_schedule[16]; +/* Triple-DES structures */ +typedef mit_des_cblock mit_des3_cblock[3]; +typedef mit_des_key_schedule mit_des3_key_schedule[3]; + #define MIT_DES_ENCRYPT 1 #define MIT_DES_DECRYPT 0 @@ -70,6 +74,7 @@ typedef struct mit_des_ran_key_seed { extern krb5_cs_table_entry krb5_raw_des_cst_entry; extern krb5_cs_table_entry krb5_des_crc_cst_entry; extern krb5_cs_table_entry krb5_des_md5_cst_entry; +extern krb5_cs_table_entry krb5_des3_md5_cst_entry; extern krb5_checksum_entry krb5_des_cbc_cksumtable_entry; /* @@ -187,4 +192,54 @@ extern unsigned long swap_long_bytes_bit_number PROTOTYPE((unsigned long )); extern void test_set PROTOTYPE((FILE *, const char *, int, const char *, int)); #endif +/* d3_ecb.c */ +extern int mit_des3_ecb_encrypt + PROTOTYPE((const mit_des_cblock FAR *in, + mit_des_cblock FAR *out, + mit_des_key_schedule sched1, + mit_des_key_schedule sched2, + mit_des_key_schedule sched3, + int encrypt)); + +/* d3_cbc.c */ +extern int mit_des3_cbc_encrypt + PROTOTYPE((const mit_des_cblock FAR *in, + mit_des_cblock FAR *out, + long length, + mit_des_key_schedule ks1, + mit_des_key_schedule ks2, + mit_des_key_schedule ks3, + mit_des_cblock ivec, + int encrypt)); + +/* d3_procky.c */ +extern krb5_error_code mit_des3_process_key + PROTOTYPE((krb5_encrypt_block * eblock, + const krb5_keyblock * keyblock)); + +/* d3_rndkey.c */ +extern krb5_error_code mit_des3_random_key + PROTOTYPE((const krb5_encrypt_block * eblock, + krb5_pointer seed, + krb5_keyblock ** keyblock)); + +/* d3_kysched.c */ +extern int mit_des3_key_sched + PROTOTYPE((mit_des3_cblock key, + mit_des3_key_schedule schedule)); + +/* d3_str2ky.c */ +extern int mit_des3_string_to_key + PROTOTYPE((const krb5_encrypt_block FAR * eblock, + krb5_keyblock FAR * keyblock, + const krb5_data FAR * data, + const krb5_data FAR * salt)); + +/* u_nfold.c */ +extern krb5_error_code mit_des_n_fold + PROTOTYPE((const krb5_octet * input, + const size_t in_len, + const krb5_octet * output, + const size_t out_len)); + #endif /*DES_INTERNAL_DEFS*/ -- 2.26.2