-
Notifications
You must be signed in to change notification settings - Fork 461
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
[WIP/RFC] Remove prng registry #515
base: develop
Are you sure you want to change the base?
Conversation
I do support this idea; however, this is going to break a lot of things. Basically nearly all SW using libtomcrypt. IMO this PR should be labeled I'll hopefully find some time for deeper review. |
yep, one has to break stuff sometimes to be able to advance
yes it will be 2.0 and IMO the branch is called develop for a reason and contains the next version, no matter how hard it will break previous versions, so I think it should be merged as soon as it's ready.
The most important part of this PR is the decision if The rest of the PR is going through the sources and adapting to the new API. |
990d623
to
0050955
Compare
Oh, is that the line of thinking going forward? I'm frankly sad to see this concept go, I very much liked the way that made LTC expandable on an ad-hoc basis, for example to try out a new cipher (say?) and have it easily hooked into the LTC modes, just to mention an example... |
Oh, there's no plan to remove the basic architecture of hooking stuff together. The only thing that I believe would be better is the removal of the static registries. If we take gcm as example I imagine the changes as follows: diff --git a/src/encauth/gcm/gcm_init.c b/src/encauth/gcm/gcm_init.c
index 1822bdcc..2a3c7d80 100644
--- a/src/encauth/gcm/gcm_init.c
+++ b/src/encauth/gcm/gcm_init.c
@@ -19,3 +19,3 @@
*/
-int gcm_init(gcm_state *gcm, int cipher,
+int gcm_init(gcm_state *gcm, const struct ltc_cipher_descriptor *cipher,
const unsigned char *key, int keylen) This would've basically prevented the race condition of SM4 we just saw. Currently we're carrying a lot of times a descriptor/state+id in the API, whereas we could simply combine both into the state. |
0050955
to
ce68cee
Compare
It kind of makes sense, and I can agree with that... it does cut away the possibility for more complex systems, where there's a part that needs to be able to find implementations by name. However, it is questionable if that complexity level must be part of ltc itself, or if it is better left to be implemented by apps, or another library on top of ltc. Thank you for clarifying! |
The first step into the direction of a registry-free LibTomCrypt