mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibCrypto: Add the UnsignedBigInteger::Word alias
This makes it clearer which variables are operating on words instead of directly operating on raw values.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 18:13:48 +09:00
Author: https://github.com/Dexesttp Commit: https://github.com/SerenityOS/serenity/commit/f4e6f58cc64 Pull-request: https://github.com/SerenityOS/serenity/pull/7067 Reviewed-by: https://github.com/alimpfard
@@ -43,7 +43,7 @@ size_t UnsignedBigInteger::export_data(Bytes data, bool remove_leading_zeros) co
|
||||
if (word_count > 0) {
|
||||
ssize_t leading_zeros = -1;
|
||||
if (remove_leading_zeros) {
|
||||
u32 word = m_words[word_count - 1];
|
||||
UnsignedBigInteger::Word word = m_words[word_count - 1];
|
||||
for (size_t i = 0; i < sizeof(u32); i++) {
|
||||
u8 byte = (u8)(word >> ((sizeof(u32) - i - 1) * 8));
|
||||
data[out++] = byte;
|
||||
@@ -108,7 +108,7 @@ void UnsignedBigInteger::set_to_0()
|
||||
m_cached_trimmed_length = {};
|
||||
}
|
||||
|
||||
void UnsignedBigInteger::set_to(u32 other)
|
||||
void UnsignedBigInteger::set_to(UnsignedBigInteger::Word other)
|
||||
{
|
||||
m_is_invalid = false;
|
||||
m_words.resize_and_keep_capacity(1);
|
||||
|
||||
Reference in New Issue
Block a user