LIFE_CYCLE-DIGEST(7SSL)
β¨ NAME β¨
life_cycle-digest β it's the digest algorithm life-cycle π¦ (section 7SSL, OpenSSL manual, you're in the right place bestie)
πΈ DESCRIPTION πΈ
Okay so listen. Every single message digest β MD, for short, we're on nickname basis β goes through a whole arc. A journey. Several stages, in order, no skipping. Here's the entire glow-up timeline:
startβ this is the MD before it has been allocated. It's the starting state for any life-cycle transitions. Literally "not yet born but already iconic" energy β¨newedβ the MD after it has been allocated. It exists now!! πinitialisedβ the MD is set up and fully capable of processing input. Slay. πupdatedβ the MD is set up and capable of processing additional input, or generating output. Multitasking queen, we love to see it πfinaledβ the MD has generated output. And for an XOF digest? This state means it has generated a single-shot output. π«Άsqueezedβ XOF digests only, bestie: the MD has generated output, and you can call it multiple times to generate more output. The output length is variable for each call. Endless content machine πfreedβ the MD has been freed. This is the terminal state for all life-cycle transitions. RIP girl, you ate πβ¨
π State Transition Diagram π
Here's the usual life-cycle of an MD, all drawn out π¦ Ngl the ASCII art renders a little scrambled in this format π but every line is load-bearing so I'm giving it to you exactly as it comes, no edits, no thoughts:
+--------------------+
| 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. Like, this is the canonical list β the receipts, the source of truth, periodt:
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 β
At some point the EVP layer will begin enforcing the transitions described herein. So likeβ¦ be normal about it π It's coming, and it's not a drill.
π₯ 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>.
and that's the whole page bestie, mwah π this lil masterpiece rode in on OpenSSL 4.0.3, dated 2026-09-29, filed under LIFE_CYCLE-DIGEST(7SSL) π«Ά go forth and respect the state machine β¨
π¦ where this page comes from
- ubuntu stonking: openssl 4.0.3-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms