summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc/DH_set_method.pod
diff options
context:
space:
mode:
authorschwarze <>2016-11-02 09:11:53 +0000
committerschwarze <>2016-11-02 09:11:53 +0000
commitb50ac7faef96a45291b0c3201b82185f7579e826 (patch)
tree9166b196a2c833fc7a0154973d11551824a6bfb9 /src/lib/libcrypto/doc/DH_set_method.pod
parent506350d1237710b9d86fdb3a794c6e6265f71221 (diff)
downloadopenbsd-b50ac7faef96a45291b0c3201b82185f7579e826.tar.gz
openbsd-b50ac7faef96a45291b0c3201b82185f7579e826.tar.bz2
openbsd-b50ac7faef96a45291b0c3201b82185f7579e826.zip
convert DES and DH manuals from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/doc/DH_set_method.pod')
-rw-r--r--src/lib/libcrypto/doc/DH_set_method.pod129
1 files changed, 0 insertions, 129 deletions
diff --git a/src/lib/libcrypto/doc/DH_set_method.pod b/src/lib/libcrypto/doc/DH_set_method.pod
deleted file mode 100644
index d82fe7377a..0000000000
--- a/src/lib/libcrypto/doc/DH_set_method.pod
+++ /dev/null
@@ -1,129 +0,0 @@
1=pod
2
3=head1 NAME
4
5DH_set_default_method, DH_get_default_method,
6DH_set_method, DH_new_method, DH_OpenSSL,
7DH_set_default_openssl_method, DH_get_default_openssl_method
8- select DH method
9
10=head1 SYNOPSIS
11
12 #include <openssl/dh.h>
13 #include <openssl/engine.h>
14
15 void DH_set_default_method(const DH_METHOD *meth);
16
17 const DH_METHOD *DH_get_default_method(void);
18
19 int DH_set_method(DH *dh, const DH_METHOD *meth);
20
21 DH *DH_new_method(ENGINE *engine);
22
23 const DH_METHOD *DH_OpenSSL(void);
24
25=head1 DESCRIPTION
26
27A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman
28operations. By modifying the method, alternative implementations
29such as hardware accelerators may be used. IMPORTANT: See the NOTES section for
30important information about how these DH API functions are affected by the use
31of B<ENGINE> API calls.
32
33Initially, the default DH_METHOD is the OpenSSL internal implementation, as
34returned by DH_OpenSSL().
35
36DH_set_default_method() makes B<meth> the default method for all DH
37structures created later. B<NB>: This is true only whilst no ENGINE has been set
38as a default for DH, so this function is no longer recommended.
39
40DH_get_default_method() returns a pointer to the current default DH_METHOD.
41However, the meaningfulness of this result is dependent on whether the ENGINE
42API is being used, so this function is no longer recommended.
43
44DH_set_method() selects B<meth> to perform all operations using the key B<dh>.
45This will replace the DH_METHOD used by the DH key and if the previous method
46was supplied by an ENGINE, the handle to that ENGINE will be released during the
47change. It is possible to have DH keys that only work with certain DH_METHOD
48implementations (eg. from an ENGINE module that supports embedded
49hardware-protected keys), and in such cases attempting to change the DH_METHOD
50for the key can have unexpected results.
51
52DH_new_method() allocates and initializes a DH structure so that B<engine> will
53be used for the DH operations. If B<engine> is NULL, the default ENGINE for DH
54operations is used, and if no default ENGINE is set, the DH_METHOD controlled by
55DH_set_default_method() is used.
56
57=head1 THE DH_METHOD STRUCTURE
58
59 typedef struct dh_meth_st
60 {
61 /* name of the implementation */
62 const char *name;
63
64 /* generate private and public DH values for key agreement */
65 int (*generate_key)(DH *dh);
66
67 /* compute shared secret */
68 int (*compute_key)(unsigned char *key, BIGNUM *pub_key, DH *dh);
69
70 /* compute r = a ^ p mod m (May be NULL for some implementations) */
71 int (*bn_mod_exp)(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
72 const BIGNUM *m, BN_CTX *ctx,
73 BN_MONT_CTX *m_ctx);
74
75 /* called at DH_new */
76 int (*init)(DH *dh);
77
78 /* called at DH_free */
79 int (*finish)(DH *dh);
80
81 int flags;
82
83 char *app_data; /* ?? */
84
85 } DH_METHOD;
86
87=head1 RETURN VALUES
88
89DH_OpenSSL() and DH_get_default_method() return pointers to the respective
90B<DH_METHOD>s.
91
92DH_set_method() returns non-zero if the provided B<meth> was successfully set as
93the method for B<dh> (including unloading the ENGINE handle if the previous
94method was supplied by an ENGINE).
95
96DH_new_method() returns NULL and sets an error code that can be obtained by
97L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it
98returns a pointer to the newly allocated structure.
99
100=head1 NOTES
101
102As of version 0.9.7, DH_METHOD implementations are grouped together with other
103algorithmic APIs (eg. RSA_METHOD, EVP_CIPHER, etc) in B<ENGINE> modules. If a
104default ENGINE is specified for DH functionality using an ENGINE API function,
105that will override any DH defaults set using the DH API (ie.
106DH_set_default_method()). For this reason, the ENGINE API is the recommended way
107to control default implementations for use in DH and other cryptographic
108algorithms.
109
110=head1 SEE ALSO
111
112L<dh(3)|dh(3)>, L<DH_new(3)|DH_new(3)>
113
114=head1 HISTORY
115
116DH_set_default_method(), DH_get_default_method(), DH_set_method(),
117DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4.
118
119DH_set_default_openssl_method() and DH_get_default_openssl_method() replaced
120DH_set_default_method() and DH_get_default_method() respectively, and
121DH_set_method() and DH_new_method() were altered to use B<ENGINE>s rather than
122B<DH_METHOD>s during development of the engine version of OpenSSL 0.9.6. For
1230.9.7, the handling of defaults in the ENGINE API was restructured so that this
124change was reversed, and behaviour of the other functions resembled more closely
125the previous behaviour. The behaviour of defaults in the ENGINE API now
126transparently overrides the behaviour of defaults in the DH API without
127requiring changing these function prototypes.
128
129=cut