LIFE_CYCLE-MAC(7ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’… LIFE_CYCLE-MAC

bestie, welcome to LIFE_CYCLE-MAC(7ossl) β€” the glow-up timeline of every MAC out there πŸ’–

🌸 NAME

life_cycle-mac β€” the MAC algorithm life-cycle. yes it's a whole journey, and honestly? it's giving character development ✨


πŸ¦‹ DESCRIPTION

okay so every single message authentication code (MAC) goes through a bunch of stages in its life, like literal eras. here's the whole roster πŸ‘‘

  • start β€” this state is the MAC before it's been allocated. it's the starting state for any life-cycle transitions. the pre-fame era, if you will πŸŽ€
  • newed β€” this state is the MAC after it's been allocated. it exists now!! iconic πŸ¦‹
  • initialised β€” this state is the MAC when it's set up and capable of processing input. ready to slay πŸ’…
  • updated β€” this state is the MAC when it's set up and capable of processing additional input or generating output. the grind never stops πŸ”₯
  • finaled β€” this state is the MAC when it has generated output. it ate and left no crumbs ✨
  • freed β€” this state is entered when the MAC is freed. it's the terminal state for all life-cycle transitions. rest in peace queen πŸ‘‘πŸ’€

✨ State Transition Diagram

the usual life-cycle of a MAC is illustrated here, and ngl the diagram is kind of a work of art 🌈:

                    +-------------------+
                    |       start       |
                    +-------------------+
                      |
                      | EVP_MAC_CTX_new
                      v
                    +-------------------+
                    |       newed       |
                    +-------------------+
                      |
                      | EVP_MAC_init
                      v
                    +-------------------+
                 +> |    initialised    | <+
                 |  +-------------------+  |
                 |    |                    |
                 |    | EVP_MAC_update     | EVP_MAC_init
                 |    v                    |
    EVP_MAC_init |  +-------------------+  |
                 |  |      updated      | -+
                 |  +-------------------+
                 |    |               |
                 |    | EVP_MAC_final | EVP_MAC_finalXOF
                 |    v               v
                 |  +-------------------+
                 +- |      finaled      |
                    +-------------------+
                      |
                      | EVP_MAC_CTX_free
                      v
                    +-------------------+
                    |       freed       |
                    +-------------------+

like, look at those arrows go 🧚✨

πŸ“‹ Formal State Transitions

this section defines all of the legal state transitions. it's the canonical list β€” the receipts, the source of truth, periodt πŸ’―

 Function Call                   --------------------- Current State
-----------------------
                                 start   newed    initialised   updated
finaled   freed
 EVP_MAC_CTX_new                 newed
 EVP_MAC_init                         initialised initialised
initialised initialised
 EVP_MAC_update                                     updated     updated
 EVP_MAC_final                                                  finaled
 EVP_MAC_finalXOF                                               finaled
 EVP_MAC_CTX_free                freed   freed       freed       freed
freed
 EVP_MAC_CTX_get_params                  newed    initialised   updated
 EVP_MAC_CTX_set_params                  newed    initialised   updated
 EVP_MAC_CTX_gettable_params             newed    initialised   updated
 EVP_MAC_CTX_settable_params             newed    initialised   updated

πŸ™ˆ NOTES

so at some point the EVP layer will begin enforcing the transitions described herein. not a vibe check you can skip, bestie β€” it's coming 🫢

fr fr, don't count on the wild-west behaviour lasting forever.

πŸ” SEE ALSO

go read those too, iykyk πŸ’œ


⭐ HISTORY

the provider MAC interface was introduced in OpenSSL 3.0 πŸŽ‰ a historic moment, honestly.


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>.

no cap β€” read the license, it's not optional πŸ“

okay that's the whole page!! this was LIFE_CYCLE-MAC(7ossl) from OpenSSL 3.5.6, dated 2026-04-07 β€” mwah, go forth and manage your MAC life-cycles responsibly πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from