std.x.crypto.sha2 [x] std.x.crypto.sha2.Sha256 pub struct Sha256 { h0: wrapping[u64], h1: wrapping[u64], h2: wrapping[u64], h3: wrapping[u64], h4: wrapping[u64], h5: wrapping[u64], h6: wrapping[u64], h7: wrapping[u64], buf: List[byte], total: int, k: List[int], w: List[int], } — An in-progress SHA-256 computation. std.x.crypto.sha2.new256 pub fn new256() -> Sha256 — A fresh SHA-256 state — FIPS 180-4 §5.3.3's initial hash value ("the first thirty-two bits of the fractional parts of the square roots of the first eight prime numbers"). std.x.crypto.sha2.update256 pub fn update256(mut st: Sha256, data: List[byte]) — Absorbs data into the running SHA-256 computation. std.x.crypto.sha2.final256 pub fn final256(take st: Sha256) -> List[byte] — Pads (FIPS 180-4 §5.1.1: one 0x80 byte, zeros to 56 mod 64, the message length in BITS as a big-endian 64-bit word) and returns the 32 digest bytes, big-endian per word (§6.2.2 step 4, §3.1). std.x.crypto.sha2.sum256 pub fn sum256(msg: List[byte]) -> List[byte] — The SHA-256 digest of msg, one shot: new256 + update256 + final256. std.x.crypto.sha2.Sha512 pub struct Sha512 { h0: wrapping[u64], h1: wrapping[u64], h2: wrapping[u64], h3: wrapping[u64], h4: wrapping[u64], h5: wrapping[u64], h6: wrapping[u64], h7: wrapping[u64], buf: List[byte], total: int, khi: List[int], klo: List[int], whi: List[int], wlo: List[int], } — An in-progress SHA-512 computation. std.x.crypto.sha2.new512 pub fn new512() -> Sha512 — A fresh SHA-512 state — FIPS 180-4 §5.3.5's initial hash value ("the first sixty-four bits of the fractional parts of the square roots of the first eight prime numbers"). std.x.crypto.sha2.update512 pub fn update512(mut st: Sha512, data: List[byte]) — Absorbs data into the running SHA-512 computation; 1024-bit blocks. std.x.crypto.sha2.final512 pub fn final512(take st: Sha512) -> List[byte] — Pads (FIPS 180-4 §5.1.2: one 0x80, zeros to 112 mod 128, the bit length as a big-endian 128-bit word — the high word is the byte count's top three bits, exact for every representable length) and returns the 64 digest bytes. std.x.crypto.sha2.sum512 pub fn sum512(msg: List[byte]) -> List[byte] — The SHA-512 digest of msg, one shot. std.x.crypto.sha2.Sha384 pub struct Sha384 { st: Sha512, } — An in-progress SHA-384 computation: a Sha512 core under §5.3.4's initial value. std.x.crypto.sha2.new384 pub fn new384() -> Sha384 — A fresh SHA-384 state — FIPS 180-4 §5.3.4's initial hash value ("the square roots of the ninth through sixteenth prime numbers"). std.x.crypto.sha2.update384 pub fn update384(mut st: Sha384, data: List[byte]) — Absorbs data into the running SHA-384 computation. std.x.crypto.sha2.final384 pub fn final384(take st: Sha384) -> List[byte] — Pads exactly as SHA-512 and returns the LEFT-MOST 48 digest bytes (FIPS 180-4 §6.5 step 3 / §7 truncation). std.x.crypto.sha2.sum384 pub fn sum384(msg: List[byte]) -> List[byte] — The SHA-384 digest of msg, one shot. std.x.crypto.sha2.hmac256 pub fn hmac256(key: List[byte], msg: List[byte]) -> List[byte] — HMAC-SHA-256 (FIPS 198-1; RFC 2104). std.x.crypto.sha2.hmac384 pub fn hmac384(key: List[byte], msg: List[byte]) -> List[byte] — HMAC-SHA-384 (FIPS 198-1; RFC 2104). std.x.crypto.sha2.hmac512 pub fn hmac512(key: List[byte], msg: List[byte]) -> List[byte] — HMAC-SHA-512 (FIPS 198-1; RFC 2104). std.x.crypto.sha2.hkdf256_extract pub fn hkdf256_extract(salt: List[byte], ikm: List[byte]) -> List[byte] — HKDF-Extract over HMAC-SHA-256 (RFC 5869 §2.2). std.x.crypto.sha2.hkdf256_expand pub fn hkdf256_expand(prk: List[byte], info: List[byte], n: int) -> List[byte] — HKDF-Expand over HMAC-SHA-256 (RFC 5869 §2.3). std.x.crypto.sha2.hkdf256 pub fn hkdf256(salt: List[byte], ikm: List[byte], info: List[byte], n: int) -> List[byte] — HKDF over HMAC-SHA-256, extract-then-expand in one call (RFC 5869 §2). std.x.crypto.sha2.hkdf384_extract pub fn hkdf384_extract(salt: List[byte], ikm: List[byte]) -> List[byte] — HKDF-Extract over HMAC-SHA-384 (RFC 5869 §2.2). std.x.crypto.sha2.hkdf384_expand pub fn hkdf384_expand(prk: List[byte], info: List[byte], n: int) -> List[byte] — HKDF-Expand over HMAC-SHA-384 (RFC 5869 §2.3); the cap is 255 * 48. std.x.crypto.sha2.hkdf384 pub fn hkdf384(salt: List[byte], ikm: List[byte], info: List[byte], n: int) -> List[byte] — HKDF over HMAC-SHA-384, extract-then-expand in one call. std.x.crypto.sha2.hkdf512_extract pub fn hkdf512_extract(salt: List[byte], ikm: List[byte]) -> List[byte] — HKDF-Extract over HMAC-SHA-512 (RFC 5869 §2.2). std.x.crypto.sha2.hkdf512_expand pub fn hkdf512_expand(prk: List[byte], info: List[byte], n: int) -> List[byte] — HKDF-Expand over HMAC-SHA-512 (RFC 5869 §2.3); the cap is 255 * 64. std.x.crypto.sha2.hkdf512 pub fn hkdf512(salt: List[byte], ikm: List[byte], info: List[byte], n: int) -> List[byte] — HKDF over HMAC-SHA-512, extract-then-expand in one call. std.x.crypto.sha2.to_hex pub fn to_hex(b: List[byte]) -> str — b as lowercase hexadecimal, two digits per byte — this module's own rendering so its tests and examples import exactly one module (the std.bytes.from_str precedent); std.hex.encode is the facade spelling.