add crypt_des header for declarations shared with encrypt function
authorRich Felker <dalias@aerifal.cx>
Tue, 11 Sep 2018 00:42:35 +0000 (20:42 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 12 Sep 2018 18:34:33 +0000 (14:34 -0400)
src/crypt/crypt_des.c
src/crypt/crypt_des.h [new file with mode: 0644]
src/crypt/encrypt.c

index d5766a7afced1855f038b13103b2d79793bfb9e5..338a8f3715f2da6d925ce2fb6fd741fcf49e9656 100644 (file)
@@ -56,9 +56,7 @@
 #include <stdint.h>
 #include <string.h>
 
-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 (file)
index 0000000..8ccbf8b
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef CRYPT_DES_H
+#define CRYPT_DES_H
+
+#include <stdint.h>
+
+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
index 9332a6dee10a56f40b800af37bbb404d80737daa..216abc919b329a35b7ca28847076e83d1a6b40f6 100644 (file)
@@ -2,15 +2,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-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;