aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/sm4
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated headers, make more headers internalJack Lloyd2020-11-063-7/+5
| | | | | | | | | Now modules default to internal headers instead of defaulting to public; making a new public API should be a visible and intentional choice. Brings the public header count from over 300 to around 150. Also removes the deprecated tls_blocking interface
* Reorder indexes in SM4 round macroJack Lloyd2020-06-091-4/+4
|
* Fix some maintainer mode warningsJack Lloyd2020-02-111-4/+10
|
* Remove support for splitting the amalgamation by ABIJack Lloyd2020-01-221-4/+4
| | | | | | | | | | This is as if --single-file-amalgamation was always used, except also now botan_all_internal.h is not created. This effectively drops support for very old GCC/Clang in the amalgamation (only). GCC 5+ and Clang 3.8+ support the target attribute and work fine. MSVC not affected since it doesn't need such attributes in the first place.
* Deprecate many publically available headersJack Lloyd2019-09-061-0/+2
|
* Make the ISA list a listJack Lloyd2019-04-171-1/+3
|
* Avoid including rotate.h in bswap.hJack Lloyd2018-12-211-0/+1
| | | | | | | 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.
* Remove support for Visual C++ 2013Jack Lloyd2018-10-011-2/+2
| | | | Closes GH #1557
* Unroll SM4 encryption/decryption by 2Jack Lloyd2018-07-131-23/+105
| | | | Interleaving operations improves SM4/CTR from 26 cpb to 18 cpb
* Add support for ARMv8 SM4 instructionsJack Lloyd2018-07-094-0/+221
| | | | Tested in qemu
* Add checks that keyed algorithms are actually keyed before useJack Lloyd2017-10-261-0/+4
| | | | | Previously calling update or encrypt without calling set_key first would result in invalid outputs or else crashing.
* Optimizations for SM4Jack Lloyd2017-10-131-35/+94
| | | | | | | | | Using a larger table helps quite a bit. Using 4 tables (ala AES T-tables) didn't seem to help much at all, it's only slightly faster than a single table with rotations. Continue to use the 8 bit table in the first and last rounds as a countermeasure against cache attacks.
* Add compile-time rotation functionsJack Lloyd2017-10-121-2/+2
| | | | | | | | | | | | | | | | | 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.
* Change header guard format to BOTAN_FOO_H_Jack Lloyd2017-09-201-2/+2
| | | | | | ISO C++ reserves names with double underscores in them Closes #512
* More annotationsJack Lloyd2017-09-191-1/+1
|
* Add SM4 block cipherJack Lloyd2017-06-163-0/+197
This work was sponsored by Ribose Inc