Skip to content

Commit 80ea731

Browse files
authored
Merge pull request #114 from athoelke/pake-get-shared-key
Change the PAKE output function to return a key
2 parents 2c25cd1 + 1be1896 commit 80ea731

8 files changed

Lines changed: 215 additions & 49 deletions

File tree

doc/ext-pake/api.db/psa/crypto-pake.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ typedef uint8_t psa_pake_step_t;
1212
#define PSA_ALG_IS_PAKE(alg) /* specification-defined value */
1313
#define PSA_ALG_JPAKE(hash_alg) /* specification-defined value */
1414
#define PSA_PAKE_CIPHER_SUITE_INIT /* implementation-defined value */
15+
#define PSA_PAKE_CONFIRMED_KEY 0
1516
#define PSA_PAKE_INPUT_MAX_SIZE /* implementation-defined value */
1617
#define PSA_PAKE_INPUT_SIZE(alg, primitive, input_step) \
1718
/* implementation-defined value */
@@ -32,16 +33,21 @@ typedef uint8_t psa_pake_step_t;
3233
#define PSA_PAKE_STEP_KEY_SHARE ((psa_pake_step_t)0x01)
3334
#define PSA_PAKE_STEP_ZK_PROOF ((psa_pake_step_t)0x03)
3435
#define PSA_PAKE_STEP_ZK_PUBLIC ((psa_pake_step_t)0x02)
36+
#define PSA_PAKE_UNCONFIRMED_KEY 1
3537
psa_status_t psa_pake_abort(psa_pake_operation_t * operation);
3638
psa_pake_cipher_suite_t psa_pake_cipher_suite_init(void);
3739
psa_algorithm_t psa_pake_cs_get_algorithm(const psa_pake_cipher_suite_t* cipher_suite);
40+
uint32_t psa_pake_cs_get_key_confirmation(const psa_pake_cipher_suite_t* cipher_suite);
3841
psa_pake_primitive_t psa_pake_cs_get_primitive(const psa_pake_cipher_suite_t* cipher_suite);
3942
void psa_pake_cs_set_algorithm(psa_pake_cipher_suite_t* cipher_suite,
4043
psa_algorithm_t alg);
44+
void psa_pake_cs_set_key_confirmation(psa_pake_cipher_suite_t* cipher_suite,
45+
uint32_t key_confirmation);
4146
void psa_pake_cs_set_primitive(psa_pake_cipher_suite_t* cipher_suite,
4247
psa_pake_primitive_t primitive);
43-
psa_status_t psa_pake_get_implicit_key(psa_pake_operation_t *operation,
44-
psa_key_derivation_operation_t *output);
48+
psa_status_t psa_pake_get_shared_key(psa_pake_operation_t *operation,
49+
const psa_key_attributes_t * attributes,
50+
psa_key_id_t * key);
4551
psa_status_t psa_pake_input(psa_pake_operation_t *operation,
4652
psa_pake_step_t step,
4753
const uint8_t *input,

doc/ext-pake/api/pake.rst

Lines changed: 199 additions & 42 deletions
Large diffs are not rendered by default.

doc/ext-pake/appendix/history.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ API changes
2424
* Add the `PSA_PAKE_STEP_CONFIRM` PAKE step for input and output of key confirmation values.
2525
* Add `psa_pake_set_context()` to set context data for a PAKE operation.
2626

27+
* Replaced :code:`psa_pake_get_implicit_key()` with :code:`psa_pake_get_shared_key()`. This returns a new key containing the shared secret, instead of injecting the shared secret into a key derivation operation.
28+
* Added a key confirmation attribute to the PAKE cipher suite. This indicates whether the application wants to extract the shared secret before, or after, key confirmation. See :secref:`pake-cipher-suite`.
29+
2730
Clarifications
2831
~~~~~~~~~~~~~~
2932

doc/ext-pake/figure/j-pake.pdf

-142 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
1+
SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
22
SPDX-License-Identifier: CC-BY-SA-4.0 AND LicenseRef-Patent-license

doc/ext-pake/figure/j-pake.puml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
' SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
1+
' SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
22
' SPDX-License-Identifier: CC-BY-SA-4.0 AND LicenseRef-Patent-license
33

44
@startuml
@@ -39,6 +39,6 @@
3939

4040
note over User, Peer: If both sides used the same secret //s//, then //Ka// = //Kb//
4141

42-
User -> User: ""psa_pake_get_implicit_key()"" to extract //Ka//
42+
User -> User: ""psa_pake_get_shared_key()"" to extract //Ka//
4343

4444
@enduml

doc/ext-pake/figure/j-pake.svg

Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
1+
SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
22
SPDX-License-Identifier: CC-BY-SA-4.0 AND LicenseRef-Patent-license

0 commit comments

Comments
 (0)