diff options
Diffstat (limited to 'crypt/crypt_util.c')
-rw-r--r-- | crypt/crypt_util.c | 70 |
1 files changed, 21 insertions, 49 deletions
diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c index 1597885ed6..1f42f59cb0 100644 --- a/crypt/crypt_util.c +++ b/crypt/crypt_util.c @@ -1,7 +1,7 @@ /* * UFC-crypt: ultra fast crypt(3) implementation * - * Copyright (C) 1991-2015 Free Software Foundation, Inc. + * Copyright (C) 1991-2016 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -253,7 +253,7 @@ static const char b64t[64] = struct crypt_data _ufc_foobar; #ifdef __GNU_LIBRARY__ -#include <bits/libc-lock.h> +#include <libc-lock.h> __libc_lock_define_initialized (static, _ufc_tables_lock) #endif @@ -261,9 +261,7 @@ __libc_lock_define_initialized (static, _ufc_tables_lock) #ifdef DEBUG void -_ufc_prbits(a, n) - ufc_long *a; - int n; +_ufc_prbits (ufc_long *a, int n) { ufc_long i, j, t, tmp; n /= 8; @@ -273,15 +271,13 @@ _ufc_prbits(a, n) t=8*i+j; tmp|=(a[t/24] & BITMASK[t % 24])?bytemask[j]:0; } - (void)printf("%02x ",tmp); + (void)printf("%02lx ", tmp); } printf(" "); } -static void -_ufc_set_bits(v, b) - ufc_long v; - ufc_long *b; +static void __attribute__ ((unused)) +_ufc_set_bits (ufc_long v, ufc_long *b) { ufc_long i; *b = 0; @@ -301,18 +297,14 @@ _ufc_set_bits(v, b) */ void -_ufc_clearmem(start, cnt) - char *start; - int cnt; +_ufc_clearmem (char *start, int cnt) { while(cnt--) *start++ = '\0'; } void -_ufc_copymem(from, to, cnt) - char *from, *to; - int cnt; +_ufc_copymem (char *from, char *to, int cnt) { while(cnt--) *to++ = *from++; @@ -332,8 +324,7 @@ _ufc_copymem(from, to, cnt) */ void -__init_des_r(__data) - struct crypt_data * __restrict __data; +__init_des_r (struct crypt_data * __restrict __data) { int comes_from_bit; int bit, sg; @@ -558,9 +549,7 @@ __init_des (void) #ifdef _UFC_32_ STATIC void -shuffle_sb(k, saltbits) - long32 *k; - ufc_long saltbits; +shuffle_sb (long32 *k, ufc_long saltbits) { ufc_long j; long32 x; @@ -574,9 +563,7 @@ shuffle_sb(k, saltbits) #ifdef _UFC_64_ STATIC void -shuffle_sb(k, saltbits) - long64 *k; - ufc_long saltbits; +shuffle_sb (long64 *k, ufc_long saltbits) { ufc_long j; long64 x; @@ -614,9 +601,7 @@ bad_for_salt (char c) */ bool -_ufc_setup_salt_r(s, __data) - const char *s; - struct crypt_data * __restrict __data; +_ufc_setup_salt_r (const char *s, struct crypt_data * __restrict __data) { ufc_long i, j, saltbits; char s0, s1; @@ -675,9 +660,7 @@ _ufc_setup_salt_r(s, __data) } void -_ufc_mk_keytab_r(key, __data) - const char *key; - struct crypt_data * __restrict __data; +_ufc_mk_keytab_r (const char *key, struct crypt_data * __restrict __data) { ufc_long v1, v2, *k1; int i; @@ -735,9 +718,7 @@ _ufc_mk_keytab_r(key, __data) */ void -_ufc_dofinalperm_r(res, __data) - ufc_long *res; - struct crypt_data * __restrict __data; +_ufc_dofinalperm_r (ufc_long *res, struct crypt_data * __restrict __data) { ufc_long v1, v2, x; ufc_long l1,l2,r1,r2; @@ -779,10 +760,8 @@ _ufc_dofinalperm_r(res, __data) */ void -_ufc_output_conversion_r(v1, v2, salt, __data) - ufc_long v1, v2; - const char *salt; - struct crypt_data * __restrict __data; +_ufc_output_conversion_r (ufc_long v1, ufc_long v2, const char *salt, + struct crypt_data * __restrict __data) { int i, s, shf; @@ -814,10 +793,8 @@ _ufc_output_conversion_r(v1, v2, salt, __data) */ void -__encrypt_r(__block, __edflag, __data) - char *__block; - int __edflag; - struct crypt_data * __restrict __data; +__encrypt_r (char *__block, int __edflag, + struct crypt_data * __restrict __data) { ufc_long l1, l2, r1, r2, res[4]; int i; @@ -910,9 +887,7 @@ __encrypt_r(__block, __edflag, __data) weak_alias (__encrypt_r, encrypt_r) void -encrypt(__block, __edflag) - char *__block; - int __edflag; +encrypt (char *__block, int __edflag) { __encrypt_r(__block, __edflag, &_ufc_foobar); } @@ -924,9 +899,7 @@ encrypt(__block, __edflag) */ void -__setkey_r(__key, __data) - const char *__key; - struct crypt_data * __restrict __data; +__setkey_r (const char *__key, struct crypt_data * __restrict __data) { int i,j; unsigned char c; @@ -944,8 +917,7 @@ __setkey_r(__key, __data) weak_alias (__setkey_r, setkey_r) void -setkey(__key) - const char *__key; +setkey (const char *__key) { __setkey_r(__key, &_ufc_foobar); } |