LIFE_CYCLE-DIGEST(7ossl)
π NAME π
life_cycle-digest β the digest algorithm life-cycle. this is the OpenSSL manual page LIFE_CYCLE-DIGEST(7ossl), bestie, and we're about to get into the whole glow-up journey of a message digest π
β¨ DESCRIPTION β¨
okay so every message digest (MD) goes through a bunch of stages in its life-cycle. think of it as the digest's main character arc, and each stage is a state:
startβ the MD before it has been allocated. literally the starting state for any life-cycle transitions.newedβ the MD after it has been allocated.initialisedβ the MD when it is set up and capable of processing input.updatedβ the MD when it is set up and capable of processing additional input or generating output.finaledβ the MD when it has generated output. for an XOF digest, this state represents the MD when it has generated a single-shot output.squeezedβ for an XOF digest, the MD when it has generated output. it can be called multiple times to generate more output. the output length is variable for each call.freedβ entered when the MD is freed. it is the terminal state for all life-cycle transitions.
π¦ State Transition Diagram π¦
the usual life-cycle of a MD is illustrated like this. yes it's giving feral ASCII art, and yes I'm keeping it exactly as the page has it π
+--------------------+
| start |
+--------------------+
|
EVP_MD_CTX_reset
| EVP_MD_CTX_new
+-------------------------------------------------+
v v
|
EVP_MD_CTX_reset + - - - - - - - - - - - - - - - - - -
- - - - + EVP_MD_CTX_reset |
+-------------------> ' newed
' <--------------------+ |
| + - - - - - - - - - - - - - - - - - -
- - - - + | |
| |
| |
| | EVP_DigestInit
| |
| v
| |
| EVP_DigestInit + - - - - - - - - - - - - - - - - - -
- - - - + | |
+----+-------------------> ' initialised
' <+ EVP_DigestInit | |
| | + - - - - - - - - - - - - - - - - - -
- - - - + | | |
| | | ^
| | |
| | | EVP_DigestUpdate |
EVP_DigestInit | | |
| | v |
| | |
| |
+---------------------------------------------+ | |
|
| +-------------------- |
| | | |
| |
| | | |
| EVP_DigestUpdate |
| | | |
| +-------------------- |
| | | |
| | | updated
| | | |
| +-------------------> |
| | | |
| |
| | | |
| |
| | | |
+----+------------------------- |
| -+-------------------+----+ |
| |
+---------------------------------------------+ | |
| |
| | |
| | | |
| | | EVP_DigestSqueeze
+-------------------+ | | |
| | v |
| | |
| | EVP_DigestSqueeze
+---------------------------------------------+ |
| |
| | +-------------------- |
| | | |
| | | | squeezed
| | | |
| | +-------------------> |
| ---------------------+ | |
| |
+---------------------------------------------+
| |
| | |
| |
| |
+---------------------------------------+ | |
| |
| | |
| |
+---------------------------------------------+ EVP_DigestFinalXOF |
| |
| +------------------------- | finaled
| <--------------------+----+ |
|
+---------------------------------------------+ |
|
| EVP_DigestFinal ^ | |
| |
+---------------------------------+ | |
EVP_MD_CTX_free | |
| v
| |
|
+------------------+ EVP_MD_CTX_free | |
| |
freed | <--------------------+ |
|
+------------------+ |
|
|
+------------------------------------------------------+
π Formal State Transitions π
this section defines all of the legal state transitions. this is the canonical list. no cap, this table is the whole receipts situation:
Function Call --------------------- Current State
-----------------------------------
start newed initialised updated
finaled squeezed freed
EVP_MD_CTX_new newed
EVP_DigestInit initialised initialised initialised
initialised initialised
EVP_DigestUpdate updated updated
EVP_DigestFinal finaled
EVP_DigestFinalXOF finaled
EVP_DigestSqueeze squeezed
squeezed
EVP_MD_CTX_free freed freed freed freed
freed
EVP_MD_CTX_reset newed newed newed
newed
EVP_MD_CTX_get_params newed initialised updated
EVP_MD_CTX_set_params newed initialised updated
EVP_MD_CTX_gettable_params newed initialised updated
EVP_MD_CTX_settable_params newed initialised updated
EVP_MD_CTX_copy_ex newed initialised updated
squeezed
π¨ NOTES π¨
heads up bestie: at some point the EVP layer will begin enforcing the transitions described herein. so don't be out here free-styling your state changes like it's not gonna matter π
πΈ SEE ALSO πΈ
π COPYRIGHT π
Copyright 2021-2023 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>.
later bestie! this page is from OpenSSL version 3.5.9, dated 2026-09-29, and its manual name is LIFE_CYCLE-DIGEST(7ossl) π«Άπ
π¦ where this page comes from
- alpine 3.23: openssl-doc 3.5.9-r0 Β· Apache-2.0
- alpine 3.24: openssl-doc 3.5.9-r0 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms