pic32cm_crypto_cipher.c File Reference

PIC32CM cipher hardware accelerator. More...

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 cipher hardware accelerator.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2023 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.2.2

Definition in file pic32cm_crypto_cipher.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 32 of file pic32cm_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]contextPointer to the AES context
[in]inputCiphertext block to decrypt
[out]outputPlaintext block resulting from decryption

Definition at line 146 of file pic32cm_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]contextPointer to the AES context
[in]inputPlaintext block to encrypt
[out]outputCiphertext block resulting from encryption

Definition at line 98 of file pic32cm_crypto_cipher.c.

◆ aesInit()

error_t aesInit ( AesContext context,
const uint8_t *  key,
size_t  keyLen 
)

Key expansion.

Parameters
[in]contextPointer to the AES context to initialize
[in]keyPointer to the key
[in]keyLenLength of the key
Returns
Error code

Definition at line 55 of file pic32cm_crypto_cipher.c.

◆ gcmInit()

error_t gcmInit ( GcmContext context,
const CipherAlgo cipherAlgo,
void *  cipherContext 
)

Initialize GCM context.

Parameters
[in]contextPointer to the GCM context
[in]cipherAlgoCipher algorithm
[in]cipherContextPointer to the cipher algorithm context
Returns
Error code

Definition at line 197 of file pic32cm_crypto_cipher.c.

◆ gcmMul()

void gcmMul ( GcmContext context,
uint8_t *  x 
)

Multiplication operation in GF(2^128)

Parameters
[in]contextPointer to the GCM context
[in,out]x16-byte block to be multiplied by H

Definition at line 236 of file pic32cm_crypto_cipher.c.