Download Print this page

Espressif ESP32 Technical Reference Manual page 600

Hide thumbs Also See for ESP32:

Advertisement

24 RSA Accelerator (RSA)
24.3.3 Large Number Modular Multiplication
Large-number modular multiplication performs Z = X ×Y mod M . This operation is based on Montgomery mul-
tiplication. The same values r and M
The RSA Accelerator supports large-number modular multiplication with eight different operand lengths, which
are the same as in the large-number modular exponentiation. The operation is performed by a combination of
software and hardware. The software performs two hardware operations in sequence.
The software process is as follows:
N
1. Write (
1) to RSA_MULT_MODE_REG.
512
2. Write X
, M
and r
i
i
to each memory block only according to the length of the number. Data beyond this length are ignored.
'
3. Write M
to RSA_M_PRIME_REG.
4. Write 1 to RSA_MULT_START_REG.
5. Wait for the first round of the operation to be completed. Poll RSA_INTERRUPT_REG until it reads 1, or until
the RSA_INTR interrupt is generated.
6. Write 1 to RSA_INTERRUPT_REG to clear the interrupt.
(i ∈ [0, n) ∩ N) to RSA_X_MEM.
7. Write Y
i
Users need to write to the memory block only according to the length of the number. Data beyond this
length are ignored.
8. Write 1 to RSA_MULT_START_REG.
9. Wait for the second round of the operation to be completed. Poll RSA_INTERRUPT_REG until it reads 1, or
until the RSA_INTR interrupt is generated.
10. Read the result Z
i
11. Write 1 to RSA_INTERRUPT_REG to clear the interrupt.
After the operation, the RSA_MULT_MODE_REG register, and memory blocks RSA_M_MEM and RSA_M_PRIME_REG
remain unchanged. Users do not need to refresh these registers or memory blocks if the values remain the
same.
24.3.4 Large Number Multiplication
Large-number multiplication performs Z = X × Y . The length of Z is twice that of X and Y . Therefore, the RSA
Accelerator supports large-number multiplication with only four operand lengths of N ∈ {512, 1024, 1536, 2048}
bits. The length ˆ N of the result Z is 2 × N bits.
Operands X and Y need to be extended to form arguments ˆ X and ˆ Y which have the same length ( ˆ N bits) as
Espressif Systems
'
are derived by software using the formulas
(i ∈ [0, n) ∩ N) to registers RSA_X_MEM, RSA_M_MEM and RSA_Z_MEM. Write data
i
(i ∈ [0, n) ∩ N) from RSA_Z_MEM.
Submit Documentation Feedback
600
1
and
2
shown above.
ESP32 TRM (Version 5.2)

Advertisement

loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?