Function sgx_tcrypto::rsgx_sha256_msg[][src]

pub fn rsgx_sha256_msg<T>(src: &T) -> SgxResult<sgx_sha256_hash_t> where
    T: Copy + ContiguousMemory

The rsgx_sha256_msg function performs a standard SHA256 hash over the input data buffer.

Description

The rsgx_sha256_msg function performs a standard SHA256 hash over the input data buffer. Only a 256-bit version of the SHA hash is supported. (Other sizes, for example 512, are not supported in this minimal cryptography library).

The function should be used if the complete input data stream is available. Otherwise, the Init, Update… Update, Final procedure should be used to compute a SHA256 bit hash over multiple input data sets.

Parameters

src

A pointer to the input data stream to be hashed.

Requirements

Library: libsgx_tcrypto.a

Return value

The 256-bit hash that has been SHA256 calculated

Errors

SGX_ERROR_INVALID_PARAMETER

Input pointers are invalid.

SGX_ERROR_OUT_OF_MEMORY

Not enough memory is available to complete this operation.

SGX_ERROR_UNEXPECTED

The SHA256 hash calculation failed.