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

Poly1305 (RFC 8439) - implementation. See ssh_poly1305.h. More...

Go to the source code of this file.

Namespaces

namespace  DETWS_CRYPTO_HOT
 

Functions

uint32_t DETWS_CRYPTO_HOT::rd_le32 (const uint8_t *p)
 
void DETWS_CRYPTO_HOT::wr_le32 (uint8_t *p, uint32_t v)
 
void DETWS_CRYPTO_HOT::poly_block (uint32_t h[5], const uint32_t r[5], const uint32_t sr[5], const uint8_t blk[16], uint32_t hibit)
 
void ssh_poly1305 (uint8_t tag[SSH_POLY1305_TAG_LEN], const uint8_t *msg, size_t len, const uint8_t key[SSH_POLY1305_KEY_LEN])
 Compute the 16-byte Poly1305 tag over msg under the 32-byte one-time key.
 

Detailed Description

Poly1305 (RFC 8439) - implementation. See ssh_poly1305.h.

poly1305-donna 32-bit: the accumulator h and key part r are held as five 26-bit limbs; each 16-byte block adds the message limb (with the 2^128 high bit), multiplies by r, and reduces modulo 2^130 - 5. The final value is fully reduced, conditionally has p subtracted in constant time, and s is added modulo 2^128.

Definition in file ssh_poly1305.cpp.

Function Documentation

◆ ssh_poly1305()

void ssh_poly1305 ( uint8_t  tag[SSH_POLY1305_TAG_LEN],
const uint8_t *  msg,
size_t  len,
const uint8_t  key[SSH_POLY1305_KEY_LEN] 
)

Compute the 16-byte Poly1305 tag over msg under the 32-byte one-time key.

Definition at line 81 of file ssh_poly1305.cpp.

Referenced by ssh_chachapoly_decrypt(), and ssh_chachapoly_encrypt().