On 15/04/2024 14.56, Rasmus Villemoes wrote: > Currently, crypt_make_salt() can only return 2^28 different salt > strings. There are some low-hanging fruits allowing us to reduce the > code size, and even with patch 5 which obviously by itself increases > the footprint, the combined result of these patches is > > function old new delta > crypt_make_salt 104 95 -9 > i64c 41 24 -17 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-26) Total: -26 bytes > > while making sure (in the normal case where /dev/urandom is available) > that the salt string is completely random, and that we are not in any > case doing worse than what the current code does.
If there are no other comments, could these be considered for applying? Thanks, Rasmus > > Rasmus Villemoes (5): > pw_encrypt.c: make i64c() slightly smaller > crypt_make_salt: cleanup leftover comments > crypt_make_salt(): simplify and improve > crypt_make_salt(): fixup odd calling convention > crypt_make_salt(): try to use actual random bytes for salt generation > > include/libbb.h | 11 ++--------- > libbb/pw_encrypt.c | 27 +++++++++++---------------- > networking/httpd.c | 2 +- > 3 files changed, 14 insertions(+), 26 deletions(-) > _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox