-
Notifications
You must be signed in to change notification settings - Fork 159
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
Improve TPMUSymKeyBits and TPMUSymMode #384
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for this change! I have a couple comments.
// AES returns the 'aes' member of the union. | ||
// | ||
// Deprecated: AES exists for historical 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.
The structure does indeed have members for each algorithm, see https://trustedcomputinggroup.org/wp-content/uploads/TPM-2.0-1.83-Part-2-Structures.pdf#page=150 (and see https://trustedcomputinggroup.org/wp-content/uploads/TPM-2.0-1.83-Part-2-Structures.pdf#page=32 for an explanation of the algorithm tokens). sym
is there as a convenience within the reference implementation and IMHO probably shouldn't even be mentioned in the spec. Also, I'm expecting that a future version of the spec flattens these macros, because they're hard to understand.
@@ -1446,7 +1461,7 @@ type SymModeContents interface { | |||
// create implements the unmarshallableWithHint interface. | |||
func (u *TPMUSymMode) create(hint int64) (reflect.Value, error) { | |||
switch TPMAlgID(hint) { | |||
case TPMAlgAES: | |||
case TPMAlgTDES, TPMAlgAES, TPMAlgSM4, TPMAlgCamellia: |
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.
TDES is deprecated (https://csrc.nist.gov/news/2023/nist-to-withdraw-sp-800-67-rev-2) so can we just not implement support for it?
No description provided.