Skip to content
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

Update sig_stfl.h document for #1650 #1655

Merged
merged 8 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/sig_stfl/sig_stfl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1370,24 +1370,35 @@ OQS_API void OQS_SIG_STFL_SECRET_KEY_SET_mutex(OQS_SIG_STFL_SECRET_KEY *sk, void
}

/* OQS_SIG_STFL_SECRET_KEY_lock */
OQS_API OQS_STATUS OQS_SIG_STFL_SECRET_KEY_lock(OQS_SIG_STFL_SECRET_KEY *sk) {
OQS_STATUS OQS_SIG_STFL_SECRET_KEY_lock(OQS_SIG_STFL_SECRET_KEY *sk) {
if (sk == NULL) {
return OQS_ERROR;
}
if (sk->lock_key == NULL) {
return OQS_SUCCESS;
}

// Try to lock the private key but the mutex is unset.
if (sk->mutex == NULL) {
return OQS_ERROR;
}

return (sk->lock_key(sk->mutex));
}

/* OQS_SIG_STFL_SECRET_KEY_unlock */
OQS_API OQS_STATUS OQS_SIG_STFL_SECRET_KEY_unlock(OQS_SIG_STFL_SECRET_KEY *sk) {
OQS_STATUS OQS_SIG_STFL_SECRET_KEY_unlock(OQS_SIG_STFL_SECRET_KEY *sk) {
if (sk == NULL) {
return OQS_ERROR;
}
if (sk->unlock_key == NULL) {
return OQS_SUCCESS;
}

// Try to unlock the private key but the mutex is unset.
if (sk->mutex == NULL) {
return OQS_ERROR;
}

return (sk->unlock_key(sk->mutex));
}
Loading
Loading