From: Rich Felker Date: Tue, 11 Sep 2018 00:42:35 +0000 (-0400) Subject: add crypt_des header for declarations shared with encrypt function X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7ab1578d05f5d6790e218867158a28d9147419ec;p=musl add crypt_des header for declarations shared with encrypt function --- 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;