1LIFE_CYCLE-RAND(7ossl) OpenSSL LIFE_CYCLE-RAND(7ossl)
2
3
4
6 life_cycle-rand - The RAND algorithm life-cycle
7
9 All random number generator (RANDs) go through a number of stages in
10 their life-cycle:
11
12 start
13 This state represents the RAND before it has been allocated. It is
14 the starting state for any life-cycle transitions.
15
16 newed
17 This state represents the RAND after it has been allocated but
18 unable to generate any output.
19
20 instantiated
21 This state represents the RAND when it is set up and capable of
22 generating output.
23
24 uninstantiated
25 This state represents the RAND when it has been shutdown and it is
26 no longer capable of generating output.
27
28 freed
29 This state is entered when the RAND is freed. It is the terminal
30 state for all life-cycle transitions.
31
32 State Transition Diagram
33 The usual life-cycle of a RAND is illustrated:
34 +-------------------------+
35 | start |
36 +-------------------------+
37 |
38 | EVP_RAND_CTX_new
39 v
40 +-------------------------+
41 | newed |
42 +-------------------------+
43 |
44 | EVP_RAND_instantiate
45 v
46 EVP_RAND_generate +-------------------------+
47 +-------------------- | |
48 | | instantiated |
49 +-------------------> | | <+
50 +-------------------------+ '
51 | '
52 | EVP_RAND_uninstantiate '
53 EVP_RAND_instantiate
54 v '
55 +-------------------------+ '
56 | uninstantiated | -+
57 +-------------------------+
58 |
59 | EVP_RAND_CTX_free
60 v
61 +-------------------------+
62 | freed |
63 +-------------------------+
64
65 Formal State Transitions
66 This section defines all of the legal state transitions. This is the
67 canonical list.
68 Function Call ------------------ Current State
69 ------------------
70 start newed instantiated
71 uninstantiated freed
72 EVP_RAND_CTX_new newed
73 EVP_RAND_instantiate instantiated
74 EVP_RAND_generate instantiated
75 EVP_RAND_uninstantiate uninstantiated
76 EVP_RAND_CTX_free freed freed freed freed
77 EVP_RAND_CTX_get_params newed instantiated
78 uninstantiated freed
79 EVP_RAND_CTX_set_params newed instantiated
80 uninstantiated freed
81 EVP_RAND_CTX_gettable_params newed instantiated
82 uninstantiated freed
83 EVP_RAND_CTX_settable_params newed instantiated
84 uninstantiated freed
85
87 At some point the EVP layer will begin enforcing the transitions
88 described herein.
89
91 provider-rand(7), EVP_RAND(3).
92
94 The provider RAND interface was introduced in OpenSSL 3.0.
95
97 Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
98
99 Licensed under the Apache License 2.0 (the "License"). You may not use
100 this file except in compliance with the License. You can obtain a copy
101 in the file LICENSE in the source distribution or at
102 <https://www.openssl.org/source/license.html>.
103
104
105
1063.0.9 2023-07-27 LIFE_CYCLE-RAND(7ossl)