Добавил:
ИВТ (советую зайти в "Несортированное")rnПИН МАГА Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
interfeysy_1 / ИДЗ_машинка / даташиты / esp32_technical_reference_manual_en.pdf
Скачиваний:
19
Добавлен:
26.01.2024
Размер:
9.62 Mб
Скачать

23 SHA Accelerator (SHA)

23 SHA Accelerator (SHA)

23.1Introduction

The SHA Accelerator is included to speed up SHA hashing operations significantly, compared to SHA hashing algorithms implemented solely in software. The SHA Accelerator supports four algorithms of FIPS PUB 180-4, specifically SHA-1, SHA-256, SHA-384 and SHA-512.

23.2Features

Hardware support for popular secure hashing algorithms:

SHA-1

SHA-256

SHA-384

SHA-512

23.3Functional Description

23.3.1 Padding and Parsing the Message

The SHA Accelerator can only accept one message block at a time. Software divides the message into blocks according to “5.2 Parsing the Message” in FIPS PUB 180-4 and writes one block to the SHA_TEXT_n_REG registers each time. For SHA-1 and SHA-256, software writes a 512-bit message block to SHA_TEXT_0_REG

~ SHA_TEXT_15_REG each time. For SHA-384 and SHA-512, software writes a 1024-bit message block to SHA_TEXT_0_REG ~ SHA_TEXT_31_REG each time.

The SHA Accelerator is unable to perform the padding operation of “5.1 Padding the Message” in FIPS PUB 180-4; Note that the user software is expected to pad the message before feeding it into the accelerator.

As described in “2.2.1: Parameters” in FIPS PUB 180-4, “M0(i) is the leftmost word of message block i”. M0(i) is stored in SHA_TEXT_0_REG. In the same fashion, the SHA_TEXT_1_REG register stores the second left-most word of a message block M1(N), etc.

23.3.2 Message Digest

When the hashing operation is finished, the message digest will be refreshed by SHA Accelerator and will be stored in SHA_TEXT_n_REG. SHA-1 produces a 160-bit message digest and stores it in SHA_TEXT_0_REG ~

SHA_TEXT_4_REG. SHA-256 produces a 256-bit message digest and stores it in SHA_TEXT_0_REG ~ SHA_TEXT_7_REG. SHA-384 produces a 384-bit message digest and stores it in SHA_TEXT_0_REG ~ SHA_TEXT_11_REG. SHA-512 produces a 512-bit message digest and stores it in SHA_TEXT_0_REG ~ SHA_TEXT_15_REG.

As described in “2.2.1 Parameters” in FIPS PUB 180-4, “H(N) is the final hash value, and is used to determine the message digest”, while “H0(i) is the leftmost word of hash value i”, so the leftmost word H0(N) in the message digest is stored in SHA_TEXT_0_REG. In the same fashion, the second leftmost word H1(N) in the message digest is stored in SHA_TEXT_1_REG, etc.

23.3.3 Hash Operation

There is a set of control registers for SHA-1, SHA-256, SHA-384 and SHA-512, respectively; different hashing algorithms use different control registers.

Espressif Systems

582

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

Соседние файлы в папке даташиты