aboutsummaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt_des.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* libbb: shuffle ascii64 code around, shrink i2a64()Denys Vlasenko2025-07-061-12/+3
| | | | | | | | | | | | | function old new delta num2str64_4chars_msb_first - 55 +55 num2str64_lsb_first - 33 +33 i2a64 42 25 -17 to64 33 - -33 to64_msb_first 55 - -55 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/1 up/down: 88/-105) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: in DES crypt, error out on invalid salt charsDenys Vlasenko2025-07-061-29/+7
| | | | | | | function old new delta des_crypt 1308 1327 +19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: code shrink in DES cryptDenys Vlasenko2025-07-061-11/+7
| | | | | | | | | function old new delta pw_encrypt 941 945 +4 bits32 128 - -128 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 4/-128) Total: -124 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: use common ACSII char-to-64 conversion codeDenys Vlasenko2025-07-061-21/+2
| | | | | | | | | | | | | | function old new delta a2i64 - 46 +46 yescrypt_r 1215 1235 +20 decode64_uint32 167 177 +10 atoi64 25 - -25 ascii_to_bin 53 - -53 static.atoi64_partial 77 - -77 ------------------------------------------------------------------------------ (add/remove: 1/3 grow/shrink: 2/0 up/down: 76/-155) Total: -79 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: code shrinkDenys Vlasenko2025-07-061-4/+4
| | | | | | | | | | | | | | | | | | | | static.PBKDF2_SHA256 - 189 +189 HMAC_SHA256_Init - 159 +159 HMAC_SHA256_Buf - 58 +58 HMAC_SHA256_Final - 53 +53 i2a64 - 42 +42 yescrypt_r 1221 1215 -6 yescrypt_kdf32_body 1064 1046 -18 i64c 42 - -42 libcperciva_HMAC_SHA256_Final 53 - -53 libcperciva_HMAC_SHA256_Buf 58 - -58 ascii64 65 - -65 libcperciva_HMAC_SHA256_Init 159 - -159 PBKDF2_SHA256 386 - -386 ------------------------------------------------------------------------------ (add/remove: 5/6 grow/shrink: 0/2 up/down: 501/-787) Total: -286 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: code shrink in des encryption, in setup_salt()Denys Vlasenko2021-11-281-15/+14
| | | | | | | | | | | function old new delta pw_encrypt 978 971 -7 .rodata 108208 108192 -16 des_crypt 1211 1181 -30 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-53) Total: -53 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: make pw_encrypt() die if supplied salt is bad (e.g. emply)Denys Vlasenko2020-12-151-14/+11
| | | | | | | | | | | | Fished from 520-loginutils-handle-crypt-failures.patch in openwrt function old new delta pw_encrypt 913 927 +14 des_crypt 1327 1318 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-9) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-301-8/+7
| | | | | | | | text data bss dec hex filename 1021988 559 5052 1027599 fae0f busybox_old 1021236 559 5052 1026847 fab1f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* do not use `a' quoting style in commentsDenys Vlasenko2017-08-021-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* des encrypt: fix goof with NUL byte added at the end as '.'Denys Vlasenko2009-05-011-1/+3
|
* libbb: move crypt_make_salt() to pw_encrypt.c, reuseDenis Vlasenko2008-12-071-1/+7
| | | | | | | | | | 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
* libbb/crypt: code shrinkDenis Vlasenko2008-12-041-25/+39
| | | | | | | | | function old new delta to64_msb_first - 63 +63 des_crypt 1509 1338 -171 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 63/-171) Total: -108 bytes
* whitespace and comment fixes, no code changesDenis Vlasenko2008-06-161-3/+3
|
* further encrypt_des optimizationsDenis Vlasenko2008-06-151-51/+141
| | | | | | | | | | function old new delta pw_encrypt 943 964 +21 des_crypt 1512 1509 -3 u_sbox 512 256 -256 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 21/-259) Total: -238 bytes
* cryptpw: fix "cryptpw -a des -- TEXT" caseDenis Vlasenko2008-06-151-67/+75
| | | | | | | | | | | | | | libbb/pw_encrypt_des.c: optimize function old new delta cryptpw_main 177 157 -20 des_crypt 1682 1512 -170 pw_encrypt 1036 842 -194 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-384) Total: -384 bytes Run tested.
* crypt: code shrinkDenis Vlasenko2008-06-141-8/+7
| | | | | | | | | | function old new delta des_crypt - 1682 +1682 md5_crypt - 627 +627 pw_encrypt 3608 1036 -2572 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 2309/-2572) Total: -263 bytes
* trivial crypt shrinkageDenis Vlasenko2008-06-131-2/+0
| | | | | | | function old new delta __md5_to64 27 29 +2 pw_encrypt 3631 3608 -23
* uclibc insists on having 70k static buffer for crypt.Denis Vlasenko2008-06-121-0/+703
For bbox it's not acceptable. Roll our own des and md5 crypt implementation. Against older uclibc: text data bss dec hex filename 759945 604 6684 767233 bb501 busybox_old 759766 604 6684 767054 bb44e busybox_unstripped so, we still save on code size.