summaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt_des.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-07 01:16:34 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-07 01:16:34 +0000
commitd1a84a2880073f6cc5e2f9f4e5f236cd110f01a0 (patch)
tree8e5b81c863ef3b91870812e822fecc3d97b0aff7 /libbb/pw_encrypt_des.c
parentdb12d1d733ab7de0c5f4cda261eb79fd334a4ed9 (diff)
downloadbusybox-w32-d1a84a2880073f6cc5e2f9f4e5f236cd110f01a0.tar.gz
busybox-w32-d1a84a2880073f6cc5e2f9f4e5f236cd110f01a0.tar.bz2
busybox-w32-d1a84a2880073f6cc5e2f9f4e5f236cd110f01a0.zip
libbb: move crypt_make_salt() to pw_encrypt.c, reuse
bin-to-ascii64 conversion which does not require an array. function old new delta to64 29 33 +4 to64_msb_first 63 62 -1 ascii64 65 - -65
Diffstat (limited to 'libbb/pw_encrypt_des.c')
-rw-r--r--libbb/pw_encrypt_des.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libbb/pw_encrypt_des.c b/libbb/pw_encrypt_des.c
index 4e506f498..52548d623 100644
--- a/libbb/pw_encrypt_des.c
+++ b/libbb/pw_encrypt_des.c
@@ -699,10 +699,16 @@ do_des(struct des_ctx *ctx, /*uint32_t l_in, uint32_t r_in,*/ uint32_t *l_out, u
699static void 699static void
700to64_msb_first(char *s, unsigned v) 700to64_msb_first(char *s, unsigned v)
701{ 701{
702#if 0
702 *s++ = ascii64[(v >> 18) & 0x3f]; /* bits 23..18 */ 703 *s++ = ascii64[(v >> 18) & 0x3f]; /* bits 23..18 */
703 *s++ = ascii64[(v >> 12) & 0x3f]; /* bits 17..12 */ 704 *s++ = ascii64[(v >> 12) & 0x3f]; /* bits 17..12 */
704 *s++ = ascii64[(v >> 6) & 0x3f]; /* bits 11..6 */ 705 *s++ = ascii64[(v >> 6) & 0x3f]; /* bits 11..6 */
705 *s = ascii64[v & 0x3f]; /* bits 5..0 */ 706 *s = ascii64[v & 0x3f]; /* bits 5..0 */
707#endif
708 *s++ = i64c(v >> 18); /* bits 23..18 */
709 *s++ = i64c(v >> 12); /* bits 17..12 */
710 *s++ = i64c(v >> 6); /* bits 11..6 */
711 *s = i64c(v); /* bits 5..0 */
706} 712}
707 713
708static char * 714static char *