Skip to content

Commit 8a1efb3

Browse files
committed
crypto.sha3: remove import math (just for int_max), to improve compilation time and complexity for code that uses sha3
1 parent f2ab898 commit 8a1efb3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

vlib/crypto/sha3/sha3.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// Last updated: August 2015
99
module sha3
1010

11-
import math
12-
1311
// size_224 is the size, in bytes, of a sha3 sum224 checksum.
1412
pub const size_224 = 28
1513
// size_256 is the size, in bytes, of a sha3 sum256 checksum.
@@ -325,7 +323,7 @@ fn (mut d Digest) checksum_internal() ![]u8 {
325323
mut remaining_ouput_len := d.output_len
326324

327325
for remaining_ouput_len > 0 {
328-
mut byte_len_this_round := math.min[int](remaining_ouput_len, d.rate)
326+
mut byte_len_this_round := int_min(remaining_ouput_len, d.rate)
329327
output_bytes << d.s.to_bytes()[..byte_len_this_round]
330328

331329
remaining_ouput_len -= byte_len_this_round

0 commit comments

Comments
 (0)