refactoring Algorithm definition components into separate encryption, kdf, and authentication algorithm suites#36
Merged
SalusaSecondus merged 4 commits intoaws:masterfrom Jan 5, 2018
mattsb42-aws:algorithm-reorg
Merged
refactoring Algorithm definition components into separate encryption, kdf, and authentication algorithm suites#36SalusaSecondus merged 4 commits intoaws:masterfrom mattsb42-aws:algorithm-reorg
SalusaSecondus merged 4 commits intoaws:masterfrom
mattsb42-aws:algorithm-reorg
Conversation
… kdf, and authentication algorithm suites
Contributor
SalusaSecondus
left a comment
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Please remove "legacy" comment
Contributor
There was a problem hiding this comment.
Please remove "legacy" comment
…icationSuite members must only be used as part of an AlgorithmSuite
Member
Author
|
Updated with requested docs/comments changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.