From 6d9b3e7b19f268fe24e6f14d289fe147745c7a62 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 17 Mar 2021 10:11:47 +0100 Subject: [PATCH] pbkdf2: use std.math.divCeil() --- lib/std/crypto/pbkdf2.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/crypto/pbkdf2.zig b/lib/std/crypto/pbkdf2.zig index 52f9da5cd7..575fb83006 100644 --- a/lib/std/crypto/pbkdf2.zig +++ b/lib/std/crypto/pbkdf2.zig @@ -79,7 +79,7 @@ pub fn pbkdf2(dk: []u8, password: []const u8, salt: []const u8, rounds: u32, com // block // - const blocks_count = (dk_len + h_len - 1) / h_len; + const blocks_count = @intCast(u32, std.math.divCeil(usize, dk_len, h_len) catch unreachable); var r = dk_len % h_len; if (r == 0) { r = h_len;