1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibCrypto+LibTLS: Reformat everything

I have no idea how I'll squash _this_ one...
This commit is contained in:
AnotherTest 2020-04-23 03:03:05 +04:30 committed by Andreas Kling
parent a1e1570552
commit 05e2c7d9cf
14 changed files with 1434 additions and 1426 deletions

View file

@ -32,6 +32,7 @@
namespace Crypto {
namespace ASN1 {
enum class Kind {
Eol,
Boolean,

View file

@ -38,6 +38,7 @@ constexpr static auto OPAD = 0x5c;
namespace Crypto {
namespace Authentication {
template<typename HashT>
class HMAC {
public:
@ -130,5 +131,6 @@ namespace Authentication {
HashType m_inner_hasher, m_outer_hasher;
u8 m_key_data[BlockSize * 2];
};
}
}

View file

@ -87,6 +87,7 @@ namespace Hash {
index = 0;
}
ASSERT(length < part_length || length - offset <= 64);
m_buffer.overwrite(index, &input[offset], length - offset);
}

View file

@ -66,6 +66,7 @@ namespace Hash {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0
};
}
class MD5 final : public HashFunction<512, MD5Digest> {

View file

@ -32,6 +32,7 @@
namespace Crypto {
namespace NumberTheory {
static auto ModularInverse(const UnsignedBigInteger& a_, const UnsignedBigInteger& b) -> UnsignedBigInteger
{
if (b == 1)
@ -198,5 +199,6 @@ namespace NumberTheory {
return p;
}
}
}
}

View file

@ -134,9 +134,10 @@ namespace PK {
DB[0] &= 0xff >> (8 - length_to_check);
auto check_octets = emsg.size() - HashFunction::DigestSize - SaltLength - 2;
for (size_t i = 0; i < check_octets; ++i)
for (size_t i = 0; i < check_octets; ++i) {
if (DB[i])
return VerificationConsistency::Inconsistent;
}
if (DB[check_octets + 1] != 0x01)
return VerificationConsistency::Inconsistent;