You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The operation state is not valid: it must be inactive.
2313
2306
* The library requires initializing by a call to `psa_crypto_init()`.
2314
2307
2315
-
If a context parameter is not required or not supported by the algorithm, a zero-length context must be provided.
2316
-
2317
-
The sequence of operations to sign a message is as follows:
2308
+
The sequence of operations to sign a message using a multi-part sign operation is as follows:
2318
2309
2319
2310
1. Allocate a sign operation object which will be passed to all the functions listed here.
2320
2311
#. Initialize the operation object with one of the methods described in the documentation for `psa_sign_operation_t`, for example `PSA_SIGN_OPERATION_INIT`.
2321
-
#. Call `psa_sign_setup()` to specify the key-pair, algorithm, and optional context value.
2312
+
#. Call `psa_sign_setup()` to specify the key pair and algorithm.
2313
+
#. Optionally, call `psa_sign_set_context()` to provide a context.
2322
2314
#. Call `psa_sign_update()` zero, one or more times, passing a fragment of the message each time.
2323
2315
The signature that is calculated is the signature of the concatenation of these messages in order.
2324
2316
#. To extract the signature the hash, call `psa_sign_finish()`.
Provide a context for a multi-part sign operation.
2335
+
2336
+
.. versionadded:: 1.5
2337
+
2338
+
.. param:: psa_sign_operation_t * operation
2339
+
Active sign operation.
2340
+
.. param:: const uint8_t * context
2341
+
Buffer containing the context value.
2342
+
.. param:: size_t context_length
2343
+
Size of the ``context`` buffer in bytes.
2344
+
2345
+
.. return:: psa_status_t
2346
+
.. retval:: PSA_SUCCESS
2347
+
Success.
2348
+
.. retval:: PSA_ERROR_BAD_STATE
2349
+
The following conditions can result in this error:
2350
+
2351
+
* The operation state is not valid: it must be active, and no call to `psa_sign_set_context()` or `psa_sign_update()` has been made.
2352
+
* The library requires initializing by a call to `psa_crypto_init()`.
2353
+
.. retval:: PSA_ERROR_INVALID_ARGUMENT
2354
+
The following conditions can result in this error:
2355
+
2356
+
* ``context_length`` is not valid for the algorithm and key type.
2357
+
* ``context`` is not a valid input value for the algorithm and key type.
2358
+
.. retval:: PSA_ERROR_NOT_SUPPORTED
2359
+
The context value is not supported by this implementation.
2360
+
.. retval:: PSA_ERROR_INSUFFICIENT_MEMORY
2361
+
.. retval:: PSA_ERROR_COMMUNICATION_FAILURE
2362
+
.. retval:: PSA_ERROR_CORRUPTION_DETECTED
2363
+
2364
+
This function sets the context value in a multi-part sign operation.
2365
+
2366
+
The application must call `psa_sign_setup()` before calling this function.
2367
+
For a signature algorithm with a context parameter, this function is called immediately after `psa_sign_setup()`, before calling any other function on the sign operation.
2368
+
2369
+
If a context parameter is not required or not supported by the algorithm, either call `psa_sign_set_context()` with a zero-length context, or do not call this function.
2370
+
The macro `PSA_ALG_SIGN_SUPPORTS_CONTEXT()` can be used to determine if a signature algorithm supports non-zero-length context values.
2371
+
2372
+
If this function returns an error status, the operation enters an error state and must be aborted by calling `psa_sign_abort()`.
* The operation state is not valid: it must be inactive.
2555
2583
* The library requires initializing by a call to `psa_crypto_init()`.
2556
2584
2557
-
If a context parameter is not required or not supported by the algorithm, a zero-length context must be provided.
2558
-
2559
-
The sequence of operations to verify a message signature is as follows:
2585
+
The sequence of operations to verify a message signature using a multi-part sign operation is as follows:
2560
2586
2561
2587
1. Allocate a verify operation object which will be passed to all the functions listed here.
2562
2588
#. Initialize the operation object with one of the methods described in the documentation for `psa_verify_operation_t`, for example `PSA_VERIFY_OPERATION_INIT`.
2563
-
#. Call `psa_verify_setup()` to specify the key-pair, algorithm, context value, and signature to verify.
2589
+
#. Call `psa_verify_setup()` to specify the key, algorithm, and signature to verify.
2590
+
#. Optionally, call `psa_verify_set_context()` to provide a context.
2564
2591
#. Call `psa_verify_update()` zero, one or more times, passing a fragment of the message each time.
2565
-
The signature tis verified against the concatenation of these messages in order.
2592
+
The signature is verified against the concatenation of these messages in order.
2566
2593
#. To determine the validity of the signature, call `psa_verify_finish()`.
2567
2594
2568
2595
After a successful call to `psa_verify_setup()`, the operation is active, and the application must eventually terminate the operation.
Provide a context for a multi-part verify operation.
2612
+
2613
+
.. versionadded:: 1.5
2614
+
2615
+
.. param:: psa_verify_operation_t * operation
2616
+
Active verify operation.
2617
+
.. param:: const uint8_t * context
2618
+
Buffer containing the context value.
2619
+
.. param:: size_t context_length
2620
+
Size of the ``context`` buffer in bytes.
2621
+
2622
+
.. return:: psa_status_t
2623
+
.. retval:: PSA_SUCCESS
2624
+
Success.
2625
+
.. retval:: PSA_ERROR_BAD_STATE
2626
+
The following conditions can result in this error:
2627
+
2628
+
* The operation state is not valid: it must be active, and no call to `psa_verify_set_context()` or `psa_verify_update()` has been made.
2629
+
* The library requires initializing by a call to `psa_crypto_init()`.
2630
+
.. retval:: PSA_ERROR_INVALID_ARGUMENT
2631
+
The following conditions can result in this error:
2632
+
2633
+
* ``context_length`` is not valid for the algorithm and key type.
2634
+
* ``context`` is not a valid input value for the algorithm and key type.
2635
+
.. retval:: PSA_ERROR_NOT_SUPPORTED
2636
+
The context value is not supported by this implementation.
2637
+
.. retval:: PSA_ERROR_INSUFFICIENT_MEMORY
2638
+
.. retval:: PSA_ERROR_COMMUNICATION_FAILURE
2639
+
.. retval:: PSA_ERROR_CORRUPTION_DETECTED
2640
+
2641
+
This function sets the context value in a multi-part verify operation.
2642
+
2643
+
The application must call `psa_verify_setup()` before calling this function.
2644
+
For a signature algorithm with a context parameter, this function is called immediately after `psa_verify_setup()`, before calling any other function on the verify operation.
2645
+
2646
+
If a context parameter is not required or not supported by the algorithm, either call `psa_verify_set_context()` with a zero-length context, or do not call this function.
2647
+
The macro `PSA_ALG_SIGN_SUPPORTS_CONTEXT()` can be used to determine if a signature algorithm supports non-zero-length context values.
2648
+
2649
+
If this function returns an error status, the operation enters an error state and must be aborted by calling `psa_verify_abort()`.
0 commit comments