crypto::sha512+x86_64 +linux

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

// Undocumented 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 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[link]

Show undocumented member
type digest = struct {
	hash::hash,
	h: [8]u64,
	x: [chunk]u8,
	nx: size,
	ln: size,
	var: variant,
};

type variant[link]

Show undocumented member
type variant = enum {
	SHA384,
	SHA512,
	SHA512_224,
	SHA512_256,
};

Constants

def SZ[link]

def SZ: size = 64;

The size, in bytes, of a SHA-512 checksum.

def SZ224[link]

def SZ224: size = 28;

The size, in bytes, of a SHA-512/224 checksum.

def SZ256[link]

def SZ256: size = 32;

The size, in bytes, of a SHA-512/256 checksum.

def SZ384[link]

def SZ384: size = 48;

The size, in bytes, of a SHA-384 checksum.

Functions

fn sha384[link]

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[link]

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[link]

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[link]

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.