PIC32CM LS00/LS60 cipher hardware accelerator. More...
#include "pic32c.h"
#include "core/crypto.h"
#include "hardware/pic32cm_ls/pic32cm_ls_crypto.h"
#include "hardware/pic32cm_ls/pic32cm_ls_crypto_cipher.h"
#include "cipher/cipher_algorithms.h"
#include "aead/aead_algorithms.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
error_t | aesInit (AesContext *context, const uint8_t *key, size_t keyLen) |
Key expansion. More... | |
void | aesEncryptBlock (AesContext *context, const uint8_t *input, uint8_t *output) |
Encrypt a 16-byte block using AES algorithm. More... | |
void | aesDecryptBlock (AesContext *context, const uint8_t *input, uint8_t *output) |
Decrypt a 16-byte block using AES algorithm. More... | |
error_t | gcmInit (GcmContext *context, const CipherAlgo *cipherAlgo, void *cipherContext) |
Initialize GCM context. More... | |
void | gcmMul (GcmContext *context, uint8_t *x) |
Multiplication operation in GF(2^128) More... | |
Detailed Description
PIC32CM LS00/LS60 cipher hardware accelerator.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneCRYPTO Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file pic32cm_ls_crypto_cipher.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Definition at line 32 of file pic32cm_ls_crypto_cipher.c.
Function Documentation
◆ aesDecryptBlock()
void aesDecryptBlock | ( | AesContext * | context, |
const uint8_t * | input, | ||
uint8_t * | output | ||
) |
Decrypt a 16-byte block using AES algorithm.
- Parameters
-
[in] context Pointer to the AES context [in] input Ciphertext block to decrypt [out] output Plaintext block resulting from decryption
Definition at line 146 of file pic32cm_ls_crypto_cipher.c.
◆ aesEncryptBlock()
void aesEncryptBlock | ( | AesContext * | context, |
const uint8_t * | input, | ||
uint8_t * | output | ||
) |
Encrypt a 16-byte block using AES algorithm.
- Parameters
-
[in] context Pointer to the AES context [in] input Plaintext block to encrypt [out] output Ciphertext block resulting from encryption
Definition at line 98 of file pic32cm_ls_crypto_cipher.c.
◆ aesInit()
error_t aesInit | ( | AesContext * | context, |
const uint8_t * | key, | ||
size_t | keyLen | ||
) |
Key expansion.
- Parameters
-
[in] context Pointer to the AES context to initialize [in] key Pointer to the key [in] keyLen Length of the key
- Returns
- Error code
Definition at line 55 of file pic32cm_ls_crypto_cipher.c.
◆ gcmInit()
error_t gcmInit | ( | GcmContext * | context, |
const CipherAlgo * | cipherAlgo, | ||
void * | cipherContext | ||
) |
Initialize GCM context.
- Parameters
-
[in] context Pointer to the GCM context [in] cipherAlgo Cipher algorithm [in] cipherContext Pointer to the cipher algorithm context
- Returns
- Error code
Definition at line 197 of file pic32cm_ls_crypto_cipher.c.
◆ gcmMul()
void gcmMul | ( | GcmContext * | context, |
uint8_t * | x | ||
) |
Multiplication operation in GF(2^128)
- Parameters
-
[in] context Pointer to the GCM context [in,out] x 16-byte block to be multiplied by H
Definition at line 236 of file pic32cm_ls_crypto_cipher.c.