-
Notifications
You must be signed in to change notification settings - Fork 85
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
refactoring Algorithm definition components into separate encryption, kdf, and authentication algorithm suites #36
Conversation
… kdf, and authentication algorithm suites
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I like this, but have a few minor notes.
- We aren't (and shouldn't) be changing the specification. Thus what you describe as the "legacy" interface really is the "official" interface and you're just making some (very nice) implementation changes to make life easier.
- Please ensure that it is clear that developers don't get to mix and match these sub-components as they see fit and only official AlgorithmSuites are supports and may be used.
self.authentication = authentication | ||
self.allowed = allowed | ||
|
||
# Encryption Suite Legacy Compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove "legacy" comment
self.auth_key_len = self.encryption.auth_key_length | ||
self.auth_len = self.tag_len = self.encryption.auth_length | ||
|
||
# KDF Suite Legacy Compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove "legacy" comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove "legacy" comment
…icationSuite members must only be used as part of an AlgorithmSuite
Updated with requested docs/comments changes. |
This is an idea I've been playing with to try and make the algorithm suites more comprehensible and less error-prone.
Status Quo
Each algorithm suite is composed of a large number of individual values that together form the complete algorithm suite specification.
Problem
These algorithm suite definitions are hard to understand, hard to debug, and easy to mess up.
Solution
Algorithm suites are not conceptually a grouping of a large number of primitives. They are a grouping of a small number of groupings of related values. Each of these groupings define characteristics of the overall algorithm suite.
I have separated these out into three sub-suites:
Each algorithm suite is then defined as a combination of these three sub-suites.
This lets us move from each algorithm suites having 13 distinct characteristics with no innately relations to:
Each algorithm suite now has four important values: algorithm ID, encryption suite, KDF suite, and authentication suite.
For legacy compatibility, when each algorithm suite is constructed, it still sets all of its expected attributes using the attributes of the sub-suites.