mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 11:47:34 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -12,12 +12,12 @@
|
|||
|
||||
namespace {
|
||||
|
||||
static u32 to_u32(const u8* b)
|
||||
static u32 to_u32(u8 const* b)
|
||||
{
|
||||
return AK::convert_between_host_and_big_endian(ByteReader::load32(b));
|
||||
}
|
||||
|
||||
static void to_u8s(u8* b, const u32* w)
|
||||
static void to_u8s(u8* b, u32 const* w)
|
||||
{
|
||||
for (auto i = 0; i < 4; ++i) {
|
||||
ByteReader::store(b + i * 4, AK::convert_between_host_and_big_endian(w[i]));
|
||||
|
|
|
@ -24,7 +24,7 @@ struct GHashDigest {
|
|||
constexpr static size_t Size = 16;
|
||||
u8 data[Size];
|
||||
|
||||
const u8* immutable_data() const { return data; }
|
||||
u8 const* immutable_data() const { return data; }
|
||||
size_t data_length() { return Size; }
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,7 @@ public:
|
|||
using TagType = GHashDigest;
|
||||
|
||||
template<size_t N>
|
||||
explicit GHash(const char (&key)[N])
|
||||
explicit GHash(char const (&key)[N])
|
||||
: GHash({ key, N })
|
||||
{
|
||||
}
|
||||
|
|
|
@ -39,23 +39,23 @@ public:
|
|||
reset();
|
||||
}
|
||||
|
||||
TagType process(const u8* message, size_t length)
|
||||
TagType process(u8 const* message, size_t length)
|
||||
{
|
||||
reset();
|
||||
update(message, length);
|
||||
return digest();
|
||||
}
|
||||
|
||||
void update(const u8* message, size_t length)
|
||||
void update(u8 const* message, size_t length)
|
||||
{
|
||||
m_inner_hasher.update(message, length);
|
||||
}
|
||||
|
||||
TagType process(ReadonlyBytes span) { return process(span.data(), span.size()); }
|
||||
TagType process(StringView string) { return process((const u8*)string.characters_without_null_termination(), string.length()); }
|
||||
TagType process(StringView string) { return process((u8 const*)string.characters_without_null_termination(), string.length()); }
|
||||
|
||||
void update(ReadonlyBytes span) { return update(span.data(), span.size()); }
|
||||
void update(StringView string) { return update((const u8*)string.characters_without_null_termination(), string.length()); }
|
||||
void update(StringView string) { return update((u8 const*)string.characters_without_null_termination(), string.length()); }
|
||||
|
||||
TagType digest()
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
#endif
|
||||
|
||||
private:
|
||||
void derive_key(const u8* key, size_t length)
|
||||
void derive_key(u8 const* key, size_t length)
|
||||
{
|
||||
auto block_size = m_inner_hasher.block_size();
|
||||
// Note: The block size of all the current hash functions is 512 bits.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue