LIFE_CYCLE-RAND(7ossl)
π LIFE_CYCLE-RAND(7ossl) β the RAND algorithm life-cycle, explained
okay so this is the OpenSSL manual page LIFE_CYCLE-RAND(7ossl), and it's literally just the whole glow-up journey of a random number generator (a RAND). birth, era, shutdown, the whole arc. sit down bestie, this one's short but iconic π
β¨ NAME β¨
life_cycle-rand β the RAND algorithm life-cycle. that's it. that's the name.
πΈ DESCRIPTION πΈ
so every single random number generator (RAND) goes through a series of stages in its life. like a coming-of-age movie but with entropy. here's the cast π
startβ this is the RAND before it has been allocated. the pre-fame era. it's the starting state for any life-cycle transitions.newedβ this is the RAND after it has been allocated but it's still unable to generate any output. it exists!! it's just not serving yet πinstantiatedβ this is the RAND when it's set up and capable of generating output. main character energy, fully booked, actually producing πuninstantiatedβ this is the RAND when it has been shutdown and it is no longer capable of generating output. the hiatus era.freedβ this is the state it enters when the RAND is freed. it is the terminal state for all life-cycle transitions. rest in peace queen πͺ¦
π¦ State Transition Diagram
the usual life-cycle of a RAND is illustrated like this, and no I did not hand-draw it myself, it's canon:
+-------------------------+
| start |
+-------------------------+
|
| EVP_RAND_CTX_new
v
+-------------------------+
| newed |
+-------------------------+
|
| EVP_RAND_instantiate
v
EVP_RAND_generate +-------------------------+
+-------------------- | |
| | instantiated |
+-------------------> | | <+
+-------------------------+ '
| '
| EVP_RAND_uninstantiate '
EVP_RAND_instantiate
v '
+-------------------------+ '
| uninstantiated | -+
+-------------------------+
|
| EVP_RAND_CTX_free
v
+-------------------------+
| freed |
+-------------------------+
π Formal State Transitions
this section defines all of the legal state transitions. it's the canonical list. the receipt, if you will π§Ύ
EVP_RAND_CTX_newβ goes fromstartβnewedEVP_RAND_instantiateβ goes fromnewedβinstantiatedEVP_RAND_generateβ frominstantiatedβinstantiated(stays exactly where it is, no transition, just vibing)EVP_RAND_uninstantiateβ goes frominstantiatedβuninstantiatedEVP_RAND_CTX_freeβ takesstart,newed,instantiatedanduninstantiatedall βfreedEVP_RAND_CTX_get_paramsβ current state staysnewed,instantiated,uninstantiatedorfreedEVP_RAND_CTX_set_paramsβ current state staysnewed,instantiated,uninstantiatedorfreedEVP_RAND_CTX_gettable_paramsβ current state staysnewed,instantiated,uninstantiatedorfreedEVP_RAND_CTX_settable_paramsβ current state staysnewed,instantiated,uninstantiatedorfreed
(for the four *_params calls the next-state slot is empty in the table, bestie β nothing is moving, so nothing changes π
)
π«Ά NOTES π«Ά
at some point the EVP layer will begin enforcing the transitions described herein. so like, play by the rules now or get caught out later ngl.
π SEE ALSO π
β HISTORY β
the provider RAND interface was introduced in OpenSSL 3.0. a legend was born β¨
π COPYRIGHT π
Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
fr fr read the license before you touch anything. the legal girlies are watching π
okay that's the whole page bestie, you ate that π this was version 3.5.0, dated 2026-09-25, straight from the OpenSSL fam β mwah, go generate some randomness responsibly π§ββοΈπΈ
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms