shishi_des_cbc_mac(3)

πŸ“¦
version 1.0.3 Β· 2 versions
  • 1.0.3 Β· debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.0.2 Β· ubuntu jammy
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ shishi_des_cbc_mac ✨

okay bestie, we're in the shishi manual, section 3 (that's the library-functions girlies πŸ’…), and today's main character is shishi_des_cbc_mac. it's an API function. yes, an actual API function. she's giving very much "I do one thing and I do it well." πŸŽ€


🌸 NAME 🌸

shishi_des_cbc_mac β€” it's an API function, periodt. that's the whole name, no notes. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

like, here's the vibe, literally copy-paste this:

#include <shishi.h>

int shishi_des_cbc_mac(Shishi * handle, const char key[8], const char
iv[8], const char * in, size_t inlen, char * out[8]);

okay so she takes a <pink>handle</pink>, a <purple>key</purple>, an <lavender>iv</lavender>, some <cyan>in</cyan> data, an <cyan>inlen</cyan>, and an <hotpink>out</hotpink> β€” and returns an int. simple. iconic. no cap. ✨


πŸ’œ ARGUMENTS πŸ’œ

here's the breakdown, one by one, no skipping, we don't do that here:

  • Shishi * handle β€” the shishi handle, bestie. the one you got from shishi_init(). it's like, the whole context of your shishi era. πŸ‘‘
  • const char key[8] β€” an input character array holding the key to use. it's 8 chars. exactly 8. don't be weird about it. πŸ”‘
  • const char iv[8] β€” an input character array with the initialization vector to use. and listen β€” this one can be NULL. so if you don't have an IV, that's fine, she's flexible. πŸ¦‹
  • const char * in β€” an input character array of the data you wanna hash. this is the thing getting the DES-CBC-MAC treatment, fr fr. πŸ“₯
  • size_t inlen β€” the length of that input character array of data to hash. yeah, she needs to know how much. always tell her how much. 😭
  • char * out[8] β€” a newly allocated character array with the keyed hash of data. freshly allocated, just for you. a gift. 🎁 but she comes with responsibilities, see below. πŸ‘‡

πŸ’… DESCRIPTION πŸ’…

okay so what does she actually do. she computes a keyed checksum of data using DES-CBC-MAC. that's it. that's the function. 🧚

and here's the part you can't skip, bestie:

the out buffer must be deallocated by the caller. that means YOU. yes, you. she allocated it, but you gotta free it. it's giving "I made the mess, but you clean it up" and honestly? valid. just do it. πŸ™ˆ

⭐ RETURN VALUE ⭐

returns SHISHI_OK iff successful. that's the iff-iff, no cap. anything else means something went sideways. 🌈


πŸ“ REPORTING BUGS πŸ“

found a bug? don't just sit there, tell someone! πŸ’Œ

she wants the feedback, genuinely. 🫢


Copyright Β© 2002-2022 Simon Josefsson.

copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. that's the whole rule. respect the notice, keep the notice. slay. πŸ’–


πŸ”₯ SEE ALSO πŸ”₯

the full documentation for shishi is maintained as a Texinfo manual. if the info and shishi programs are properly installed at your site, the command

info shishi

should give you access to the complete manual. iykyk. ✨


and that's the page, bestie! this was the shishi_des_cbc_mac(3) page, from shishi 1.0.3 β€” go forth, hash your data, and free that buffer. mwah. πŸ’‹πŸŽ€πŸ¦‹πŸ’–