#include <libkern/crypto/sha1.h>
libkern/crypto/sha1.h
macroSHA_DIGEST_LENGTH
#define SHA_DIGEST_LENGTH 20
macroSHA1_RESULTLEN
#define SHA1_RESULTLEN SHA_DIGEST_LENGTH
structsha1_ctxt
| unnamed union at Kernel/libkern/crypto/sha1.h:42:2 | h | ||||||||||
| |||||||||||
| unnamed union at Kernel/libkern/crypto/sha1.h:46:2 | c | ||||||||||
| |||||||||||
| unnamed union at Kernel/libkern/crypto/sha1.h:51:2 | m | ||||||||||
| |||||||||||
| u_int8_t | count | unused; for compatibility only | |||||||||
macrosha1_init
For compatibility with the other SHA-1 implementation.
#define sha1_init(c) SHA1Init(c)
macrosha1_loop
#define sha1_loop(c, b, l) SHA1Update(c, b, l)
macrosha1_result
#define sha1_result(c, b) SHA1Final(b, c)
functionSHA1Init
extern void SHA1Init(SHA1_CTX *)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/crypto/corecrypto_sha1.c
Initializes a SHA1_CTX to begin a new SHA-1 message-digest computation. Part of the legacy SHA1Init/SHA1Update/SHA1Final interface, implemented over the corecrypto ccdigest SHA-1 implementation. SHA-1 is no longer collision-resistant; the interface remains for compatibility.
functionSHA1Update
extern void SHA1Update(SHA1_CTX *, const void *, size_t)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/crypto/corecrypto_sha1.c
Appends len bytes of data to the SHA-1 computation in progress in the given SHA1_CTX. May be called repeatedly to digest a message in pieces; implemented over the corecrypto ccdigest SHA-1 implementation.
functionSHA1Final
extern void SHA1Final(void *, SHA1_CTX *)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu libkern/crypto/corecrypto_sha1.c
Completes the SHA-1 computation in the given SHA1_CTX, applying padding and length encoding, and writes the 20-byte digest to the supplied buffer. The context contents are not meaningful afterward; call SHA1Init to reuse it.