From 7ab1578d05f5d6790e218867158a28d9147419ec Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 10 Sep 2018 20:42:35 -0400 Subject: [PATCH] add crypt_des header for declarations shared with encrypt function --- src/crypt/crypt_des.c | 4 +--- src/crypt/crypt_des.h | 14 ++++++++++++++ src/crypt/encrypt.c | 10 +--------- 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 src/crypt/crypt_des.h diff --git a/src/crypt/crypt_des.c b/src/crypt/crypt_des.c index d5766a7a..338a8f37 100644 --- a/src/crypt/crypt_des.c +++ b/src/crypt/crypt_des.c @@ -56,9 +56,7 @@ #include #include -struct expanded_key { - uint32_t l[16], r[16]; -}; +#include "crypt_des.h" #define _PASSWORD_EFMT1 '_' diff --git a/src/crypt/crypt_des.h b/src/crypt/crypt_des.h new file mode 100644 index 00000000..8ccbf8be --- /dev/null +++ b/src/crypt/crypt_des.h @@ -0,0 +1,14 @@ +#ifndef CRYPT_DES_H +#define CRYPT_DES_H + +#include + +struct expanded_key { + uint32_t l[16], r[16]; +}; + +void __des_setkey(const unsigned char *, struct expanded_key *); +void __do_des(uint32_t, uint32_t, uint32_t *, uint32_t *, + uint32_t, uint32_t, const struct expanded_key *); + +#endif diff --git a/src/crypt/encrypt.c b/src/crypt/encrypt.c index 9332a6de..216abc91 100644 --- a/src/crypt/encrypt.c +++ b/src/crypt/encrypt.c @@ -2,15 +2,7 @@ #include #include -struct expanded_key { - uint32_t l[16], r[16]; -}; - -void __des_setkey(const unsigned char *key, struct expanded_key *ekey); -void __do_des(uint32_t l_in, uint32_t r_in, - uint32_t *l_out, uint32_t *r_out, - uint32_t count, uint32_t saltbits, const struct expanded_key *ekey); - +#include "crypt_des.h" static struct expanded_key __encrypt_key; -- 2.25.1