Botan Crypto and TLS for D
Etienne Cimon via Digitalmars-d
digitalmars-d at puremagic.com
Wed Feb 18 04:45:31 PST 2015
On 2015-02-18 05:22, ketmar wrote:
> On Wed, 18 Feb 2015 06:35:08 +0000, Joakim wrote:
>
>> accompanied by benchmarks of the C++ and D code
>
> it's better to keep silence. dmd was never very good in optimising
> code. ;-)
>
Not really, most of the sensitive code is optimized via native
instructions, the crypto algorithms should be all the same. If you count
the seconds for the unit test to run, powermod (public key cryptography)
was equal in debug mode. Didn't check release though, but debug was
11sec and GCC optimizes the C++ version to 3 seconds :-p
The sensitive parts are AES-NI and GCM, where the processor does the
encryption, and I handled with care those native instructions so that
should be 600MB/s - 1GB/s regardless of the compiler
As for the learning experience, I spent most of the time doing search &
replace from C to D types and names, writing utils/simd instructions
(__m128i __m256i xmmintrins.h etc), writing memutils (~= STL) because I
needed proper containers and allocators to work with.
More information about the Digitalmars-d
mailing list