max32690_crypto_pkc.c File Reference

MAX32690 public-key hardware accelerator. More...

#include "mxc_device.h"
#include "mxc_sys.h"
#include "ctb.h"
#include "core/crypto.h"
#include "hardware/max32690/max32690_crypto.h"
#include "hardware/max32690/max32690_crypto_pkc.h"
#include "ecc/ec.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

void maaSetValue (uint_t offset, uint32_t value, uint_t length)
 Set operand value. More...
 
void maaImportMpi (uint_t offset, const Mpi *a, uint_t length)
 Import multiple-precision integer. More...
 
error_t maaExportMpi (uint_t offset, Mpi *r, uint_t length)
 Export multiple-precision integer. More...
 
error_t mpiExpModFast (Mpi *r, const Mpi *a, const Mpi *e, const Mpi *p)
 Modular exponentiation (fast calculation) More...
 
error_t mpiExpModRegular (Mpi *r, const Mpi *a, const Mpi *e, const Mpi *p)
 Modular exponentiation (regular calculation) More...
 
error_t ecMulMod (const EcDomainParameters *params, Mpi *r, const Mpi *a, const Mpi *b)
 Modular multiplication. More...
 
error_t ecSqrMod (const EcDomainParameters *params, Mpi *r, const Mpi *a)
 Fast modular squaring. More...
 

Detailed Description

MAX32690 public-key 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.

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

Definition in file max32690_crypto_pkc.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 32 of file max32690_crypto_pkc.c.

Function Documentation

◆ ecMulMod()

error_t ecMulMod ( const EcDomainParameters params,
Mpi r,
const Mpi a,
const Mpi b 
)

Modular multiplication.

Fast modular multiplication.

Parameters
[in]paramsEC domain parameters
[out]rResulting integer R = (A * B) mod p
[in]aAn integer such as 0 <= A < p
[in]bAn integer such as 0 <= B < p
Returns
Error code

Definition at line 323 of file max32690_crypto_pkc.c.

◆ ecSqrMod()

error_t ecSqrMod ( const EcDomainParameters params,
Mpi r,
const Mpi a 
)

Fast modular squaring.

Parameters
[in]paramsEC domain parameters
[out]rResulting integer R = (A ^ 2) mod p
[in]aAn integer such as 0 <= A < p
Returns
Error code

Definition at line 389 of file max32690_crypto_pkc.c.

◆ maaExportMpi()

error_t maaExportMpi ( uint_t  offset,
Mpi r,
uint_t  length 
)

Export multiple-precision integer.

Parameters
[in]offsetMAA memory offset
[out]rPointer to the multiple-precision integer
[in]lengthLength of the operand, in bits
Returns
Error code

Definition at line 117 of file max32690_crypto_pkc.c.

◆ maaImportMpi()

void maaImportMpi ( uint_t  offset,
const Mpi a,
uint_t  length 
)

Import multiple-precision integer.

Parameters
[in]offsetMAA memory offset
[in]aPointer to the multiple-precision integer
[in]lengthLength of the operand, in bits

Definition at line 84 of file max32690_crypto_pkc.c.

◆ maaSetValue()

void maaSetValue ( uint_t  offset,
uint32_t  value,
uint_t  length 
)

Set operand value.

Parameters
[in]offsetMAA memory offset
[in]valueValue of the operand
[in]lengthLength of the operand, in bits

Definition at line 55 of file max32690_crypto_pkc.c.

◆ mpiExpModFast()

error_t mpiExpModFast ( Mpi r,
const Mpi a,
const Mpi e,
const Mpi p 
)

Modular exponentiation (fast calculation)

Parameters
[out]rResulting integer R = A ^ E mod P
[in]aPointer to a multiple precision integer
[in]eExponent
[in]pModulus
Returns
Error code

Definition at line 167 of file max32690_crypto_pkc.c.

◆ mpiExpModRegular()

error_t mpiExpModRegular ( Mpi r,
const Mpi a,
const Mpi e,
const Mpi p 
)

Modular exponentiation (regular calculation)

Parameters
[out]rResulting integer R = A ^ E mod P
[in]aPointer to a multiple precision integer
[in]eExponent
[in]pModulus
Returns
Error code

Definition at line 244 of file max32690_crypto_pkc.c.