Comments (6)
I've been pushing this off for a little time now, but it would require some ASM optimizations: https://github.com/randombit/botan/blob/master/src/lib/math/mp/mp_x86_64/mp_asmi.h
Perf gives me the following hot spots:
23.11% benchmark benchmark [.] _D5botan4math2mp7mp_core8word_addFNammPmZm
16.26% benchmark benchmark [.] _D5botan4math2mp7mp_core10word_madd3FNammmPmZm
9.91% benchmark benchmark [.] _D5botan4math2mp7mp_core10word_madd2FNammPmZm
I'll try and merge a fix for this soon
from botan.
I think LDC is going to be needed here. I'll invest some time on compiling with that instead.
from botan.
Yep, I would also not bother much with dmd on this and it would be nice to have some numbers from LDC or GDC.
from botan.
As soon as 2.067 is supported in LDC the plan was to add support. I can't use asm pure nothrow
with the current version.
I'm guessing the optimizations from LLVM will close the gap on this benchmark, dmd has a lot of known codegen missing features and 46x is reasonable given the complexity of these algorithms and the opportunities that other compilers can use.
from botan.
I added an openssl engine that pipes all Big number operations through OpenSSL, and also added LDC support, and it's still 5-6x slower for RS256 down from 46x. I'm going to improve it towards the point where it pipes public key operations directly through the high-level openssl functions like RSA_sign
. I think it's going to be hard to beat OpenSSL in terms of manually tweaking the performance for these because LDC doesn't have manual inlining yet so there's a lot of overhead that can't be eliminated
from botan.
I decided to put this through perf
and apparently the problem was with loadKey
doing a lot of checks. Putting the private key in a static variable reduces the difference with openssl to about 3.5x on x86_64, which I deem more acceptable. However, I will add encryption/decryption/signing/verification engines for high-level crypto objects in the openssl engine to make up for the performance gap when it is needed.
from botan.
Related Issues (20)
- DUB failing using ldc HOT 1
- botan.block.xtea crashes DMD
- Many deprecation warnings
- import botan.* causes crash DMD HOT 8
- bcrypt doesn't work on Windows
- Fresh install of botan fails with "libbotan-2.so.9: cannot open shared object file: No such file or directory"
- Botan fails to build with D 2.084 HOT 13
- How can I decode encrypted msg like openssl HOT 1
- Port system certificate store HOT 1
- Vulnerability warning due to dependency to oudated OpenSSL 1.0.1g
- undefined identifier pbes2Encrypt HOT 1
- Make openssl dependency optional HOT 1
- Botan fails to build with x86-ldc HOT 2
- Build errors with DMD 2.100 HOT 2
- Compilation fails on latest dmd and ldc HOT 1
- Error Compiling on intel MacOS 11.6 HOT 2
- Cannot use botan.cert.x509.x509self HOT 6
- Feature request: Add support for X.509 extensions without editing the source code of the library
- How up to date is this library? HOT 4
- DataSource from string HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botan.