summaryrefslogtreecommitdiffstats
path: root/source/core/slang-crypto.cpp
diff options
context:
space:
mode:
authorskallweitNV <64953474+skallweitNV@users.noreply.github.com>2022-12-12 19:25:48 +0100
committerGitHub <noreply@github.com>2022-12-12 10:25:48 -0800
commitc2dc1a86ed2f5e160749fe9f99b70db6c3e4d7a6 (patch)
treeea65b9635d892917a2420688a27c38537c4758be /source/core/slang-crypto.cpp
parent8d359fc6133fa49d2d3b7f8bb4b37916e719c344 (diff)
Refactor shader cache (#2558)
* Fix a bug in Path::find * Fix code formatting * Fix LockFile and add LockFileGuard * Add PersistentCache and unit test * Replace file path dependency list with source file dependency list * Add note on ordering in Module/FileDependencyList * Remove old shader cache code * Refactor shader cache implementation * Temporarily skip unit tests reading/writing files * Fix warning * Reenable lock file test * Rename shader cache tests and disable crashing test * Testing * Stop using Path::getCanonical * Fix persistent cache lock and test * Fix threading issues * Move adding file dependency hashes to getEntryPointHash() * Fix handling of #include files * Allow specifying additional search paths for gfx testing device * Work on shader cache tests * Update project files * Revive shader cache graphics tests * Split graphics pipeline test * Fix compilation
Diffstat (limited to 'source/core/slang-crypto.cpp')
-rw-r--r--source/core/slang-crypto.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/core/slang-crypto.cpp b/source/core/slang-crypto.cpp
index ece7b01e9..dfe246c7c 100644
--- a/source/core/slang-crypto.cpp
+++ b/source/core/slang-crypto.cpp
@@ -82,15 +82,19 @@ void MD5::update(const void* data, SlangInt size)
saved_lo = m_lo;
if ((m_lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
+ {
m_hi++;
+ }
m_hi += (uint32_t)size >> 29;
used = saved_lo & 0x3f;
- if (used) {
+ if (used)
+ {
available = 64 - used;
- if (size < available) {
+ if (size < available)
+ {
::memcpy(&m_buffer[used], data, size);
return;
}
@@ -101,7 +105,8 @@ void MD5::update(const void* data, SlangInt size)
processBlock(m_buffer, 64);
}
- if (size >= 64) {
+ if (size >= 64)
+ {
data = processBlock(data, size & ~(SlangInt)0x3f);
size &= 0x3f;
}
@@ -119,7 +124,8 @@ MD5::Digest MD5::finalize()
available = 64 - used;
- if (available < 8) {
+ if (available < 8)
+ {
::memset(&m_buffer[used], 0, available);
processBlock(m_buffer, 64);
used = 0;