mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 03:50:58 +00:00
sha2: add sha1_Raw
This commit is contained in:
parent
d812c7209f
commit
19efbeef8d
7
sha2.c
7
sha2.c
@ -672,6 +672,13 @@ char *sha1_End(SHA1_CTX* context, char buffer[]) {
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sha1_Raw(const sha2_byte* data, size_t len, uint8_t digest[SHA1_DIGEST_LENGTH]) {
|
||||||
|
SHA1_CTX context;
|
||||||
|
sha1_Init(&context);
|
||||||
|
sha1_Update(&context, data, len);
|
||||||
|
sha1_Final(&context, digest);
|
||||||
|
}
|
||||||
|
|
||||||
char* sha1_Data(const sha2_byte* data, size_t len, char digest[SHA1_DIGEST_STRING_LENGTH]) {
|
char* sha1_Data(const sha2_byte* data, size_t len, char digest[SHA1_DIGEST_STRING_LENGTH]) {
|
||||||
SHA1_CTX context;
|
SHA1_CTX context;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user