crypto::sha512
The sha512 module implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4.
Index
Types
type digest = struct {
hash::hash,
h: [8]u64,
x: [chunk]u8,
nx: size,
ln: size,
var: variant,
};
type variant = enum {
SHA384,
SHA512,
SHA512_224,
SHA512_256,
};
Constants
def BLOCKSZ: size = 128;
def SZ: size = 64;
def SZ224: size = 28;
def SZ256: size = 32;
def SZ384: size = 48;
Functions
fn sha384() digest;
fn sha512() digest;
fn sha512_224() digest;
fn sha512_256() digest;
Types
type digest
Show undocumented member
type digest = struct {
hash::hash,
h: [8]u64,
x: [chunk]u8,
nx: size,
ln: size,
var: variant,
};
type variant
Show undocumented member
type variant = enum {
SHA384,
SHA512,
SHA512_224,
SHA512_256,
};
Constants
def BLOCKSZ
def BLOCKSZ: size = 128;
The internal block size.
def SZ
def SZ: size = 64;
The size, in bytes, of a SHA-512 checksum.
def SZ224
def SZ224: size = 28;
The size, in bytes, of a SHA-512/224 checksum.
def SZ256
def SZ256: size = 32;
The size, in bytes, of a SHA-512/256 checksum.
def SZ384
def SZ384: size = 48;
The size, in bytes, of a SHA-384 checksum.
Functions
fn sha384
fn sha384() digest;
Creates a hash::hash which computes a SHA-384 hash. If this function is used to hash sensitive information, the caller should call hash::close to erase sensitive data from memory after use; if not, the use of hash::close is optional.
fn sha512
fn sha512() digest;
Creates a hash::hash which computes a SHA-512 hash. If this function is used to hash sensitive information, the caller should call hash::close to erase sensitive data from memory after use; if not, the use of hash::close is optional.
fn sha512_224
fn sha512_224() digest;
Creates a hash::hash which computes a SHA-512/224 hash. If this function is used to hash sensitive information, the caller should call hash::close to erase sensitive data from memory after use; if not, the use of hash::close is optional.
fn sha512_256
fn sha512_256() digest;
Creates a hash::hash which computes a SHA-512/256 hash. If this function is used to hash sensitive information, the caller should call hash::close to erase sensitive data from memory after use; if not, the use of hash::close is optional.