| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Previously calling update or encrypt without calling set_key first
would result in invalid outputs or else crashing.
|
|
|
|
|
|
|
|
|
|
| |
While older versions of GCC did very badly with __builtin_bswap on
ARM, I checked GCC 4.8 and it behaves correctly, emitting either rev
or else the same optimal sequence as was used in the inline asm
(depending on if ARMv7 is enabled or not.)
Enable MSVC byteswap intrinsics, which (hopefully) work on all platforms.
Drop the x86-32 specific asm for byteswap.
|
| |
|
| |
|
|
|
|
| |
Cannot figure out how to get MSVC to shut up
|
| |
|
|
|
|
|
| |
MSVC produces a deranged warning that the compiler generated destructor is deprecated,
try to shut it up.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This leads to a rather shocking decrease in binary sizes, especially
the static library (~1.5 MB reduction). Saves 60KB in the shared lib.
Since throwing or catching an exception is relatively expensive these
not being inlined is not a problem in that sense. It had simply not
occured to me that it would take up so much extra space in the binary.
|
| |
|
|
|
|
| |
Avoids the cast alignment problems of yesteryear
|
|
|
|
| |
From ~5 cbp to ~2.5 cbp on Skylake
|
|\ |
|
| |
| |
| |
| |
| |
| | |
And rotate.h is a visible header.
Blerg. Inline asm it is.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The problem with asm rol/ror is the compiler can't schedule effectively.
But we only need asm in the case when the rotation is variable, so distinguish
the two cases. If a compile time constant, then static_assert that the rotation
is in the correct range and do the straightforward expression knowing the compiler
will probably do the right thing. Otherwise do a tricky expression that both
GCC and Clang happen to have recognize. Avoid the reduction case; instead
require that the rotation be in range (this reverts 2b37c13dcf).
Remove the asm rotations (making this branch illnamed), because now both Clang
and GCC will create a roll without any extra help.
Remove the reduction/mask by the word size for the variable case. The compiler
can't optimize that it out well, but it's easy to ensure it is valid in the callers,
especially now that the variable input cases are easy to grep for.
|
| |
| |
| |
| |
| |
| |
| | |
Neither is very good at recognizing rotate sequences. For cases where
the rotation value is a constant they do fine, but for variable rotations
they do horribly. Using inline asm here improved performance of both
CAST-128 and CAST-256 by ~20% on my system with both GCC and Clang.
|
| |
| |
| |
| |
| |
| | |
Couldn't figure out a way to silence this otherwise.
Deprecate replace_char, erase_chars, replace_chars
|
|\ \
| |/
|/| |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
It was disabled anyway (bad macro check) and with recent GCC
turned out to be slower than just using bswap.
|
| | |
|
|/ |
|
|
|
|
| |
Nothing major but probably good to clean these up.
|
|
|
|
|
| |
Things like -Wconversion and -Wuseless-cast that are noisy and
not on by default.
|
|
|
|
|
| |
In filesystem free build, we weren't including any definition of
std::istream. GH #1238
|
|
|
|
|
|
| |
This got a little contorted in os_utils.cpp because of need to
support Boost asio along with system dependent interfaces.
Here it's simple: Boost or Unix or Winsock.
|
|\ |
|
| | |
|
| |
| |
| |
| | |
cast_uint8_ptr_to_char is required by Winsock_Socket
|
| |
| |
| |
| |
| | |
This removes the requirement of linking socket libraries for
applications that do not use http_util
|
|/
|
|
| |
Sonar
|
|
|
|
| |
Which is what the expression evaluates to. Caught by MSVC warning.
|
|
|
|
| |
Thankfully GCC doesn't mind it being on the definition.
|
|
|
|
|
|
|
| |
Generally speaking reinterpret_cast is sketchy stuff. But the
special case of char*/uint8_t* is both common and safe. By
isolating those, the remaining (likely sketchy) cases are easier
to grep for.
|
| |
|
| |
|
| |
|
|
|
|
| |
[ci skip]
|
| |
|
|
|
|
| |
Flagged by Sonar and quite reasonable
|
| |
|
| |
|
|
|
|
|
|
|
| |
Switch to calloc/free instead of new/delete - shouldn't matter since
we are only allocate integral types.
This change reduces the size of libbotan-2.so by ~300 Kb on my system.
|
|
|
|
|
|
| |
std::terminate can ruin your day
Coverity find
|
|
|
|
|
| |
Only required by a few modules and if none of them are in use
then the whole thing can just be skipped from the build.
|
|
|
|
|
| |
Done by a perl script which converted all classes to final, followed
by selective reversion where it caused compilation failures.
|
|
|
|
| |
Again hitting on Kullo OS X
|
| |
|