aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/bigint
Commit message (Collapse)AuthorAgeFilesLines
* Convert to using standard uintN_t integer typesJack Lloyd2016-12-188-61/+61
| | | | | | Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them.
* Remove <source> block from info.txt filesJack Lloyd2016-12-081-10/+0
| | | | | | Kind of a vestigial thing from an earlier iteration of the module design, and never useful to specify anymore since taking all the cpp files is what you want exactly 100% of the time.
* Merge GH #567/GH #457 TLS refactoring and Callbacks interfaceJack Lloyd2016-08-312-7/+4
|\
| * Reduction of code complexity in MP & ECC classes.Matthias Gierlings2016-06-192-7/+4
| | | | | | | | | | | | - reduced number of parameters in various methods - introduced structures and renamed variables to improve code readability.
* | Fix leading zero bytes in DSA, ECDSA, ECGDSA and ECKCDSA signaturesRené Korthaus2016-08-172-0/+20
|/
* Use rejection sampling in BigInt::random_integerJack Lloyd2016-03-161-10/+8
| | | | Avoids the test vector contortions in RSA-KEM
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-111-1/+1
| | | | | | | | As the alternatives are unfortunate for applications trying to catch all library errors, and it seems deriving from std::runtime_error causes problems with MSVC DLLs (GH #340) Effectively reverts 2837e915d82e43
* Internal header cleanupsJack Lloyd2015-09-192-2/+2
| | | | Only user-visible change is the removal of get_byte.h
* Remove alloc module; move secmem.h to base and locking_allocator to utilsJack Lloyd2015-08-291-1/+0
|
* Fix typosSimon Warta2015-07-241-1/+1
| | | | Thanks to @vlajos https://github.com/vlajos/misspell_fixer
* Fix BigInt random_integer() distribution issue.Simon Warta2015-07-243-10/+31
| | | | Fixes #108
* Refactor BigIntSimon Warta2015-07-243-9/+20
|
* BigInt::to_u32bit failed on 32-bit integers. GH #220Jack Lloyd2015-07-231-1/+1
|
* Fix round_upSimon Warta2015-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. src/lib/codec/base64/base64.cpp: : (round_up<size_t>(input_length, 3) / 3) * 4; 2. src/lib/codec/base64/base64.cpp: : (round_up<size_t>(input_length, 4) * 3) / 4; 3. src/lib/filters/transform_filter.cpp: return round_up(target_size, update_granularity); 4. src/lib/math/bigint/bigint.cpp: m_reg.resize(round_up<size_t>(size, 8)); 5. src/lib/math/bigint/bigint.cpp: m_reg.resize(round_up<size_t>((length / WORD_BYTES) + 1, 8)); 6. src/lib/math/numbertheory/mp_numth.cpp: BigInt z(BigInt::Positive, round_up<size_t>(2*x_sw, 16)); 7. src/lib/modes/cbc/cbc.cpp: return round_up(input_length, cipher().block_size()); 8. src/lib/modes/ecb/ecb.cpp: return round_up(input_length, cipher().block_size()); 9. src/lib/modes/xts/xts.cpp: return round_up(input_length, cipher().block_size()); 10. src/lib/pbkdf/pbkdf2/pbkdf2.cpp: const size_t blocks_needed = round_up(out_len, prf_sz) / prf_sz; 11. src/lib/tls/tls_record.cpp: const size_t buf_size = round_up( 12. src/lib/utils/rounding.h:inline T round_up(T n, T align_to) 1. Reason for change 2. Reason for change 3. first argument cannot be 0 (`target_size = 1024`) 4. Is a bug in the current implementation iff `size = 0` 5. first argument cannot be 0 6. round_up should return 0 if `x_sw = 0` 7. ? 8. ? 9. ? 10. first argument cannot be 0 (`if(out_len == 0) return 0;`) 11. first argument is unlikely to be 0 (`iv_size + msg_length + mac_size + (block_size ? 1 : 0)`) 12. Implementation
* s/auto/size_t/Simon Warta2015-07-031-1/+1
|
* More changes for use with debug STLSimon Warta2015-06-301-1/+5
|
* lib/math: Convert &vec[0] to vec.data()Daniel Seither2015-06-206-18/+18
|
* Specify class name for static functionlloyd2015-03-131-1/+1
|
* Add BigInt::encode_1363 writing to specified bufferlloyd2015-03-112-3/+10
|
* Add specialized reducers for P-192, P-224, P-256 and P-384lloyd2015-02-262-39/+31
|
* Ensure all files have copyright and license info.lloyd2015-01-109-9/+9
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* This assumed other headers it did not includelloyd2015-01-081-1/+2
|
* Inline BigInt::get_bit and byte_atlloyd2015-01-082-23/+9
|
* Add specialized reduction for P-521 along with 9x9 Comba routines.lloyd2014-11-152-8/+8
| | | | | Roughly 35-50% faster on my laptop (depending on if mlock is enabled, the overhead in that allocator is becoming much more of a hotspot).
* Use 20 Miller-Rabin iterations regardless of the size of the integer. Thislloyd2014-04-131-1/+1
| | | | | provides a much better worst-case error bound. Also take the nonce from anywhere in the usable range rather than limiting the bit size.
* Avoid a ubsan warning on GCC 4.9 due uninitialized sign enum beinglloyd2014-03-302-5/+1
| | | | read during swap (in the move constructor)
* Move lib into srclloyd2014-01-1010-0/+1779