aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/digest
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:23 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:23 +0300
commit706b83ed7de5a473436620367af31fc0ceecde07 (patch)
tree103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/digest
parent918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff)
downloadydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/digest')
-rw-r--r--library/cpp/digest/argonish/internal/argon2/argon2_base.h20
-rw-r--r--library/cpp/digest/lower_case/hash_ops.h2
-rw-r--r--library/cpp/digest/lower_case/hash_ops_ut.cpp4
-rw-r--r--library/cpp/digest/lower_case/lchash.h4
-rw-r--r--library/cpp/digest/lower_case/lciter.h12
-rw-r--r--library/cpp/digest/md5/md5.cpp6
-rw-r--r--library/cpp/digest/md5/md5.h2
-rw-r--r--library/cpp/digest/md5/md5_ut.cpp8
-rw-r--r--library/cpp/digest/old_crc/gencrc/main.cpp12
-rw-r--r--library/cpp/digest/sfh/sfh.h2
-rw-r--r--library/cpp/digest/ya.make8
11 files changed, 40 insertions, 40 deletions
diff --git a/library/cpp/digest/argonish/internal/argon2/argon2_base.h b/library/cpp/digest/argonish/internal/argon2/argon2_base.h
index 2385cc947c..9b02d1efbb 100644
--- a/library/cpp/digest/argonish/internal/argon2/argon2_base.h
+++ b/library/cpp/digest/argonish/internal/argon2/argon2_base.h
@@ -153,19 +153,19 @@ namespace NArgonish {
ui8 in_buffer[BLAKE2B_OUTBYTES];
ui32 toproduce = outlen - BLAKE2B_OUTBYTES / 2;
- TBlake2B<instructionSet> hash1(BLAKE2B_OUTBYTES);
- hash1.Update(outlen);
- hash1.Update(in, inlen);
- hash1.Final(out_buffer, BLAKE2B_OUTBYTES);
+ TBlake2B<instructionSet> hash1(BLAKE2B_OUTBYTES);
+ hash1.Update(outlen);
+ hash1.Update(in, inlen);
+ hash1.Final(out_buffer, BLAKE2B_OUTBYTES);
memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2);
out += BLAKE2B_OUTBYTES / 2;
while (toproduce > BLAKE2B_OUTBYTES) {
memcpy(in_buffer, out_buffer, BLAKE2B_OUTBYTES);
- TBlake2B<instructionSet> hash2(BLAKE2B_OUTBYTES);
- hash2.Update(in_buffer, BLAKE2B_OUTBYTES);
- hash2.Final(out_buffer, BLAKE2B_OUTBYTES);
+ TBlake2B<instructionSet> hash2(BLAKE2B_OUTBYTES);
+ hash2.Update(in_buffer, BLAKE2B_OUTBYTES);
+ hash2.Final(out_buffer, BLAKE2B_OUTBYTES);
memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2);
out += BLAKE2B_OUTBYTES / 2;
toproduce -= BLAKE2B_OUTBYTES / 2;
@@ -173,9 +173,9 @@ namespace NArgonish {
memcpy(in_buffer, out_buffer, BLAKE2B_OUTBYTES);
{
- TBlake2B<instructionSet> hash3(toproduce);
- hash3.Update(in_buffer, BLAKE2B_OUTBYTES);
- hash3.Final(out_buffer, toproduce);
+ TBlake2B<instructionSet> hash3(toproduce);
+ hash3.Update(in_buffer, BLAKE2B_OUTBYTES);
+ hash3.Final(out_buffer, toproduce);
memcpy(out, out_buffer, toproduce);
}
}
diff --git a/library/cpp/digest/lower_case/hash_ops.h b/library/cpp/digest/lower_case/hash_ops.h
index 83ebf7aca4..8bc3171390 100644
--- a/library/cpp/digest/lower_case/hash_ops.h
+++ b/library/cpp/digest/lower_case/hash_ops.h
@@ -2,7 +2,7 @@
#include <util/generic/strbuf.h>
-// can be used for caseless hashes like: THashMap<TStringBuf, T, TCIOps, TCIOps>
+// can be used for caseless hashes like: THashMap<TStringBuf, T, TCIOps, TCIOps>
struct TCIOps {
size_t operator()(const char* s) const noexcept;
diff --git a/library/cpp/digest/lower_case/hash_ops_ut.cpp b/library/cpp/digest/lower_case/hash_ops_ut.cpp
index a7ab0b86ea..610f89f246 100644
--- a/library/cpp/digest/lower_case/hash_ops_ut.cpp
+++ b/library/cpp/digest/lower_case/hash_ops_ut.cpp
@@ -4,7 +4,7 @@
Y_UNIT_TEST_SUITE(TestCIHash) {
Y_UNIT_TEST(TestYHash1) {
- THashMap<TStringBuf, int, TCIOps, TCIOps> h;
+ THashMap<TStringBuf, int, TCIOps, TCIOps> h;
h["Ab"] = 1;
h["aB"] = 2;
@@ -14,7 +14,7 @@ Y_UNIT_TEST_SUITE(TestCIHash) {
}
Y_UNIT_TEST(TestYHash2) {
- THashMap<const char*, int, TCIOps, TCIOps> h;
+ THashMap<const char*, int, TCIOps, TCIOps> h;
h["Ab"] = 1;
h["aB"] = 2;
diff --git a/library/cpp/digest/lower_case/lchash.h b/library/cpp/digest/lower_case/lchash.h
index 6a287d9479..5cc13bc612 100644
--- a/library/cpp/digest/lower_case/lchash.h
+++ b/library/cpp/digest/lower_case/lchash.h
@@ -6,13 +6,13 @@
#include <util/generic/strbuf.h>
template <class T>
-static inline T FnvCaseLess(const char* b, size_t l, T t = 0) noexcept {
+static inline T FnvCaseLess(const char* b, size_t l, T t = 0) noexcept {
using TIter = TLowerCaseIterator<const char>;
return FnvHash(TIter(b), TIter(b + l), t);
}
template <class T>
-static inline T FnvCaseLess(const TStringBuf& s, T t = 0) noexcept {
+static inline T FnvCaseLess(const TStringBuf& s, T t = 0) noexcept {
return FnvCaseLess(s.data(), s.size(), t);
}
diff --git a/library/cpp/digest/lower_case/lciter.h b/library/cpp/digest/lower_case/lciter.h
index 9538e57932..72f639605e 100644
--- a/library/cpp/digest/lower_case/lciter.h
+++ b/library/cpp/digest/lower_case/lciter.h
@@ -7,24 +7,24 @@
template <class T>
struct TLowerCaseIterator: public std::iterator<std::input_iterator_tag, T> {
- using TNonConst = std::remove_const_t<T>;
+ using TNonConst = std::remove_const_t<T>;
inline TLowerCaseIterator(T* c)
: C(c)
{
}
- inline TLowerCaseIterator& operator++() noexcept {
+ inline TLowerCaseIterator& operator++() noexcept {
++C;
return *this;
}
- inline TLowerCaseIterator operator++(int) noexcept {
+ inline TLowerCaseIterator operator++(int) noexcept {
return C++;
}
- inline TNonConst operator*() const noexcept {
+ inline TNonConst operator*() const noexcept {
return AsciiToLower(*C);
}
@@ -32,11 +32,11 @@ struct TLowerCaseIterator: public std::iterator<std::input_iterator_tag, T> {
};
template <class T>
-inline bool operator==(const TLowerCaseIterator<T>& l, const TLowerCaseIterator<T>& r) noexcept {
+inline bool operator==(const TLowerCaseIterator<T>& l, const TLowerCaseIterator<T>& r) noexcept {
return l.C == r.C;
}
template <class T>
-inline bool operator!=(const TLowerCaseIterator<T>& l, const TLowerCaseIterator<T>& r) noexcept {
+inline bool operator!=(const TLowerCaseIterator<T>& l, const TLowerCaseIterator<T>& r) noexcept {
return !(l == r);
}
diff --git a/library/cpp/digest/md5/md5.cpp b/library/cpp/digest/md5/md5.cpp
index 24a5b69eef..181fbcc812 100644
--- a/library/cpp/digest/md5/md5.cpp
+++ b/library/cpp/digest/md5/md5.cpp
@@ -38,7 +38,7 @@ namespace {
char* MD5::File(const char* filename, char* buf) {
try {
- TUnbufferedFileInput fi(filename);
+ TUnbufferedFileInput fi(filename);
return Stream(&fi, buf);
} catch (...) {
@@ -47,7 +47,7 @@ char* MD5::File(const char* filename, char* buf) {
return nullptr;
}
-TString MD5::File(const TString& filename) {
+TString MD5::File(const TString& filename) {
TString buf;
buf.ReserveAndResize(MD5_HEX_DIGEST_LENGTH);
auto result = MD5::File(filename.data(), buf.begin());
@@ -225,7 +225,7 @@ TString MD5::CalcRaw(TStringBuf data) {
}
TString MD5::CalcRaw(const TArrayRef<const ui8>& data) {
- TString result;
+ TString result;
result.ReserveAndResize(16);
MD5().Update(data).Final(reinterpret_cast<ui8*>(result.begin()));
return result;
diff --git a/library/cpp/digest/md5/md5.h b/library/cpp/digest/md5/md5.h
index 2c17aa0518..c2aab90e4a 100644
--- a/library/cpp/digest/md5/md5.h
+++ b/library/cpp/digest/md5/md5.h
@@ -46,7 +46,7 @@ public:
* Return nullptr / empty string if the file does not exist.
*/
static char* File(const char* filename, char* buf);
- static TString File(const TString& filename);
+ static TString File(const TString& filename);
static char* Data(const void* data, size_t len, char* buf);
static char* Data(const TArrayRef<const ui8>& data, char* buf);
diff --git a/library/cpp/digest/md5/md5_ut.cpp b/library/cpp/digest/md5/md5_ut.cpp
index 1c3e4ad0a9..70c2946f03 100644
--- a/library/cpp/digest/md5/md5_ut.cpp
+++ b/library/cpp/digest/md5/md5_ut.cpp
@@ -15,7 +15,7 @@ Y_UNIT_TEST_SUITE(TMD5Test) {
r.Update((const unsigned char*)b + 15, strlen(b) - 15);
char rs[33];
- TString s(r.End(rs));
+ TString s(r.End(rs));
s.to_lower();
UNIT_ASSERT_NO_DIFF(s, TStringBuf("3ac00dd696b966fd74deee3c35a59d8f"));
@@ -26,11 +26,11 @@ Y_UNIT_TEST_SUITE(TMD5Test) {
}
Y_UNIT_TEST(TestFile) {
- TString s = NUnitTest::RandomString(1000000, 1);
- const TString tmpFile = "tmp";
+ TString s = NUnitTest::RandomString(1000000, 1);
+ const TString tmpFile = "tmp";
{
- TFixedBufferFileOutput fo(tmpFile);
+ TFixedBufferFileOutput fo(tmpFile);
fo.Write(s.data(), s.size());
}
diff --git a/library/cpp/digest/old_crc/gencrc/main.cpp b/library/cpp/digest/old_crc/gencrc/main.cpp
index d5821304ce..d7816d9631 100644
--- a/library/cpp/digest/old_crc/gencrc/main.cpp
+++ b/library/cpp/digest/old_crc/gencrc/main.cpp
@@ -16,10 +16,10 @@ static void crc16init() {
else
crc >>= 1;
- for (size_t k = 0; k < 256; ++k) {
- Cout << " ULL(" << CRCTAB16[k] << ")";
+ for (size_t k = 0; k < 256; ++k) {
+ Cout << " ULL(" << CRCTAB16[k] << ")";
- if (k != 255) {
+ if (k != 255) {
Cout << ",\n";
}
}
@@ -37,10 +37,10 @@ static void crc32init() {
else
crc >>= 1;
- for (size_t k = 0; k < 256; ++k) {
- Cout << " ULL(" << CRCTAB32[k] << ")";
+ for (size_t k = 0; k < 256; ++k) {
+ Cout << " ULL(" << CRCTAB32[k] << ")";
- if (k != 255) {
+ if (k != 255) {
Cout << ",\n";
}
}
diff --git a/library/cpp/digest/sfh/sfh.h b/library/cpp/digest/sfh/sfh.h
index 372938654c..3e998d8848 100644
--- a/library/cpp/digest/sfh/sfh.h
+++ b/library/cpp/digest/sfh/sfh.h
@@ -3,7 +3,7 @@
#include <util/system/defaults.h>
#include <util/system/unaligned_mem.h>
-inline ui32 SuperFastHash(const void* d, size_t l) noexcept {
+inline ui32 SuperFastHash(const void* d, size_t l) noexcept {
ui32 hash = (ui32)l;
ui32 tmp;
diff --git a/library/cpp/digest/ya.make b/library/cpp/digest/ya.make
index 61d4b50903..64dcbc7c87 100644
--- a/library/cpp/digest/ya.make
+++ b/library/cpp/digest/ya.make
@@ -1,8 +1,8 @@
RECURSE(
- argonish
- argonish/benchmark
- argonish/ut_fat
- argonish/ut
+ argonish
+ argonish/benchmark
+ argonish/ut_fat
+ argonish/ut
benchmark
fast
lower_case