mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 19:56:30 +00:00
LibCrypto: Remove the concept of invalid big integers
This concept is rarely used in codebase and very much error-prone if you forget to check it. Instead, make it so that operations that would produce invalid integers return an error instead.
This commit is contained in:
parent
14387e5411
commit
5f1a30197c
Notes:
github-actions[bot]
2025-04-28 10:06:55 +00:00
Author: https://github.com/devgianlu
Commit: 5f1a30197c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4482
Reviewed-by: https://github.com/gmta ✅
12 changed files with 34 additions and 109 deletions
|
@ -92,13 +92,6 @@ public:
|
|||
m_sign = other.m_sign;
|
||||
}
|
||||
|
||||
void invalidate()
|
||||
{
|
||||
m_unsigned_data.invalidate();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool is_invalid() const { return m_unsigned_data.is_invalid(); }
|
||||
|
||||
// These get + 1 byte for the sign.
|
||||
[[nodiscard]] size_t length() const { return m_unsigned_data.length() + 1; }
|
||||
[[nodiscard]] size_t trimmed_length() const { return m_unsigned_data.trimmed_length() + 1; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue