DeterministicESPAsyncWebServer 1.2.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
sha1.cpp File Reference

SHA-1 implementation. More...

#include "sha1.h"
#include "mbedtls/sha1.h"
#include <string.h>

Go to the source code of this file.

Functions

void sha1 (const uint8_t *data, size_t len, uint8_t digest[SHA1_DIGEST_LEN])
 Compute a SHA-1 digest over an arbitrary byte buffer.
 

Detailed Description

SHA-1 implementation.

On Arduino (ESP32) targets, delegates to mbedtls_sha1() which uses the hardware SHA accelerator in the ESP32 and is significantly faster than the software implementation.

On native (x86) test targets, uses a portable software implementation so unit tests run without mbedTLS installed.

Definition in file sha1.cpp.

Function Documentation

◆ sha1()

void sha1 ( const uint8_t *  data,
size_t  len,
uint8_t  digest[SHA1_DIGEST_LEN] 
)

Compute a SHA-1 digest over an arbitrary byte buffer.

Parameters
dataInput bytes.
lenNumber of input bytes.
digestOutput buffer; must be at least SHA1_DIGEST_LEN bytes.

Definition at line 24 of file sha1.cpp.