#include "ext_headers.h"
Go to the source code of this file.
◆ lc_poly1305_context
| struct lc_poly1305_context |
Definition at line 33 of file lc_poly1305.h.
| Data Fields |
|
size_t |
aligner |
|
|
uint8_t |
opaque[136] |
|
◆ LC_POLY1305_KEYSIZE
| #define LC_POLY1305_KEYSIZE (32) |
◆ LC_POLY1305_STATE_SIZE
◆ LC_POLY1305_TAGSIZE
| #define LC_POLY1305_TAGSIZE (16) |
◆ lc_poly1305_final()
Calculate the Poly1305 keyed message digest from the state.
- Note
- With the call to this API, the context may not be needed any more and should be zeroized at this point to prevent leaving potentially sensitive data in memory.
- Parameters
-
| [in] | ctx | Poly1305 context holding the state |
| [in] | mac | buffer which receives the 16 byte authenticator. |
◆ lc_poly1305_init()
| void lc_poly1305_init |
( |
struct lc_poly1305_context * |
ctx, |
|
|
const uint8_t |
key[LC_POLY1305_KEYSIZE] |
|
) |
| |
Initialize the Poly1305 algorithm with a key.
- Note
- The
ctx can be allocated either on heap or stack. Once done, it should be zeroized to provide a clean slate.
- Warning
- This algorithm is intended only in conjunction with ChaCha20 to form ChaCha20-Poly1305. For some use cases (like SSH), a separate access to the algorithm is needed and thus provided with this API.
- Parameters
-
| [in] | ctx | Poly1305 context holding the state |
| [in] | key | 32 byte key that is only used for this message and is discarded immediately after |
◆ lc_poly1305_update()
Add data to the Poly1305 context to digest it.
- Parameters
-
| [in] | ctx | Poly1305 context holding the state |
| [in] | m | pointer to the message fragment to be processed |
| [in] | bytes | length of the message fragment in bytes |