nrfxlib API 0.1.0
Loading...
Searching...
No Matches
ocrypto_aes_cbc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA
3 * Copyright (c) since 2013 Oberon microsystems AG
4 *
5 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
6 */
7
8
26#ifndef OCRYPTO_AES_CBC_H
27#define OCRYPTO_AES_CBC_H
28
29#include <stddef.h>
30#include <stdint.h>
31
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37
39typedef struct {
40 uint32_t xkey[60];
41 uint8_t iv[16];
42 uint8_t key_size; // Key size (16, 24, or 32 bytes).
43} ocrypto_aes_cbc_ctx;
67void ocrypto_aes_cbc_init_enc(ocrypto_aes_cbc_ctx *ctx, const uint8_t *key, size_t size, const uint8_t iv[16]);
68
82void ocrypto_aes_cbc_init_dec(ocrypto_aes_cbc_ctx *ctx, const uint8_t *key, size_t size, const uint8_t iv[16]);
83
100void ocrypto_aes_cbc_update_enc(ocrypto_aes_cbc_ctx *ctx, uint8_t* ct, const uint8_t* pt, size_t pt_len);
101
118void ocrypto_aes_cbc_update_dec(ocrypto_aes_cbc_ctx *ctx, uint8_t* pt, const uint8_t* ct, size_t ct_len);
134 uint8_t* ct, const uint8_t* pt, size_t pt_len, const uint8_t *key, size_t size, const uint8_t iv[16]);
135
149 uint8_t* pt, const uint8_t* ct, size_t ct_len, const uint8_t *key, size_t size, const uint8_t iv[16]);
150
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif
157
void ocrypto_aes_cbc_decrypt(uint8_t *pt, const uint8_t *ct, size_t ct_len, const uint8_t *key, size_t size, const uint8_t iv[16])
void ocrypto_aes_cbc_encrypt(uint8_t *ct, const uint8_t *pt, size_t pt_len, const uint8_t *key, size_t size, const uint8_t iv[16])
void ocrypto_aes_cbc_update_enc(ocrypto_aes_cbc_ctx *ctx, uint8_t *ct, const uint8_t *pt, size_t pt_len)
void ocrypto_aes_cbc_update_dec(ocrypto_aes_cbc_ctx *ctx, uint8_t *pt, const uint8_t *ct, size_t ct_len)
void ocrypto_aes_cbc_init_enc(ocrypto_aes_cbc_ctx *ctx, const uint8_t *key, size_t size, const uint8_t iv[16])
void ocrypto_aes_cbc_init_dec(ocrypto_aes_cbc_ctx *ctx, const uint8_t *key, size_t size, const uint8_t iv[16])