DSA_sign(3) OpenSSL DSA_sign(3) NNAAMMEE DSA_sign, DSA_sign_setup, DSA_verify - DSA signatures SSYYNNOOPPSSIISS #include 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); DDEESSCCRRIIPPTTIIOONN _D_S_A___s_i_g_n_(_) computes a digital signature on the lleenn byte message digest ddggsstt using the private key ddssaa and places its ASN.1 DER encoding at ssiiggrreett. The length of the signature is places in *ssiigglleenn. ssiiggrreett must point to DSA_size(ddssaa) bytes of memory. _D_S_A___s_i_g_n___s_e_t_u_p_(_) may be used to precompute part of the signing opera- tion in case signature generation is time-critical. It expects ddssaa to contain DSA parameters. It places the precomputed values in newly allo- cated BBIIGGNNUUMMs at *kkiinnvvpp and *rrpp, after freeing the old ones unless *kkiinnvvpp and *rrpp are NULL. These values may be passed to _D_S_A___s_i_g_n_(_) in ddssaa-->>kkiinnvv and ddssaa-->>rr. ccttxx is a pre-allocated BBNN__CCTTXX or NULL. _D_S_A___v_e_r_i_f_y_(_) verifies that the signature ssiiggbbuuff of size ssiigglleenn matches a given message digest ddggsstt of size lleenn. ddssaa is the signer's public key. The ttyyppee parameter is ignored. The PRNG must be seeded before _D_S_A___s_i_g_n_(_) (or _D_S_A___s_i_g_n___s_e_t_u_p_(_)) is called. RREETTUURRNN VVAALLUUEESS _D_S_A___s_i_g_n_(_) and _D_S_A___s_i_g_n___s_e_t_u_p_(_) return 1 on success, 0 on error. _D_S_A___v_e_r_i_f_y_(_) returns 1 for a valid signature, 0 for an incorrect signa- ture and -1 on error. The error codes can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3). CCOONNFFOORRMMIINNGG TTOO US Federal Information Processing Standard FIPS 186 (Digital Signature Standard, DSS), ANSI X9.30 SSEEEE AALLSSOO _d_s_a(3), _E_R_R___g_e_t___e_r_r_o_r(3), _r_a_n_d(3), _D_S_A___d_o___s_i_g_n(3) HHIISSTTOORRYY _D_S_A___s_i_g_n_(_) and _D_S_A___v_e_r_i_f_y_(_) are available in all versions of SSLeay. _D_S_A___s_i_g_n___s_e_t_u_p_(_) was added in SSLeay 0.8. 1.0.1u 2016-09-22 DSA_sign(3)