#include <libkern/crypto/sha1.h>

libkern/crypto/sha1.h Kernel.framework

includes: sys/types.h
5 macros · 3 functions · 1 struct · 1 typedef

macroSHA_DIGEST_LENGTH

#define SHA_DIGEST_LENGTH 20

macroSHA1_RESULTLEN

#define SHA1_RESULTLEN SHA_DIGEST_LENGTH

structsha1_ctxt

size 104, align 8
unnamed union at Kernel/libkern/crypto/sha1.h:42:2h
u_int8_t[20]b8
u_int32_t[5]b32state (ABCDE)
unnamed union at Kernel/libkern/crypto/sha1.h:46:2c
u_int8_t[8]b8
u_int32_t[2]b32
u_int64_t[1]b64# of bits, modulo 2^64 (msb first)
unnamed union at Kernel/libkern/crypto/sha1.h:51:2m
u_int8_t[64]b8
u_int32_t[16]b32input buffer
u_int8_tcountunused; for compatibility only

typedefSHA1_CTX

typedef struct sha1_ctxt SHA1_CTX;

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.