]> git.ipfire.org Git - thirdparty/openssl.git/commit
design: Fixed size large numbers feature/ossl_fn
authorRichard Levitte <levitte@openssl.org>
Thu, 11 Sep 2025 13:30:15 +0000 (15:30 +0200)
committerTomas Mraz <tomas@openssl.org>
Tue, 23 Sep 2025 14:54:18 +0000 (16:54 +0200)
commit90abeed7d4bc9780e3f1b7b6c3c8dee2d8c796a6
tree5b0706e1139117101bde3931250804703d234db0
parentc676cd92b16cc4c35ef4a1b925277015fca696e3
design: Fixed size large numbers

For the longest time, we have mitigated security issues related to large
numbers (BIGNUM) and constant time in a piece-meal fashion, without really
looking at the problem from a zoomed out, holistic perspective.

An interesting aspect in this problem is that large numbers can vary in
size, and that depending on their combined sizes, the time to perform
mathematical calculations with them vary equally much, and may thereby
unintentionally leak information on those numbers.

To mitigate that sort of timing issue, we introduce fixed size numbers,
which are designed to have payload sizes that are pre-determined, usually by
the crypto system that uses them.  This means that even a very small number
(let's take 1 as a ridiculous example) would have the same size payload as a
much larger number, and calculations using them would perform across all
payload bits of all input numbers combined.

These fixed size numbers primarly differ from BIGNUMs in that once they have
been allocated to a certain size, that size will not change throughout its
lifetime.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28522)
doc/designs/fixed-size-large-numbers.md [new file with mode: 0644]