Deleted Added
full compact
ecdsa.3 (206048) ecdsa.3 (215698)
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37
1.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
2.\"
3.\" Standard preamble:
4.\" ========================================================================
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
5.de Sp \" Vertical space (when we can't use .PP)
6.if t .sp .5v
7.if n .sp
8..
9.de Vb \" Begin verbatim text
10.ft CW
11.nf
12.ne \\$1
13..
14.de Ve \" End verbatim text
15.ft R
16.fi
17..
18.\" Set up some character translations and predefined strings. \*(-- will
19.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
20.\" double quote, and \*(R" will give a right double quote. \*(C+ will
21.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23.\" nothing in troff, for use with C<>.
24.tr \(*W-
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
25.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26.ie n \{\
27. ds -- \(*W-
28. ds PI pi
29. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
31. ds L" ""
32. ds R" ""
33. ds C` ""
34. ds C' ""
35'br\}
36.el\{\
37. ds -- \|\(em\|
38. ds PI \(*p
39. ds L" ``
40. ds R" ''
41'br\}
42.\"
43.\" Escape single quotes in literal strings from groff's Unicode transform.
44.ie \n(.g .ds Aq \(aq
45.el .ds Aq '
46.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
47.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
48.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
49.\" entries marked with X<> in POD. Of course, you'll have to process the
50.\" output yourself in some meaningful fashion.
55.if \nF \{\
51.ie \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
52. de IX
53. tm Index:\\$1\t\\n%\t"\\$2"
54..
55. nr % 0
56. rr F
57.\}
58.el \{\
59. de IX
60..
61.\}
62.\"
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1

--- 48 unchanged lines hidden (view full) ---

124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "ecdsa 3"
63.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64.\" Fear. Run. Save yourself. No user-serviceable parts.
65. \" fudge factors for nroff and troff
66.if n \{\
67. ds #H 0
68. ds #V .8m
69. ds #F .3m
70. ds #[ \f1

--- 48 unchanged lines hidden (view full) ---

119. ds Th \o'LP'
120. ds ae ae
121. ds Ae AE
122.\}
123.rm #[ #] #H #V #F C
124.\" ========================================================================
125.\"
126.IX Title "ecdsa 3"
132.TH ecdsa 3 "2010-03-24" "0.9.8n" "OpenSSL"
127.TH ecdsa 3 "2010-11-16" "0.9.8p" "OpenSSL"
128.\" For nroff, turn off justification. Always turn off hyphenation; it makes
129.\" way too many mistakes in technical documents.
130.if n .ad l
131.nh
133.SH "NAME"
134ecdsa \- Elliptic Curve Digital Signature Algorithm
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137.Vb 1
138\& #include <openssl/ecdsa.h>
132.SH "NAME"
133ecdsa \- Elliptic Curve Digital Signature Algorithm
134.SH "SYNOPSIS"
135.IX Header "SYNOPSIS"
136.Vb 1
137\& #include <openssl/ecdsa.h>
139.Ve
140.PP
141.Vb 5
138\&
142\& ECDSA_SIG* ECDSA_SIG_new(void);
143\& void ECDSA_SIG_free(ECDSA_SIG *sig);
144\& int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
145\& ECDSA_SIG* d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp,
146\& long len);
139\& ECDSA_SIG* ECDSA_SIG_new(void);
140\& void ECDSA_SIG_free(ECDSA_SIG *sig);
141\& int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
142\& ECDSA_SIG* d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp,
143\& long len);
147.Ve
148.PP
149.Vb 20
144\&
150\& ECDSA_SIG* ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
151\& EC_KEY *eckey);
152\& ECDSA_SIG* ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,
153\& const BIGNUM *kinv, const BIGNUM *rp,
154\& EC_KEY *eckey);
155\& int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
156\& const ECDSA_SIG *sig, EC_KEY* eckey);
157\& int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx,

--- 4 unchanged lines hidden (view full) ---

162\& int ECDSA_sign_ex(int type, const unsigned char *dgst,
163\& int dgstlen, unsigned char *sig,
164\& unsigned int *siglen, const BIGNUM *kinv,
165\& const BIGNUM *rp, EC_KEY *eckey);
166\& int ECDSA_verify(int type, const unsigned char *dgst,
167\& int dgstlen, const unsigned char *sig,
168\& int siglen, EC_KEY *eckey);
169\& int ECDSA_size(const EC_KEY *eckey);
145\& ECDSA_SIG* ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
146\& EC_KEY *eckey);
147\& ECDSA_SIG* ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,
148\& const BIGNUM *kinv, const BIGNUM *rp,
149\& EC_KEY *eckey);
150\& int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
151\& const ECDSA_SIG *sig, EC_KEY* eckey);
152\& int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx,

--- 4 unchanged lines hidden (view full) ---

157\& int ECDSA_sign_ex(int type, const unsigned char *dgst,
158\& int dgstlen, unsigned char *sig,
159\& unsigned int *siglen, const BIGNUM *kinv,
160\& const BIGNUM *rp, EC_KEY *eckey);
161\& int ECDSA_verify(int type, const unsigned char *dgst,
162\& int dgstlen, const unsigned char *sig,
163\& int siglen, EC_KEY *eckey);
164\& int ECDSA_size(const EC_KEY *eckey);
170.Ve
171.PP
172.Vb 4
165\&
173\& const ECDSA_METHOD* ECDSA_OpenSSL(void);
174\& void ECDSA_set_default_method(const ECDSA_METHOD *meth);
175\& const ECDSA_METHOD* ECDSA_get_default_method(void);
176\& int ECDSA_set_method(EC_KEY *eckey,const ECDSA_METHOD *meth);
166\& const ECDSA_METHOD* ECDSA_OpenSSL(void);
167\& void ECDSA_set_default_method(const ECDSA_METHOD *meth);
168\& const ECDSA_METHOD* ECDSA_get_default_method(void);
169\& int ECDSA_set_method(EC_KEY *eckey,const ECDSA_METHOD *meth);
177.Ve
178.PP
179.Vb 6
170\&
180\& int ECDSA_get_ex_new_index(long argl, void *argp,
181\& CRYPTO_EX_new *new_func,
182\& CRYPTO_EX_dup *dup_func,
183\& CRYPTO_EX_free *free_func);
184\& int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);
185\& void* ECDSA_get_ex_data(EC_KEY *d, int idx);
186.Ve
187.SH "DESCRIPTION"

--- 73 unchanged lines hidden (view full) ---

261.SH "EXAMPLES"
262.IX Header "EXAMPLES"
263Creating a \s-1ECDSA\s0 signature of given \s-1SHA\-1\s0 hash value using the
264named curve secp192k1.
265.PP
266First step: create a \s-1EC_KEY\s0 object (note: this part is \fBnot\fR \s-1ECDSA\s0
267specific)
268.PP
171\& int ECDSA_get_ex_new_index(long argl, void *argp,
172\& CRYPTO_EX_new *new_func,
173\& CRYPTO_EX_dup *dup_func,
174\& CRYPTO_EX_free *free_func);
175\& int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);
176\& void* ECDSA_get_ex_data(EC_KEY *d, int idx);
177.Ve
178.SH "DESCRIPTION"

--- 73 unchanged lines hidden (view full) ---

252.SH "EXAMPLES"
253.IX Header "EXAMPLES"
254Creating a \s-1ECDSA\s0 signature of given \s-1SHA\-1\s0 hash value using the
255named curve secp192k1.
256.PP
257First step: create a \s-1EC_KEY\s0 object (note: this part is \fBnot\fR \s-1ECDSA\s0
258specific)
259.PP
269.Vb 16
260.Vb 10
270\& int ret;
271\& ECDSA_SIG *sig;
272\& EC_KEY *eckey = EC_KEY_new();
273\& if (eckey == NULL)
274\& {
275\& /* error */
276\& }
261\& int ret;
262\& ECDSA_SIG *sig;
263\& EC_KEY *eckey = EC_KEY_new();
264\& if (eckey == NULL)
265\& {
266\& /* error */
267\& }
277\& key->group = EC_GROUP_new_by_nid(NID_secp192k1);
278\& if (key->group == NULL)
268\& key\->group = EC_GROUP_new_by_nid(NID_secp192k1);
269\& if (key\->group == NULL)
279\& {
280\& /* error */
281\& }
282\& if (!EC_KEY_generate_key(eckey))
283\& {
284\& /* error */
285\& }
286.Ve
287.PP
288Second step: compute the \s-1ECDSA\s0 signature of a \s-1SHA\-1\s0 hash value
270\& {
271\& /* error */
272\& }
273\& if (!EC_KEY_generate_key(eckey))
274\& {
275\& /* error */
276\& }
277.Ve
278.PP
279Second step: compute the \s-1ECDSA\s0 signature of a \s-1SHA\-1\s0 hash value
289using \fBECDSA_do_sign\fR
280using \fBECDSA_do_sign\fR
290.PP
291.Vb 5
292\& sig = ECDSA_do_sign(digest, 20, eckey);
293\& if (sig == NULL)
294\& {
295\& /* error */
296\& }
297.Ve

--- 22 unchanged lines hidden (view full) ---

320.PP
321.Vb 1
322\& ret = ECDSA_verify(0, digest, 20, buffer, buf_len, eckey);
323.Ve
324.PP
325and finally evaluate the return value:
326.PP
327.Vb 12
281.PP
282.Vb 5
283\& sig = ECDSA_do_sign(digest, 20, eckey);
284\& if (sig == NULL)
285\& {
286\& /* error */
287\& }
288.Ve

--- 22 unchanged lines hidden (view full) ---

311.PP
312.Vb 1
313\& ret = ECDSA_verify(0, digest, 20, buffer, buf_len, eckey);
314.Ve
315.PP
316and finally evaluate the return value:
317.PP
318.Vb 12
328\& if (ret == -1)
319\& if (ret == \-1)
329\& {
330\& /* error */
331\& }
332\& else if (ret == 0)
333\& {
334\& /* incorrect signature */
335\& }
336\& else /* ret == 1 */

--- 17 unchanged lines hidden ---
320\& {
321\& /* error */
322\& }
323\& else if (ret == 0)
324\& {
325\& /* incorrect signature */
326\& }
327\& else /* ret == 1 */

--- 17 unchanged lines hidden ---