[git commit] libbb/yescrypt: code shrink

Denys Vlasenko vda.linux at googlemail.com
Tue Jul 15 03:47:18 UTC 2025


commit: https://git.busybox.net/busybox/commit/?id=abe0b45cd7098f0f83f727d4d4c4c09dc2b172f7
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
blockmix_xor                                        1177     702    -475

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/yescrypt/alg-yescrypt-kdf.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/libbb/yescrypt/alg-yescrypt-kdf.c b/libbb/yescrypt/alg-yescrypt-kdf.c
index 1c254e2e2..f75361d96 100644
--- a/libbb/yescrypt/alg-yescrypt-kdf.c
+++ b/libbb/yescrypt/alg-yescrypt-kdf.c
@@ -421,26 +421,19 @@ static uint32_t blockmix_xor(const salsa20_blk_t *Bin1,
 
 	i = 0;
 	r--;
-	do {
+	for (;;) {
 		XOR_X(Bin1[i]);
 		XOR_X(Bin2[i]);
 		PWXFORM;
-		WRITE_X(Bout[i]);
-
-		XOR_X(Bin1[i + 1]);
-		XOR_X(Bin2[i + 1]);
-		PWXFORM;
-
-		if (unlikely(i >= r))
+		if (unlikely(i > r))
 			break;
+		WRITE_X(Bout[i]);
+		i++;
+	}
 
-		WRITE_X(Bout[i + 1]);
-
-		i += 2;
-	} while (1);
-	i++;
-
-	ctx->S0 = S0; ctx->S1 = S1; ctx->S2 = S2;
+	ctx->S0 = S0;
+	ctx->S1 = S1;
+	ctx->S2 = S2;
 	ctx->w = w;
 
 	SALSA20_2(Bout[i]);


More information about the busybox-cvs mailing list