Further pake code optimizations
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
diff --git a/library/psa_crypto_pake.c b/library/psa_crypto_pake.c
index 538df87..a537184 100644
--- a/library/psa_crypto_pake.c
+++ b/library/psa_crypto_pake.c
@@ -431,7 +431,8 @@
0, 23 /* secp256r1 */
};
- if (operation->buffer_length + sizeof(ecparameters) > sizeof(operation->buffer)) {
+ if (operation->buffer_length + sizeof(ecparameters) >
+ sizeof(operation->buffer)) {
return PSA_ERROR_BUFFER_TOO_SMALL;
}
@@ -441,10 +442,9 @@
}
/*
- * The core has checked that input_length is smaller than
- * PSA_PAKE_INPUT_SIZE(PSA_ALG_JPAKE, primitive, step)
- * where primitive is the JPAKE algorithm primitive and step
- * the PSA API level input step. Thus no risk of integer overflow here.
+ * The core checks that input_length is smaller than
+ * PSA_PAKE_INPUT_MAX_SIZE.
+ * Thus no risk of integer overflow here.
*/
if (operation->buffer_length + input_length + 1 > sizeof(operation->buffer)) {
return PSA_ERROR_BUFFER_TOO_SMALL;