hash: Allow for SHA512 hardware implementations

Similar to support for SHA1 and SHA256, allow the use of hardware hashing
engine by enabling the algorithm and setting  CONFIG_SHA_HW_ACCEL /
CONFIG_SHA_PROG_HW_ACCEL.

Signed-off-by: Joel Stanley <joel@jms.id.au>
This commit is contained in:
Joel Stanley
2021-02-17 13:50:42 +10:30
committed by Tom Rini
parent ba13978311
commit a479f103dc
3 changed files with 55 additions and 10 deletions

View File

@@ -8,6 +8,32 @@
#define __HW_SHA_H
#include <hash.h>
/**
* Computes hash value of input pbuf using h/w acceleration
*
* @param in_addr A pointer to the input buffer
* @param bufleni Byte length of input buffer
* @param out_addr A pointer to the output buffer. When complete
* 64 bytes are copied to pout[0]...pout[63]. Thus, a user
* should allocate at least 64 bytes at pOut in advance.
* @param chunk_size chunk size for sha512
*/
void hw_sha512(const uchar *in_addr, uint buflen, uchar *out_addr,
uint chunk_size);
/**
* Computes hash value of input pbuf using h/w acceleration
*
* @param in_addr A pointer to the input buffer
* @param bufleni Byte length of input buffer
* @param out_addr A pointer to the output buffer. When complete
* 48 bytes are copied to pout[0]...pout[47]. Thus, a user
* should allocate at least 48 bytes at pOut in advance.
* @param chunk_size chunk size for sha384
*/
void hw_sha384(const uchar *in_addr, uint buflen, uchar *out_addr,
uint chunk_size);
/**
* Computes hash value of input pbuf using h/w acceleration
*