Andrew James
0aea0782c7
Refactor Diablo-SHA to attempt to document behaviour through code ( #2524 )
...
* Hardcode the key and ensure buffers are appropriately sized.
If you do want to build the key at runtime the following initial state gets the right sequence:
```cpp
std::linear_congruential_engine<uint32_t, 214013, 2531011, 0> engine(3193970784);
for (auto ¬ch: key)
notch = static_cast<byte>(engine() >> 16);
```
* Move public defines into sha.h, move private struct into .cpp
* Remove unused count member, clarify loop in SHA1Input
* Update circular shift to indicate desired behaviour, remove unnecessary negation.
The parameters are also reordered to match C++20 rotl/rotr and the usual order for shift operators.
5 years ago
Anders Jenbo
8df8b940c4
Handle some clang-tidy issues
5 years ago
Anders Jenbo
de0b3a38b8
Apply code style
5 years ago
Anders Jenbo
e5fc7fd17c
Move remaning symbols in to anonymous namespaces
5 years ago
Anders Jenbo
903d4bd2e1
Scope all for loops
...
This caused 7 of the loops to be rewriteen using range by clang-tidy
5 years ago
Anders Jenbo
a7c7fa0030
Fully apply clang-tidy/format to all files
5 years ago
Anders Jenbo
ecea12fc15
Clang-tidy: ParameterCase
5 years ago
Anders Jenbo
0f2ad469ea
♻️ Clean up variable initialization
5 years ago
Anders Jenbo
bf780be1ed
♻️ Cleanup all implicit bool conversions
5 years ago
Anders Jenbo
22b632f04a
♻️ Clean up implicit bool conversions
5 years ago
Gleb Mazovetskiy
4d10642b3d
🧹 Add and use a DVL_ALWAYS_INLINE macro
...
Also moves attribute macros out of miniwin into a new header.
5 years ago
Anders Jenbo
a32ac83090
🎨 cleanup trivial trype comparisons
5 years ago
Anders Jenbo
1e3ed903be
🎨 strip redundant else
5 years ago
Anders Jenbo
373f28736f
🎨 Acceptable parts of modernize-*
5 years ago
Anders Jenbo
b978d80119
🎨 llvm-include-order
5 years ago
Anders Jenbo
997c1dba55
🚚 Split up all.h in to proper header relations
5 years ago
Anders Jenbo
f450d6a125
🚚 Move defines to there proper files
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
630e507f63
🚚 Apply namespace
5 years ago
pionere
d5a0fa8e85
get rid of a few warnings
5 years ago
Anders Jenbo
38dbcf7641
Format source
5 years ago
qndel
8c9a45863c
fix saves in x64-release
5 years ago
Anders Jenbo
4e8df866bc
Fix function order [sha.cpp]
5 years ago
Anders Jenbo
1ba96a6777
Add doxygen description to remaining engine files
6 years ago
Anders Jenbo
a3505ab904
Remove the std namespace from uint32_t
...
Again to help older compileres that aren't C++11 aware.
6 years ago
Anders Jenbo
20621a0642
add all.h and use in place of diablo.h ( #2005 )
...
Now diablo.h is treated in the same way as all other header files of
Source, as it only contains the declarations of global variables and
functions of diablo.cpp.
Besides consistency, this also enables mods to include diablo.h just
like any other header file without having to include every header file
(and without having to include C++ specific aspects of the now all.h).
6 years ago
Samuel-DEVULDER
9c516819c1
Make save game code big-endian compatible
6 years ago
Xadhoom
19992af2ad
avoids implementation-defined behaviour
6 years ago
Gleb Mazovetskiy
fb37bbf675
Disable some signed shift UBSAN warnings
...
On Clang we can do this globally via a sanitizer blacklist, but that's not supported on GCC (yet):
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61978
We disable these warnings because all compilers implement them in the
same way according to the N2218 proposal to standardize the behaviour:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2218.htm
7 years ago
Gleb Mazovetskiy
c2056c6cbf
SHA: Fix some implementation-defined behaviour ( #343 )
...
* SHA: Fix negative base shift UB
* SHA: Avoid signed integer overflow
We do cast from uint32_t to int32_t but that should be OK everywhere.
* SHA: Always use portable arithmetic right shift
7 years ago
Anders Jenbo
ac102d3bfa
Clean up sha.cpp
7 years ago
galaxyhaxz
540892ff9d
Preliminary support for fixed header files
7 years ago
galaxyhaxz
4e01e03711
Cleanup default calling conventions
7 years ago
Xadhoom
5283a9ffd1
Put everything into namespace dvl
7 years ago
Anders Jenbo
1e4e826a36
Remove delta to devilution
7 years ago
Anders Jenbo
024d99fc9e
C compatability from s ( #521 )
7 years ago
Anders Jenbo
b1f6d3698f
Update style to use tabs
8 years ago
Anders Jenbo
9c85b3f0eb
clean up codec_init_key
8 years ago
Anders Jenbo
1e1a6349be
Clean up SHA1Input
8 years ago
Anders Jenbo
3877d77b55
Clean up SHA1Reset
8 years ago
Anders Jenbo
8c8e1dbe05
Clean up sha.cpp
8 years ago
nomdenom
d14bf20467
Source: NO_GLOBALS support (for Miniwin)
8 years ago
aperturesecurity
42ce77ce05
Rebirth and Nuke
8 years ago
galaxyhaxz
2bc06ccb9a
SHA1ProcessMessageBlock bin exact
8 years ago
galaxyhaxz
49a6f4f9fc
Add include guards, prepare for XRef ( #28 )
...
Add definitions, other junk.
8 years ago
galaxyhaxz
bb01c6f084
Remove the "fear factor" ( #21 )
...
Snakes, spiders, Demons, what scares you?
8 years ago
galaxyhaxz
bcb3abe96b
Add files via upload
8 years ago