SAMA5D4 public-key hardware accelerator (CPKCC) More...
#include "chip.h"#include "cpkcc/CryptoLib_cf.h"#include "cpkcc/CryptoLib_JumpTable_Addr_pb.h"#include "core/crypto.h"#include "hardware/sama5d4/sama5d4_crypto.h"#include "hardware/sama5d4/sama5d4_crypto_pkc.h"#include "pkc/rsa.h"#include "mpi/mpi.h"#include "debug.h"Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
| error_t | cpkccInit (void) |
| Initialize CPKCC module. More... | |
| uint8_t * | cpkccImportMpi (uint8_t **dest, const Mpi *src, size_t totalLen) |
| Import multiple-precision integer. More... | |
| uint8_t * | cpkccWorkspace (uint8_t **dest, size_t totalLen) |
| Initialize workspace area. More... | |
| error_t | mpiMul (Mpi *r, const Mpi *a, const Mpi *b) |
| Multiple precision multiplication. More... | |
| error_t | mpiMod2 (Mpi *r, const Mpi *a, const Mpi *p) |
| Modulo operation. More... | |
| error_t | mpiInvMod (Mpi *r, const Mpi *a, const Mpi *p) |
| Modular inverse. More... | |
| error_t | mpiExpMod (Mpi *r, const Mpi *a, const Mpi *e, const Mpi *p) |
| Modular exponentiation. More... | |
| error_t | mpiCheckProbablePrime (const Mpi *a) |
| Test whether a number is probable prime. More... | |
| error_t | rsadp (const RsaPrivateKey *key, const Mpi *c, Mpi *m) |
| RSA decryption primitive. More... | |
Variables | |
| PCPKCL_PARAM | pvCPKCLParam |
| CPKCL_PARAM | CPKCLParam |
Detailed Description
SAMA5D4 public-key hardware accelerator (CPKCC)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2026 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.6.0
Definition in file sama5d4_crypto_pkc.c.
Macro Definition Documentation
◆ TRACE_LEVEL
| #define TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Definition at line 32 of file sama5d4_crypto_pkc.c.
Function Documentation
◆ cpkccImportMpi()
| uint8_t* cpkccImportMpi | ( | uint8_t ** | dest, |
| const Mpi * | src, | ||
| size_t | totalLen | ||
| ) |
Import multiple-precision integer.
- Parameters
-
[in,out] dest Pointer to the crypto memory [in] src Pointer to the multiple-precision integer [in] totalLen Desired length of the area, in bytes
- Returns
- Pointer to the initialized area
Definition at line 104 of file sama5d4_crypto_pkc.c.
◆ cpkccInit()
| error_t cpkccInit | ( | void | ) |
Initialize CPKCC module.
Definition at line 57 of file sama5d4_crypto_pkc.c.
◆ cpkccWorkspace()
| uint8_t* cpkccWorkspace | ( | uint8_t ** | dest, |
| size_t | totalLen | ||
| ) |
Initialize workspace area.
- Parameters
-
[in,out] dest Pointer to the crypto memory [in] totalLen Desired length of the area, in bytes
- Returns
- Pointer to the initialized area
Definition at line 129 of file sama5d4_crypto_pkc.c.
◆ mpiCheckProbablePrime()
Test whether a number is probable prime.
- Parameters
-
[in] a Pointer to a multiple precision integer
- Returns
- Error code
Definition at line 549 of file sama5d4_crypto_pkc.c.
◆ mpiExpMod()
Modular exponentiation.
- Parameters
-
[out] r Resulting integer R = A ^ E mod P [in] a Pointer to a multiple precision integer [in] e Exponent [in] p Modulus
- Returns
- Error code
Definition at line 399 of file sama5d4_crypto_pkc.c.
◆ mpiInvMod()
Modular inverse.
- Parameters
-
[out] r Resulting integer R = A^-1 mod P [in] a The multiple precision integer A [in] p The modulus P
- Returns
- Error code
Definition at line 324 of file sama5d4_crypto_pkc.c.
◆ mpiMod2()
Modulo operation.
- Parameters
-
[out] r Resulting integer R = A mod P [in] a The multiple precision integer to be reduced [in] p The modulus P
- Returns
- Error code
Definition at line 249 of file sama5d4_crypto_pkc.c.
◆ mpiMul()
Multiple precision multiplication.
- Parameters
-
[out] r Resulting integer R = A * B [in] a First operand A [in] b Second operand B
- Returns
- Error code
Definition at line 161 of file sama5d4_crypto_pkc.c.
◆ rsadp()
| error_t rsadp | ( | const RsaPrivateKey * | key, |
| const Mpi * | c, | ||
| Mpi * | m | ||
| ) |
RSA decryption primitive.
- Parameters
-
[in] key RSA private key [in] c Ciphertext representative [out] m Message representative
- Returns
- Error code
Definition at line 695 of file sama5d4_crypto_pkc.c.
Variable Documentation
◆ CPKCLParam
| CPKCL_PARAM CPKCLParam |
Definition at line 50 of file sama5d4_crypto_pkc.c.
◆ pvCPKCLParam
| PCPKCL_PARAM pvCPKCLParam |
Definition at line 49 of file sama5d4_crypto_pkc.c.
