| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Actual bug, flagged by Coverity
|
|
|
|
| |
Flagged by Coverity
|
|
|
|
|
|
|
| |
This skips putting the git revision in the build.h header. This value
changing every time means we effectively disable ccache's direct mode
(which is faster than preprocessor mode) and also prevent any caching
of the amalgamation file (since version.cpp expands the macro).
|
|
|
|
| |
Even 600M is not sufficient for the coverage build
|
|
|
|
|
| |
Using phrase "timestamp" makes it sound like it has some relation
to wall clock which it does not.
|
| |
|
|
|
|
| |
No reason for these to be inlined
|
|
|
|
|
|
| |
Only used in one place, where const time doesn't matter, but can't hurt.
Remove low_bit, can be replaced by ctz.
|
|
|
|
|
|
| |
Reading the system timestamp first causes every event to get a few
hundred cycles tacked onto it. Only mattered when the thing being
tested was very fast.
|
|
|
|
| |
Still insufficient for debug builds
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
They get compiled as const-time on x86-64 with GCC but I don't think
this can be totally relied on. But it is anyway an improvement.
And, faster, because we compute it recursively
|
|
|
|
|
| |
With compression disabled, the cache is too small for builds that
use debug info, and causes 100% miss rate.
|
|
|
|
| |
I couldn't get anything to link with PGI, but at least it builds again.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The decoding leaked some information about the delimiter index
due to copying only exactly input_len - delim_idx bytes. I can't
articulate a specific attack that would work here, but it is easy
enough to fix this to run in const time instead, where all bytes
are accessed regardless of the length of the padding.
CT::copy_out is O(n^2) and thus terrible, but in practice it is only
used with RSA decryption, and multiplication is also O(n^2) with the
modulus size, so a few extra cycles here doesn't matter much.
|
| |
| |
| |
| |
| |
| |
| | |
It was only needed for one case which is easily hardcoded. Include
rotate.h in all the source files that actually use rotr/rotl but
implicitly picked it up via loadstor.h -> bswap.h -> rotate.h include
chain.
|
|/
|
|
| |
Since CPU is main bottleneck to the build, this is likely not helping.
|
|
|
|
| |
Add tests for is_power_of_2
|
|
|
|
|
|
|
|
|
|
|
| |
As doing so means that information about the high bits of the scalar can leak
via timing since the loop bound depends on the length of the scalar. An attacker
who has such information can perform a more efficient brute force attack (using
Pollard's rho) than would be possible otherwise.
Found by Ján Jančár (@J08nY) using ECTester (https://github.com/crocs-muni/ECTester)
CVE-2018-20187
|
| |
|
|
|
|
|
|
| |
This doesn't matter much but it causes confusing valgrind output when
const-time checking since it distinguishes between the two possible
conditional returns.
|
|
|
|
|
| |
We know the lookup table is some power of 2, unrolling a bit
allows more IPC
|
|
|
|
|
| |
Code is easier to understand and it may let the CPU interleave the
loads and logical ops better. Slightly faster on my machine.
|
|
|
|
| |
Improves ECDSA signing by 15%
|
| |
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| | |
This addresses #730. The tls_sign_message callback was unable to handle
emsa strings produced as padding strings for TLS::Signature_Scheme, due
to inconsistent naming (mostly between EMSA3 and EMSA_PKCS1).
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
It appears OpenSSL has a different interpretation from us of how the
message representative is formed for P-521 when given a hash to sign
that is larger than the group order; signatures generated by us do
not verify with OpenSSL and vice versa.
|
| |
| |
| |
| |
| |
| | |
See http://www.secg.org/sec1-v2.pdf section 4.1.6
Closes #664
|
| | |
|
| | |
|
| | |
|
|\ \ |
|
| | | |
|
|/ /
| |
| |
| |
| | |
I'm not sure this test is that useful, which is not itself a big problem,
but it is also flaky and occasionally fails, which is no good.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | | |
Previous EEA leaked information about the low word of the prime,
which is a problem for RSA.
|
| | | |
|
|/ /
| |
| |
| |
| |
| | |
Instead require the inputs be reduced already. For RSA-CRT use
Barrett which is const time already. For SRP6 inputs were not reduced,
use the Barrett hook available in DL_Group.
|
| |
| |
| |
| | |
This var is not used if we use Baile-PSW instead
|
| |
| |
| |
| |
| | |
explicit_bzero/explicit_memset since quite a time.
getentropy exists for FreeBSD, but only from 12.x.
|
| |
| |
| |
| | |
This is a tiny thing but it saves over 100K cycles for P-384 ECDSA
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Allows replacing div/mod by a variable with a shift/mask.
Allows storing just the bit count, which saves a few bytes.
|