-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add new key agreement function #101
Add new key agreement function #101
Conversation
After some further consideration on the open issues:
In alignment with the other APIs that return a key, this one should require that caller does set the key type in the attributes.
Truncating the output is unnecessary, and risks making the shared secret discoverable. This function should always return the entire shared secret. In alignment with |
The latter, I would even think about deprecating psa_raw_key_agreement()
and replace it with a new function with the canonical argument order.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Andrew Thoelke ***@***.***>
Sent: Tuesday, October 31, 2023 9:18:55 PM
To: ARM-software/psa-api ***@***.***>
Cc: Marcus Streets ***@***.***>; Review requested ***@***.***>
Subject: Re: [ARM-software/psa-api] Add new key agreement function (PR #101)
@athoelke commented on this pull request.
________________________________
In doc/crypto/api/ops/ka.rst<#101 (comment)>:
@@ -114,6 +122,91 @@ Key agreement algorithms
Standalone key agreement
------------------------
+.. function:: psa_key_agreement
+
+ .. summary::
+ Perform a key agreement and return the shared secret as a derivation key.
+
+ .. param:: psa_algorithm_t alg
So that narrows it to two options: parameter consistency with psa_raw_key_agreement() or with 'all the other APIs'? - do I detect a preference for the latter? (That is my preference and leave raw key agreement as the odd one out)
—
Reply to this email directly, view it on GitHub<#101 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIU75VSHY63CXANLMOHDHNTYCFTL7AVCNFSM6AAAAAA4Z7SP2WVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOMBXGI2TMMRXGI>.
You are receiving this because your review was requested.Message ID: ***@***.***>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
|
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 overall design looks good to me, but there are editorial mistakes and some places are unclear.
ed15b61
to
667c155
Compare
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.
LGTM except for one problem with shared secret size vs key size.
Add psa_key_agreement() as a standalone function that outputs to a new derivation key.
Specify the key type and size constraints for the output.
Signed-off-by: Andrew Thoelke <[email protected]>
* 'raw key agreement' -> 'standalone key agreement' * 'full key agreement' -> 'combined key agreement'
Synonym for PSA_ALG_IS_RAW_KEY_AGREEMENT().
7331c53
to
a719ef3
Compare
Reviewer is happy for the PR to now be merged
Add
psa_key_agreement()
as a standalone function that outputs to a new derivation key.Fixes #85