Skip to content

Commit

Permalink
Document use of callback functions for secret key thread safe protect…
Browse files Browse the repository at this point in the history
…ion and storage.
  • Loading branch information
ashman-p committed Sep 28, 2023
1 parent 403cbf3 commit 8dfd330
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/sig_stfl/sig_stfl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@

#include <oqs/oqs.h>

/*
* Developer's Notes:
* Stateful signatures are based on one-time use of a secret key. A pool of secret keys are created for this purpose.
* The state of these keys are tracked to ensure that they are used only once to generate a signature.
*
* As such, product specific environments do play a role in ensuring the safety of the keys.
* Secret keys must be store securely.
* The key index/counter must be updated after each signature generation.
* Secret key must be protected in a thread-save manner.
*
* Application therefore are required to provide environment specific callback functions to
* - store private key
* - lock/unlock private key
*
* See below for details
* OQS_SIG_STFL_SECRET_KEY_SET_lock
* OQS_SIG_STFL_SECRET_KEY_SET_unlock
* OQS_SIG_STFL_SECRET_KEY_SET_mutex
* OQS_SIG_STFL_SECRET_KEY_SET_store_cb
*
*/


#if defined(__cplusplus)
extern "C" {
#endif
Expand Down Expand Up @@ -279,7 +302,7 @@ typedef struct OQS_SIG_STFL_SECRET_KEY {
* @return OQS_SUCCESS or OQS_ERROR
* Idealy written to secure device
*/
OQS_STATUS (*secure_store_scrt_key)(/*const*/ uint8_t *sk_buf, size_t buf_len, void *context);
OQS_STATUS (*secure_store_scrt_key)(uint8_t *sk_buf, size_t buf_len, void *context);

/**
* Secret Key free internal variant specific data
Expand Down

0 comments on commit 8dfd330

Please sign in to comment.