DSA_SIGN(3)
π DSA_SIGN(3) β the DSA signatures glow-up π
ok so bestie, you're reading the Library Functions Manual page for DSA_sign, DSA_sign_setup, and DSA_verify β three little functions that do that whole digital-signature thing for DSA. let's get into it π«Ά
β¨ NAME β¨
DSA_sign, DSA_sign_setup, DSA_verify β DSA signatures, literally the whole point of this page π
πΈ SYNOPSIS πΈ
library βlibcryptoβ #include <openssl/dsa.h>
int
DSA_sign(int type, const unsigned char *dgst, int len,
unsigned char *sigret, unsigned int *siglen, DSA *dsa);
int
DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp);
int
DSA_verify(int type, const unsigned char *dgst, int len,
unsigned char *sigbuf, int siglen, DSA *dsa);
like, copy it exactly, no typos, it's giving header-file supremacy π
π DESCRIPTION π
π¦ DSA_sign() β the main character π¦
so DSA_sign() computes a digital signature on the len byte message digest dgst using the private key dsa, and it places its ASN.1 DER encoding at sigret. length of the signature goes in *siglen. and here's the β¨iconicβ¨ little detail: sigret must point to DSA_size(dsa) bytes of memory. no skipping that, it's non-negotiable π«Ά
π§ DSA_sign_setup() β pregame era π§
DSA_sign_setup() may be used to precompute part of the signing operation in case signature generation is time-critical. like, bestie is in a rush, we get it β±οΈ
it expects dsa to contain DSA parameters. it places the precomputed values in newly allocated BIGNUMs at *kinvp and *rp, after freeing the old ones β unless kinvp and rp are NULL. π these values may be passed to DSA_sign() in dsa->kinv and dsa->r. and ctx is a pre-allocated BN_CTX or NULL.
π DSA_verify() β the vibe check π
DSA_verify() verifies that the signature sigbuf of size siglen matches a given message digest dgst of size len. dsa is the signer's public key. it's checking IDs at the door, periodt π₯
and the type parameter? ignored. not even invited to the party. π
β RETURN VALUES β
DSA_sign()andDSA_sign_setup()β return1on success or0on error πDSA_verify()β returns1for a valid signature π,0for an incorrect signature π, and-1on error π
the error codes can be obtained by ERR_get_error(3) β go read that one if you need the tea β
π SEE ALSO π
iykyk, go click through them π
π STANDARDS π
US Federal Information Processing Standard FIPS 186 (Digital Signature Standard, DSS), ANSI X9.30. very official, very federal, very slay ποΈ
π« HISTORY π«
DSA_sign() and DSA_verify() first appeared in SSLeay 0.6.0. DSA_sign_setup() first appeared in SSLeay 0.8.0. all these functions have been available since OpenBSD 2.4. elders of the group chat fr fr π§β¨
ok that's the whole page, you ate that π
Debian π June 8, 2025 π that's the version and the date, mwah, bye bestie π«Ά
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2000 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms