aboutsummaryrefslogtreecommitdiff
path: root/libbb/yescrypt/alg-yescrypt.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* libbb/yescrypt: de-unroll salsa20()Denys Vlasenko2025-07-201-1/+2
| | | | | | | function old new delta salsa20 760 296 -464 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: actually, largest allowed salt is 86 chars, support thatDenys Vlasenko2025-07-171-1/+1
| | | | | | | function old new delta yescrypt_r 767 756 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: code shrinkDenys Vlasenko2025-07-111-4/+4
| | | | | | | | | | | | | function old new delta salsa20 684 650 -34 blockmix_salsa8 198 144 -54 blockmix 762 565 -197 blockmix_xor 1322 1028 -294 blockmix_xor_save 1499 1103 -396 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-975) Total: -975 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: disable NROM codeDenys Vlasenko2025-07-081-12/+22
| | | | | | | | | | | | | function old new delta smix1 - 595 +595 smix2 - 414 +414 static.yescrypt_kdf32_body 899 847 -52 static.smix2 420 - -420 static.smix1 604 - -604 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/1 up/down: 1009/-1076) Total: -67 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: disable code which accepts unusual yescrypt parametersDenys Vlasenko2025-07-081-52/+68
| | | | | | | | | | | | | | | | | Almost any reasonable yescrypt hashes in /etc/shadow should only ever use "jXY" parameters which set N and r. Fancy multi-byte-encoded wide integers are not needed for that. function old new delta static.yescrypt_kdf32_body - 899 +899 static.PBKDF2_SHA256 213 219 +6 decode64_uint32 141 - -141 yescrypt_r 990 805 -185 yescrypt_kdf32_body 1423 - -1423 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 1/1 up/down: 905/-1749) Total: -844 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: explain and shrink decode64_uint32()Denys Vlasenko2025-07-081-0/+2
| | | | | | | function old new delta decode64_uint32 177 141 -36 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: accept longer salts (up to 84 chars)Denys Vlasenko2025-07-071-0/+5
| | | | | | | | | | | | function old new delta cryptpw_main 214 223 +9 chpasswd_main 347 356 +9 passwd_main 931 934 +3 yescrypt_r 1084 1056 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 21/-28) Total: -7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: make it possible to set constant parameters, and set YESCRYPT_RWDenys Vlasenko2025-07-071-31/+86
| | | | | | | | | | | function old new delta yescrypt_kdf32_body 1052 1420 +368 yescrypt_r 1133 1084 -49 static.smix 762 - -762 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 368/-811) Total: -443 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: use common ascii64 encoding routineDenys Vlasenko2025-07-061-2/+2
| | | | | | | | | | function old new delta num2str64_lsb_first 33 46 +13 yescrypt_r 1235 1133 -102 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 13/-102) Total: -89 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: remove one NOINLINE, add copyright headers, merge two source ↵Denys Vlasenko2025-07-061-46/+5
| | | | | | | | | | | | files function old new delta pw_encrypt 945 974 +29 yes_crypt 50 - -50 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 29/-50) Total: -21 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: comment tweaksDenys Vlasenko2025-07-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: use mmap for allocation, it's large - 16MbytesDenys Vlasenko2025-07-061-9/+4
| | | | | | | | | | | | | This automatically gives it alignment sufficient for any future SIMD optimizations. function old new delta yescrypt_r 1217 1221 +4 yescrypt_kdf32_body 1077 1059 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-18) Total: -14 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: reduce the number of function parametersDenys Vlasenko2025-07-061-49/+38
| | | | | | | | | | | | | | | function old new delta yescrypt_kdf32_body - 1077 +1077 static.smix 739 753 +14 yescrypt_init_local 34 - -34 yes_crypt 87 50 -37 yescrypt_free_local 49 - -49 yescrypt_r 1288 1217 -71 static.yescrypt_kdf_body 1166 - -1166 ------------------------------------------------------------------------------ (add/remove: 1/3 grow/shrink: 1/2 up/down: 1091/-1357) Total: -266 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: make some functions staticDenys Vlasenko2025-07-061-6/+3
| | | | | | | | | | | | | | | | function old new delta static.yescrypt_kdf_body - 1166 +1166 yescrypt_r 692 1342 +650 atoi64 - 25 +25 decode64_uint32 201 166 -35 encode64 153 - -153 decode64 174 - -174 yescrypt_kdf 442 - -442 yescrypt_kdf_body 1239 - -1239 ------------------------------------------------------------------------------ (add/remove: 2/4 grow/shrink: 1/1 up/down: 1841/-2043) Total: -202 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: remove unused yescrypt_binary_tDenys Vlasenko2025-07-061-10/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: remove YESCRYPT_INIT_SHARED flag and code using itDenys Vlasenko2025-07-061-2/+1
| | | | | | | | | | | | | | | It's only used by libxcrypt-4.4.38/lib/alg-yescrypt-opt.c code (optimized code version?) which wasn't ported to busybox function old new delta yescrypt_kdf 449 442 -7 static.smix 755 739 -16 alloc_region 72 - -72 yescrypt_kdf_body 1467 1239 -228 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/3 up/down: 0/-323) Total: -323 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: remove unused yescrypt_shared_tDenys Vlasenko2025-07-061-48/+2
| | | | | | | | | | | | | | | | | | | | function old new delta static.smix - 755 +755 static.smix1 - 631 +631 static.smix2 - 452 +452 yescrypt_free_local 9 49 +40 yes_crypt 90 87 -3 yescrypt_r 890 879 -11 yescrypt_kdf 479 449 -30 free_region 47 - -47 yescrypt_kdf_body 1724 1467 -257 smix2 659 - -659 smix 790 - -790 smix1 960 - -960 ------------------------------------------------------------------------------ (add/remove: 3/4 grow/shrink: 1/4 up/down: 1878/-2757) Total: -879 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/yescrypt: remove obviously unused, commented-out partsDenys Vlasenko2025-07-061-81/+0
| | | | | | No code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: add yescrypt password hashing supportDenys Vlasenko2025-07-061-0/+355
It seems to work, but not at all optimized for size. The extra copy of sha256 code need to be removed. The yescrypt code in libbb/yescrypt/* is adapted from libxcrypt-4.4.38 with minimal edits, hopefully making it easier to track backports by resetting the tree to this commit, then comparing changes in upstream libxcrypt to the tree. function old new delta blockmix_xor_save - 7050 +7050 static.blockmix_xor - 6475 +6475 blockmix - 3390 +3390 SHA256_Transform - 3083 +3083 yescrypt_kdf_body - 1724 +1724 PBKDF2_SHA256 - 1003 +1003 smix1 - 960 +960 yescrypt_r - 890 +890 salsa20 - 804 +804 smix - 790 +790 smix2 - 659 +659 blockmix_salsa8_xor - 601 +601 yescrypt_kdf - 479 +479 blockmix_salsa8 - 415 +415 Krnd - 256 +256 _HMAC_SHA256_Init - 213 +213 _SHA256_Update - 198 +198 _SHA256_Final - 195 +195 decode64_uint32 - 166 +166 encode64 - 153 +153 decode64 - 136 +136 libcperciva_HMAC_SHA256_Buf - 132 +132 SHA256_Pad_Almost - 131 +131 salsa20_simd_unshuffle - 101 +101 salsa20_simd_shuffle - 101 +101 yes_crypt - 90 +90 libcperciva_SHA256_Buf - 86 +86 crypt_make_rand64encoded - 85 +85 static.atoi64_partial - 77 +77 alloc_region - 72 +72 ascii64 - 65 +65 PAD - 64 +64 _HMAC_SHA256_Final - 55 +55 static.cpu_to_be32_vect - 51 +51 free_region - 47 +47 libcperciva_SHA256_Init - 37 +37 yescrypt_init_local - 34 +34 crypt_make_pw_salt 92 125 +33 initial_state - 32 +32 .rodata 105771 105803 +32 atoi64 - 25 +25 explicit_bzero - 22 +22 pw_encrypt 920 941 +21 yescrypt_free_local - 9 +9 crypt_make_salt 85 - -85 ------------------------------------------------------------------------------ (add/remove: 43/1 grow/shrink: 3/0 up/down: 31042/-85) Total: 30957 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>