ctr.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #include "crypto/ciphers.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
43 int cipher_encrypt_ctr(const cipher_t *cipher, uint8_t nonce_counter[16],
44  uint8_t nonce_len, const uint8_t *input, size_t length,
45  uint8_t *output);
46 
66 int cipher_decrypt_ctr(const cipher_t *cipher, uint8_t nonce_counter[16],
67  uint8_t nonce_len, const uint8_t *input, size_t length,
68  uint8_t *output);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
Headers for the packet encryption class.
int cipher_decrypt_ctr(const cipher_t *cipher, uint8_t nonce_counter[16], uint8_t nonce_len, const uint8_t *input, size_t length, uint8_t *output)
Decrypt data of arbitrary length in counter mode.
int cipher_encrypt_ctr(const cipher_t *cipher, uint8_t nonce_counter[16], uint8_t nonce_len, const uint8_t *input, size_t length, uint8_t *output)
Encrypt data of arbitrary length in counter mode.
basic struct for using block ciphers contains the cipher interface and the context
Definition: ciphers.h:115