Codebase list openssl / 0396401
ECDSA_SIG: add simple getters for commonly used struct members Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6290) Dr. Matthias St. Pierre 5 years ago
4 changed file(s) with 36 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
11821182 *ps = sig->s;
11831183 }
11841184
1185 const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig)
1186 {
1187 return sig->r;
1188 }
1189
1190 const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig)
1191 {
1192 return sig->s;
1193 }
1194
11851195 int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
11861196 {
11871197 if (r == NULL || s == NULL)
11
22 =head1 NAME
33
4 ECDSA_SIG_get0, ECDSA_SIG_set0,
4 ECDSA_SIG_get0, ECDSA_SIG_get0_r, ECDSA_SIG_get0_s, ECDSA_SIG_set0,
55 ECDSA_SIG_new, ECDSA_SIG_free, i2d_ECDSA_SIG, d2i_ECDSA_SIG, ECDSA_size,
66 ECDSA_sign, ECDSA_do_sign, ECDSA_verify, ECDSA_do_verify, ECDSA_sign_setup,
77 ECDSA_sign_ex, ECDSA_do_sign_ex - low level elliptic curve digital signature
1414 ECDSA_SIG *ECDSA_SIG_new(void);
1515 void ECDSA_SIG_free(ECDSA_SIG *sig);
1616 void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
17 const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
18 const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
1719 int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
1820 int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
1921 ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
5254 ECDSA_SIG_free() frees the B<ECDSA_SIG> structure B<sig>.
5355
5456 ECDSA_SIG_get0() returns internal pointers the B<r> and B<s> values contained
55 in B<sig>.
57 in B<sig> and stores them in B<*pr> and B<*ps>, respectively.
58 The pointer B<pr> or B<ps> can be NULL, in which case the corresponding value
59 is not returned.
60
61 The values B<r>, B<s> can also be retrieved separately by the corresponding
62 function ECDSA_SIG_get0_r() and ECDSA_SIG_get0_s(), respectively.
5663
5764 The B<r> and B<s> values can be set by calling ECDSA_SIG_set0() and passing the
5865 new values for B<r> and B<s> as parameters to the function. Calling this
115122
116123 ECDSA_SIG_set0() returns 1 on success or 0 on failure.
117124
125 ECDSA_SIG_get0_r() and ECDSA_SIG_get0_s() return the corresponding value,
126 or NULL if it is unset.
127
118128 ECDSA_size() returns the maximum length signature or 0 on error.
119129
120130 ECDSA_sign(), ECDSA_sign_ex() and ECDSA_sign_setup() return 1 if successful
10591059 ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
10601060
10611061 /** Accessor for r and s fields of ECDSA_SIG
1062 * \param sig pointer to ECDSA_SIG pointer
1062 * \param sig pointer to ECDSA_SIG structure
10631063 * \param pr pointer to BIGNUM pointer for r (may be NULL)
10641064 * \param ps pointer to BIGNUM pointer for s (may be NULL)
10651065 */
10661066 void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
10671067
1068 /** Accessor for r field of ECDSA_SIG
1069 * \param sig pointer to ECDSA_SIG structure
1070 */
1071 const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
1072
1073 /** Accessor for s field of ECDSA_SIG
1074 * \param sig pointer to ECDSA_SIG structure
1075 */
1076 const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
1077
10681078 /** Setter for r and s fields of ECDSA_SIG
1069 * \param sig pointer to ECDSA_SIG pointer
1070 * \param r pointer to BIGNUM for r (may be NULL)
1071 * \param s pointer to BIGNUM for s (may be NULL)
1079 * \param sig pointer to ECDSA_SIG structure
10721080 */
10731081 int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
10741082
45454545 RSA_get0_q 4488 1_1_1 EXIST::FUNCTION:RSA
45464546 RSA_get0_p 4489 1_1_1 EXIST::FUNCTION:RSA
45474547 RSA_get0_iqmp 4490 1_1_1 EXIST::FUNCTION:RSA
4548 ECDSA_SIG_get0_r 4491 1_1_1 EXIST::FUNCTION:EC
4549 ECDSA_SIG_get0_s 4492 1_1_1 EXIST::FUNCTION:EC