RIPEMD160(3)
π 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 aRIPEMD160_CTXstructure. it's giving "set the stage" energy πRIPEMD160_Update()β can be called repeatedly with chunks of the message to be hashed (lenbytes atdata). feed her piece by piece, she doesn't mind πRIPEMD160_Final()β places the message digest inmd, which must have space forRIPEMD160_DIGEST_LENGTH == 20bytes of output, and erases theRIPEMD160_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(), andRIPEMD160_Final()return1for success or0otherwise. 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:2011Hash-functions β Part 3: Dedicated hash-functionsClause 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
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2000, 2006, 2014 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms