shishi_checksum(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_checksum β€” the tea β˜•

okay bestie, so this is a page from the shishi manual, section 3 (that's the library-functions section, iykyk), and today's main character is shishi_checksum. she does integrity protection. she's not flashy, but she carries. 🫢


✨ NAME ✨

shishi_checksum β€” an API function, bestie. that's the whole vibe. she computes a checksum so you know nobody messed with your data. no cap. πŸ’…


🌸 SYNOPSIS 🌸

#include <shishi.h>

int shishi_checksum(Shishi * handle, Shishi_key * key, int keyusage, int
cksumtype, const char * in, size_t inlen, char ** out, size_t * outlen);

like… look at her. eight whole arguments. she's doing the most and honestly? respect. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • Shishi * handle β€” the shishi handle you got from shishi_init(). it's literally your whole ticket to the party, don't show up without it. πŸ’–
  • Shishi_key * key β€” the key you're computing the checksum with. she's the moment. she's the blueprint.
  • int keyusage β€” an integer saying what this key is for. context matters bestie, keys have range. 🌈
  • int cksumtype β€” the checksum algorithm you wanna use. pick your fighter. πŸ”₯
  • const char * in β€” input array holding the data you wanna integrity-protect. your precious little bytes. πŸ“
  • size_t inlen β€” the size of that input array. yes, you have to tell her how big it is. she's not a mind reader (derogatory). 😭
  • char ** out β€” output array with the newly allocated integrity-protected data. brand new, freshly malloc'd, hot off the press. ✨
  • size_t * outlen β€” output variable that receives the length of the output array with the checksum. so you know how much to read. so thoughtful of her. 🌸

πŸ’œ DESCRIPTION πŸ’œ

so basically: she integrity protects your data using key, and that key might be altered by the supplied key usage. πŸ‘€

IMPORTANT BESTIE: if key usage is 0, no key derivation is used. periodt. write that down.

also, and this is the part people always forget:

the OUT buffer must be deallocated by the caller.

like. you have to free it. she's not gonna do it for you. that's your responsibility, that's your character arc, that's your problem now. 🫢


⭐ RETURN VALUE ⭐

returns SHISHI_OK iff successful. that's it, that's the bar. if you see SHISHI_OK you ate. πŸ’…


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? (not her fault obviously, but like, hypothetically) report it to <bug-shishi@gnu.org>. πŸ“§


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.

(tl;dr: she's free, she's open, she's generous, just keep the receipts. iconic behaviour honestly.) πŸŽ€


🌈 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. so if you're nosy (affectionate) that's where you go. πŸ”βœ¨


okay that's the whole page, you're caught up, go forth and integrity-protect. mwah. πŸ’–

this was shishi version 1.0.3, and we were reading shishi_checksum(3) β€” tysm for coming to my TED talk, ily, bye bestie!! πŸ¦‹πŸŒΈπŸ’œ