mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:07:44 +00:00
LibCrypto+LibTLS: Reformat everything
I have no idea how I'll squash _this_ one...
This commit is contained in:
parent
a1e1570552
commit
05e2c7d9cf
14 changed files with 1434 additions and 1426 deletions
|
@ -32,6 +32,7 @@
|
||||||
namespace Crypto {
|
namespace Crypto {
|
||||||
|
|
||||||
namespace ASN1 {
|
namespace ASN1 {
|
||||||
|
|
||||||
enum class Kind {
|
enum class Kind {
|
||||||
Eol,
|
Eol,
|
||||||
Boolean,
|
Boolean,
|
||||||
|
|
|
@ -38,6 +38,7 @@ constexpr static auto OPAD = 0x5c;
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto {
|
||||||
namespace Authentication {
|
namespace Authentication {
|
||||||
|
|
||||||
template<typename HashT>
|
template<typename HashT>
|
||||||
class HMAC {
|
class HMAC {
|
||||||
public:
|
public:
|
||||||
|
@ -130,5 +131,6 @@ namespace Authentication {
|
||||||
HashType m_inner_hasher, m_outer_hasher;
|
HashType m_inner_hasher, m_outer_hasher;
|
||||||
u8 m_key_data[BlockSize * 2];
|
u8 m_key_data[BlockSize * 2];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,7 @@ namespace Hash {
|
||||||
|
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(length < part_length || length - offset <= 64);
|
ASSERT(length < part_length || length - offset <= 64);
|
||||||
m_buffer.overwrite(index, &input[offset], length - offset);
|
m_buffer.overwrite(index, &input[offset], length - offset);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ namespace Hash {
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MD5 final : public HashFunction<512, MD5Digest> {
|
class MD5 final : public HashFunction<512, MD5Digest> {
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto {
|
||||||
namespace NumberTheory {
|
namespace NumberTheory {
|
||||||
|
|
||||||
static auto ModularInverse(const UnsignedBigInteger& a_, const UnsignedBigInteger& b) -> UnsignedBigInteger
|
static auto ModularInverse(const UnsignedBigInteger& a_, const UnsignedBigInteger& b) -> UnsignedBigInteger
|
||||||
{
|
{
|
||||||
if (b == 1)
|
if (b == 1)
|
||||||
|
@ -198,5 +199,6 @@ namespace NumberTheory {
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,9 +134,10 @@ namespace PK {
|
||||||
DB[0] &= 0xff >> (8 - length_to_check);
|
DB[0] &= 0xff >> (8 - length_to_check);
|
||||||
|
|
||||||
auto check_octets = emsg.size() - HashFunction::DigestSize - SaltLength - 2;
|
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])
|
if (DB[i])
|
||||||
return VerificationConsistency::Inconsistent;
|
return VerificationConsistency::Inconsistent;
|
||||||
|
}
|
||||||
|
|
||||||
if (DB[check_octets + 1] != 0x01)
|
if (DB[check_octets + 1] != 0x01)
|
||||||
return VerificationConsistency::Inconsistent;
|
return VerificationConsistency::Inconsistent;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue