-.\" $OpenBSD: EVP_DigestSignInit.3,v 1.7 2019/06/10 14:58:48 schwarze Exp $
+.\" $OpenBSD: EVP_DigestSignInit.3,v 1.8 2021/05/11 15:14:56 tb Exp $
.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 10 2019 $
+.Dd $Mdocdate: May 11 2021 $
.Dt EVP_DIGESTSIGNINIT 3
.Os
.Sh NAME
.Nm EVP_DigestSignInit ,
.Nm EVP_DigestSignUpdate ,
-.Nm EVP_DigestSignFinal
+.Nm EVP_DigestSignFinal ,
+.Nm EVP_DigestSign
.Nd EVP signing functions
.Sh SYNOPSIS
.In openssl/evp.h
.Fa "unsigned char *sig"
.Fa "size_t *siglen"
.Fc
+.Ft int
+.Fo EVP_DigestSign
+.Fa "EVP_MD_CTX *ctx"
+.Fa "unsigned char *sigret"
+.Fa "size_t *siglen"
+.Fa "const unsigned char *tbs"
+.Fa "size_t tbslen"
+.Fc
.Sh DESCRIPTION
The EVP signature routines are a high level interface to digital
signatures.
and the amount of data written to
.Fa siglen .
.Pp
+.Fn EVP_DigestSign
+signs
+.Fa tbslen
+bytes of data at
+.Fa tbs
+and places the signature in
+.Fa sigret
+and its length in
+.Fa siglen
+in a similar way to
+.Fn EVP_DigestSignFinal .
+.Fn EVP_DigestSign
+is a one shot operation which signs a single block of data
+with one function call.
+For algorithms that support streaming it is equivalent to calling
+.Fn EVP_DigestSignUpdate
+and
+.Fn EVP_DigestSignFinal .
+.\" For algorithms which do not support streaming
+.\" (e.g. PureEdDSA)
+.\" it is the only way to sign data.
+.Pp
The EVP interface to digital signatures should almost always be
used in preference to the low level interfaces.
This is because the code then becomes transparent to the algorithm used
.Sh RETURN VALUES
.Fn EVP_DigestSignInit ,
.Fn EVP_DigestSignUpdate ,
+.Fn EVP_DigestSignFinal ,
and
-.Fn EVP_DigestSignFinal
+.Fn EVP_DigestSign
return 1 for success and 0 or a negative value for failure.
In particular, a return value of -2 indicates the operation is not
supported by the public key algorithm.
.Fn EVP_DigestSignFinal
first appeared in OpenSSL 1.0.0 and have been available since
.Ox 4.9 .
+.Fn EVP_DigestSign
+first appeared in OpenSSL 1.1.1 and has been available since
+.Ox 7.0 .