<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox.git/libbb/pw_encrypt.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/'/>
<entry>
<title>libbb: crypt_make_pw_salt(): fix yescrypt's random salt last char</title>
<updated>2025-07-19T16:42:32+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2025-07-19T16:42:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=c6b9e763731545f8e7f3482a90128859496c2964'/>
<id>c6b9e763731545f8e7f3482a90128859496c2964</id>
<content type='text'>
function                                             old     new   delta
crypt_make_pw_salt                                   128     146     +18

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
function                                             old     new   delta
crypt_make_pw_salt                                   128     146     +18

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cryptpw: fix detection of crypt algo from salt (was broken if default isn't DES)</title>
<updated>2025-07-19T16:20:01+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2025-07-19T16:17:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=6979467a62c4bc58eeede0436d06c0cd57649705'/>
<id>6979467a62c4bc58eeede0436d06c0cd57649705</id>
<content type='text'>
The symptom is: "cryptpw ... implicit" testsuite tests were failing
if CONFIG_FEATURE_DEFAULT_PASSWD_ALGO is not "des".

function                                             old     new   delta
cryptpw_main                                         223     283     +60
pw_encrypt                                           974     975      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 61/0)               Total: 61 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The symptom is: "cryptpw ... implicit" testsuite tests were failing
if CONFIG_FEATURE_DEFAULT_PASSWD_ALGO is not "des".

function                                             old     new   delta
cryptpw_main                                         223     283     +60
pw_encrypt                                           974     975      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 61/0)               Total: 61 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cryptpw: -m sha512crypt must also be accepted</title>
<updated>2025-07-07T15:42:35+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2025-07-07T15:42:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=5e9b95ff40de7e9b3395e51d456647ae99b2e8b2'/>
<id>5e9b95ff40de7e9b3395e51d456647ae99b2e8b2</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libbb: shuffle ascii64 code around, shrink i2a64()</title>
<updated>2025-07-06T19:59:03+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2025-07-06T19:59:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=5e17e3c6f49cef45a86ed9438941ca2d4f6ae906'/>
<id>5e17e3c6f49cef45a86ed9438941ca2d4f6ae906</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libbb/yescrypt: use common ACSII char-to-64 conversion code</title>
<updated>2025-07-06T17:08:57+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2025-07-06T17:08:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=23b5527f5c400a300c56afa36a6a5abaa81adbb7'/>
<id>23b5527f5c400a300c56afa36a6a5abaa81adbb7</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>restore mangled comment</title>
<updated>2025-07-06T09:16:43+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2025-07-06T09:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=9c4cd75d12894cd9139d549dfe445f18572ee7d1'/>
<id>9c4cd75d12894cd9139d549dfe445f18572ee7d1</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libbb/yescrypt: code shrink</title>
<updated>2025-07-06T09:12:13+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2025-07-06T09:12:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=0893bc3bac8705b22679ad77f39ee56d3ba728c9'/>
<id>0893bc3bac8705b22679ad77f39ee56d3ba728c9</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libbb: add yescrypt password hashing support</title>
<updated>2025-07-05T22:49:22+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2025-07-05T22:44:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=80e676664e1d7a0b07f14bff44f93d1fef709cf4'/>
<id>80e676664e1d7a0b07f14bff44f93d1fef709cf4</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix missing "crypt.h" compilation error on the FreeBSD</title>
<updated>2021-01-04T12:28:28+00:00</updated>
<author>
<name>Alex Samorukov</name>
<email>samm@os2.kiev.ua</email>
</author>
<published>2021-01-04T00:36:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=09aba8bac466ce8fb94a6b5ee587d81415ff4c44'/>
<id>09aba8bac466ce8fb94a6b5ee587d81415ff4c44</id>
<content type='text'>
FreeBSD does not use crypt.h, but unistd.h which is already included

Signed-off-by: Alex Samorukov &lt;samm@os2.kiev.ua&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
FreeBSD does not use crypt.h, but unistd.h which is already included

Signed-off-by: Alex Samorukov &lt;samm@os2.kiev.ua&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libbb: make pw_encrypt() die if supplied salt is bad (e.g. emply)</title>
<updated>2020-12-15T22:19:22+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2020-12-15T22:19:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/busybox.git/commit/?id=73d93d9f83180a6149f363aaca131e281d2a52ff'/>
<id>73d93d9f83180a6149f363aaca131e281d2a52ff</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;vda.linux@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
