RIPEMD160(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’œ RIPEMD160(3) β€” like, the whole manual, bestie

okay so real talk: this is a page from the Library Functions Manual, and it's all about the RIPEMD-160 hash function. yes, that RIPEMD-160. she's iconic, she's 160 bits, she's got lore. let's get into it πŸŽ€


✨ NAME ✨

RIPEMD160, RIPEMD160_Init, RIPEMD160_Update, RIPEMD160_Final β€” the RIPEMD-160 hash function, aka the whole squad πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

so you're gonna link against libcrypto and pull in the header, like:

library β€œlibcrypto”
#include <openssl/ripemd.h>

then the functions themselves, one by one, no cap:

unsigned char *
RIPEMD160(const unsigned char *d, unsigned long n, unsigned char *md);
int
RIPEMD160_Init(RIPEMD160_CTX *c);
int
RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, unsigned long len);
int
RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);

🌸 DESCRIPTION 🌸

okay so RIPEMD-160 is a cryptographic hash function with a 160-bit output. that's the whole vibe. she takes your stuff and turns it into a fixed-size fingerprint ✨

RIPEMD160() computes the RIPEMD-160 message digest of the n bytes at d and plops it right into md. and md? bestie, md must have space for RIPEMD160_DIGEST_LENGTH == 20 bytes of output. twenty. not nineteen, not twenty-one. twenty πŸ’€

but wait β€” what if your message isn't all cozy in memory at once? like, what if it's streaming? that's where these three come in:

  • RIPEMD160_Init() β€” initializes a RIPEMD160_CTX structure. it's giving "set the stage" energy πŸ‘‘
  • RIPEMD160_Update() β€” can be called repeatedly with chunks of the message to be hashed (len bytes at data). feed her piece by piece, she doesn't mind πŸ“
  • RIPEMD160_Final() β€” places the message digest in md, which must have space for RIPEMD160_DIGEST_LENGTH == 20 bytes of output, and erases the RIPEMD160_CTX. she's done, she's out, she cleaned up after herself πŸ™ˆ
✨ real one advice: applications should use the higher level functions EVP_DigestInit(3) etc. instead of calling the hash functions directly. like, go through the front door, not the window, iykyk.

πŸ”₯ RETURN VALUES πŸ”₯

  • RIPEMD160() returns a pointer to the hash value. that's it, that's the return πŸ’–
  • RIPEMD160_Init(), RIPEMD160_Update(), and RIPEMD160_Final() return 1 for success or 0 otherwise. binary queen, no in-between 🌈

πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're literally required reading:


⭐ STANDARDS ⭐

she's certified, she's official, she's got paperwork πŸ“œ

  • ISO/IEC 10118-3:2004/Cor 1:2011
  • Hash-functions β€” Part 3: Dedicated hash-functions
  • Clause 7: RIPEMD-160

🧚 HISTORY 🧚

RIPEMD160(), RIPEMD160_Init(), RIPEMD160_Update(), and RIPEMD160_Final() first appeared in SSLeay 0.9.0 and have been available since OpenBSD 2.4. ancient. legendary. still slaying πŸ’€βœ¨


πŸ’€ CAVEATS πŸ’€

okay so here's the tea, and it's important: other implementations allow md in RIPEMD160() to be NULL and return a static array β€” and that is not thread safe. so do not go assuming that's a thing here, bestie. not safe, not cute, don't do it πŸ™ˆ


aaaand that's the page! 🫢 this gorgeous chunk of documentation is from the Debian build, dated June 8, 2025 β€” so if you see RIPEMD160(3) floating around, now you know exactly what time it is. mwah πŸ’‹πŸ’œ

πŸ“¦ where this page comes from