-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A crypto service provider based on Botan #2700
Conversation
Wow!, A C++ crypto lib integrated in a C++ protocol via a "C" cryspr. |
So, it's a work in progress at the moment - I've only just realised Botan has a C API wrapper so I'm changing it to use that in any case, then I don't need to have the botan_sys workaround for the C++/C problem and it makes things cleaner. I started by looking at MBedTLS, then realised that ECB wasn't supported by Botan, but it has AES keywrap functions so I enabled that option. I will look a AES-GCM - I expect Botan does support that, so I'll have a look at the openssl-eve wrapper.... More to come later anyway. |
Thnk you for the proposal, @oviano! |
Yes, I will look at that once I've got AES-GCM working. |
@oviano Just a FYI - AES-GCM is certainly supported. Also ECB is available, both via the C and C++ APIs, but only via the raw block cipher interface. Eg in the C API |
Great thanks for the info. I’ve just committed AES-GCM support actually. ECB seems like a fallback option for when CTR or GCM is not available in the cryptolib so doesn’t seem much point in adding. |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #2700 +/- ##
==========================================
+ Coverage 67.11% 67.13% +0.01%
==========================================
Files 99 99
Lines 20174 20174
==========================================
+ Hits 13540 13544 +4
+ Misses 6634 6630 -4 see 10 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
So it now works with both AES-CTR and AES-GCM, and the only thing it needs is someone to finish off what is required in CMakeLists.txt to allow it to find the Botan install and link to the relevant libraries etc. I don't have enough experience with CMake for this to be something trivial for me. |
I've now integrated this into the CMake system and I have built it on Android (macOS host), macOS, iOS, Windows and Linux (Ubuntu 22.04 VM). Here is a summary of the build commands necessary:
Specifying the enclib as botan triggers FindBotan.cmake to be used (this is in the scripts folder), which downloads the latest Botan release source code from GitHub, creates the amalgamation files and builds a simple static library which is then linked to srt. It's all automatic, except for having to pass in botan-os and botan-cpu as shown above to tell Botan to configure the amalgamation files correctly (including the required intrinsics, for example). |
5cf46ac
to
ea4922a
Compare
c158eb3
to
9b8669f
Compare
As my project primarily uses Botan (https://botan.randombit.net) I decided to write a Botan cryspr for SRT so that I could drop my dependency on multiple crypto libs.
I'm sharing this in case it is of interest to anyone. I've not integrated this into the SRT build system(s) at this stage as I do not use them; instead dropping the SRT files directly into my projects.