Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Ensure that trying to add points from different groups fails. | Jack Lloyd | 2018-06-19 | 2 | -13/+19 |
| | | | | Producing garbage instead is asking for trouble. | ||||
* | Use masked table lookup in ECC base point multiplication | Jack Lloyd | 2018-06-19 | 2 | -9/+42 |
| | |||||
* | Avoid a special case in Barrett reduction for x < mod | Jack Lloyd | 2018-06-18 | 1 | -8/+3 |
| | | | | This would have prevented CVE-2018-12435 | ||||
* | Avoid unnecessary realloc in BigInt::mod_sub | Jack Lloyd | 2018-06-17 | 1 | -2/+7 |
| | |||||
* | Add some todo comments wrt side channels in ECC scalar mult | Jack Lloyd | 2018-06-17 | 1 | -0/+5 |
| | |||||
* | Avoid leaking size of exponent | Jack Lloyd | 2018-06-17 | 11 | -51/+119 |
| | | | | See #1606 for discussion | ||||
* | Merge GH #1609 Avoid small side channel in ECC field mul | Jack Lloyd | 2018-06-15 | 1 | -22/+15 |
|\ | |||||
| * | In ECC avoid using significant words to dispatch the mult algo | Jack Lloyd | 2018-06-15 | 1 | -22/+15 |
| | | | | | | | | | | | | Normally all elements will be exact number of limbs as the field. Any situation with short elements is rare and not worth optimizing for, and likely leads to some unfortunate side channel. | ||||
* | | TLS would try to negotiate x25519 even if disabled | Jack Lloyd | 2018-06-15 | 1 | -2/+6 |
|/ | | | | | | | | Also reorder ECC groups to actually match performance characteristics. I'm not sure when P-384 was slower than P-521 but it certainly isn't anymore. Fixes #1607 | ||||
* | Add combined conditional add-or-subtract | Jack Lloyd | 2018-06-14 | 3 | -5/+41 |
| | |||||
* | Remove CT annotations from Montgomery reduction | Jack Lloyd | 2018-06-14 | 1 | -8/+0 |
| | | | | | The poisons don't stack so the unpoison hid conditional jumps we want to find. | ||||
* | In Montgomery mul, avoid branching based on sig words of integers | Jack Lloyd | 2018-06-14 | 1 | -13/+21 |
| | | | | Instead just assume they are the same size as the prime | ||||
* | Make Karatsuba multiply completely const time | Jack Lloyd | 2018-06-14 | 4 | -24/+52 |
| | |||||
* | Avoid overallocation of memory for EC base point multiples | Jack Lloyd | 2018-06-14 | 1 | -1/+1 |
| | | | | | | | The size is rounded up to next 8 words so there was substantial slack here. No noticable perf difference. | ||||
* | Add 192-bit Suite B policy | Jack Lloyd | 2018-06-14 | 1 | -0/+36 |
| | | | | Since 128-bit policy is actually not even allowed since 2015. | ||||
* | Address DSA/ECDSA side channel | Jack Lloyd | 2018-06-13 | 4 | -17/+80 |
| | |||||
* | Unroll bigint_monty_redc for various sizes | Jack Lloyd | 2018-06-11 | 4 | -24/+2691 |
| | | | | Speedup of 10 to 30% depending on algo | ||||
* | Add missing statement | Jack Lloyd | 2018-06-08 | 1 | -0/+1 |
| | |||||
* | Attempt at MSVC 2013 workaround | Jack Lloyd | 2018-06-08 | 1 | -2/+4 |
| | |||||
* | Expose BER_Decoder constructor taking BER_Object&& | Jack Lloyd | 2018-06-08 | 2 | -4/+10 |
| | |||||
* | Reduce copying/allocations when BER decoding | Jack Lloyd | 2018-06-08 | 2 | -81/+194 |
| | | | | | | | We are constrained in how far we can go because BER_Object must mandatorily copy its value (due to the public member variable exposting the bytes). But this reduces the number of allocations when parsing a sample X.509 certificate by about 15% | ||||
* | Allow passing a writer function callback to DER_Encoder | Jack Lloyd | 2018-06-08 | 2 | -10/+18 |
| | |||||
* | Declare copy and move constructors on BER_Object | Jack Lloyd | 2018-06-08 | 1 | -0/+8 |
| | |||||
* | Constify some local variables | Jack Lloyd | 2018-06-08 | 1 | -2/+2 |
| | |||||
* | Improve error reporting on unexpected EOF when decoding ASN | Jack Lloyd | 2018-06-08 | 1 | -4/+17 |
| | |||||
* | Fix a bug in Barrett reduction | Jack Lloyd | 2018-06-05 | 2 | -26/+33 |
| | | | | | | -x*n % n would reduce to n instead of zero. Also some small optimizations and cleanups. | ||||
* | Correct exception message [ci skip] | Jack Lloyd | 2018-06-04 | 1 | -1/+1 |
| | | | | The previous message was both incorrect and very misleading. | ||||
* | Merge GH #1594 Add ECDSA Wycheproof tests | Jack Lloyd | 2018-05-31 | 4 | -16/+52 |
|\ | |||||
| * | Handle EC_R_BAD_SIGNATURE from OpenSSL | Jack Lloyd | 2018-05-31 | 2 | -0/+14 |
| | | |||||
| * | Prevent signature malleability in DER/BER encoded sigs | Jack Lloyd | 2018-05-31 | 1 | -14/+35 |
| | | |||||
| * | Correct error in P-224 computation | Jack Lloyd | 2018-05-31 | 1 | -2/+3 |
| | | | | | | | | | | | | | | | | If x was very small to start with x.size() might be under the limb count which would cause the final addition to throw because the destination array was smaller than the P-224 p being added. Caught by Wycheproof ECDSA tests | ||||
* | | Move codec_base.h to internal header in utils | Jack Lloyd | 2018-05-31 | 5 | -5/+4 |
| | | |||||
* | | Refactoring Base32 to use the templated algorithm | Wambou | 2018-05-31 | 2 | -182/+146 |
| | | |||||
* | | Define templated base encoding/decoding | Wambou | 2018-05-31 | 2 | -0/+167 |
| | | |||||
* | | Implement Base32 | Wambou | 2018-05-31 | 3 | -0/+417 |
|/ | |||||
* | Add back support for Windows Phone RNG, undeprecate UWP | Jack Lloyd | 2018-05-28 | 2 | -0/+49 |
| | | | | See #1586. Reverts part of #1494 | ||||
* | Tiny optimization in MDx_HashFunction::final_result | Jack Lloyd | 2018-05-28 | 1 | -2/+1 |
| | | | | Typically not a bottleneck but this shows up in XMSS profiling | ||||
* | Merge GH #1584 Add BMI2 optimization for SHA-256 | Jack Lloyd | 2018-05-27 | 7 | -4/+192 |
|\ | |||||
| * | Add BMI2-specific SHA-256 | Jack Lloyd | 2018-05-27 | 7 | -4/+192 |
| | | | | | | | | | | Currently just a copy of the baseline compression function, but compiled with BMI2 flags. On Skylake improves performance by about 40%. | ||||
* | | Improves "Avoid repeated allocations in XMSS chain function" | Matthias Gierlings | 2018-05-27 | 1 | -1/+2 |
| | | |||||
* | | Avoid repeated allocations in XMSS chain function | Jack Lloyd | 2018-05-27 | 1 | -1/+4 |
|/ | | | | | | | | | | | | | | | | | | | | This is the core hotspot of XMSS signatures. Avoiding the secure_vector allocation for the PRF output improves performance quite noticably. Before: XMSS_SHA2-256_W16_H10 1940.74 ms/op XMSS_SHA2-512_W16_H10 3985.98 ms/op XMSS_SHAKE128_W16_H10 1910.48 ms/op XMSS_SHAKE256_W16_H10 4074.65 ms/op After: XMSS_SHA2-256_W16_H10 1204.34 ms/op XMSS_SHA2-512_W16_H10 2498.17 ms/op XMSS_SHAKE128_W16_H10 1176.55 ms/op XMSS_SHAKE256_W16_H10 2689.76 ms/op | ||||
* | Fixes XMSS leaf index bounds sanity check | Matthias Gierlings | 2018-05-25 | 3 | -5/+4 |
| | | | | | | | | | | Prior to this patch the sanity check for XMSS leaf indices was wrongly based on the tree height. As a result only half of the one-time keys could be used. Instead base leaf index sanity check on the number of levels in a tree which equals tree height + 1. (see also: https://tools.ietf.org/html/draft-irtf-cfrg-xmss-hash-based-signatures-12#section-4.1.1) | ||||
* | Improve error message on BER decoding error | Jack Lloyd | 2018-05-24 | 2 | -6/+50 |
| | |||||
* | Add OIDS for Camellia and SM4 in GCM and CBC modes | Jack Lloyd | 2018-05-22 | 2 | -3/+23 |
| | | | | Making them usable for private key encryption | ||||
* | Support scrypt for encrypting private keys | Jack Lloyd | 2018-05-22 | 3 | -85/+259 |
| | |||||
* | Remove debug printf | Jack Lloyd | 2018-05-22 | 1 | -1/+1 |
| | |||||
* | Fix PBE decoding and fix test macro check | Jack Lloyd | 2018-05-22 | 1 | -1/+1 |
| | |||||
* | DER improvements | Jack Lloyd | 2018-05-22 | 22 | -200/+287 |
| | | | | | | | | | | | Let DER_Encoder write to a user specified vector instead of only to an internal vector. This allows encoding to a std::vector without having to first write to a locked vector and then copying out the result. Add ASN1_Object::BER_encode convenience method. Replaces X509_Object::BER_encode which had the same logic but was restricted to a subtype. This replaces many cases where DER_Encoder was just used to encode a single object (X509_DN, AlgorithmIdentifier, etc). | ||||
* | Inline SymmetricAlgorithm::verify_key_set | Jack Lloyd | 2018-05-21 | 2 | -4/+9 |
| | | | | Instead just put the throw into a compiled function. | ||||
* | Merge GH #1571 DER_Encoder optimizations | Jack Lloyd | 2018-05-21 | 2 | -83/+123 |
|\ |