]> git.ipfire.org Git - thirdparty/openssl.git/commit
Add a divide rounding up safe math function.
authorPauli <pauli@openssl.org>
Tue, 15 Mar 2022 03:19:07 +0000 (14:19 +1100)
committerPauli <pauli@openssl.org>
Tue, 29 Mar 2022 23:10:25 +0000 (10:10 +1100)
commit4157a32867e6643da8daee94e836aaa18b9feed6
treeed00f2727a856b8313d108de65940d8d527868f1
parent5d3746910438fd052b44010d92ac70fea606fa9d
Add a divide rounding up safe math function.

This function takes arguments a & b and computes a / b rounding any
remainder up.

It is safe with respect to overflow and negative inputs.  It's only fast for
non-negative inputs.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17884)
include/internal/safe_math.h
test/safe_math_test.c