pic32mz_crypto_pkc.h File Reference

PIC32MZ W1 public-key hardware accelerator (BA414E) More...

#include "core/crypto.h"

Go to the source code of this file.

Macros

#define PIC32MZ_CRYPTO_PKC_SUPPORT   DISABLED
 
#define BA414E_GET_SCM_SLOT(n)   ((uint32_t *) __CRYPTO1SCM_BASE + ((n) * 16))
 
#define BA414E_MOD_SLOT_P   0
 
#define BA414E_MOD_SLOT_A   1
 
#define BA414E_MOD_SLOT_B   2
 
#define BA414E_MOD_SLOT_C   3
 
#define BA414E_RSA_MOD_EXP_SLOT_P   0
 
#define BA414E_RSA_MOD_EXP_SLOT_A   1
 
#define BA414E_RSA_MOD_EXP_SLOT_E   2
 
#define BA414E_RSA_MOD_EXP_SLOT_C   3
 
#define BA414E_ECC_SLOT_P   0
 
#define BA414E_ECC_SLOT_N   1
 
#define BA414E_ECC_SLOT_GX   2
 
#define BA414E_ECC_SLOT_GY   3
 
#define BA414E_ECC_SLOT_A   4
 
#define BA414E_ECC_SLOT_B   5
 
#define BA414E_ECC_SLOT_P1X   6
 
#define BA414E_ECC_SLOT_P1Y   7
 
#define BA414E_ECC_SLOT_P2X   8
 
#define BA414E_ECC_SLOT_P2Y   9
 
#define BA414E_ECC_SLOT_P3X   10
 
#define BA414E_ECC_SLOT_P3Y   11
 
#define BA414E_ECC_SLOT_K   12
 
#define BA414E_ECDSA_SLOT_P   0
 
#define BA414E_ECDSA_SLOT_N   1
 
#define BA414E_ECDSA_SLOT_GX   2
 
#define BA414E_ECDSA_SLOT_GY   3
 
#define BA414E_ECDSA_SLOT_A   4
 
#define BA414E_ECDSA_SLOT_B   5
 
#define BA414E_ECDSA_SLOT_D   6
 
#define BA414E_ECDSA_SLOT_K   7
 
#define BA414E_ECDSA_SLOT_QX   8
 
#define BA414E_ECDSA_SLOT_QY   9
 
#define BA414E_ECDSA_SLOT_R   10
 
#define BA414E_ECDSA_SLOT_S   11
 
#define BA414E_ECDSA_SLOT_H   12
 
#define BA414E_ECDSA_SLOT_W   13
 
#define BA414E_ECDSA_SLOT_P1X   14
 
#define BA414E_ECDSA_SLOT_P1Y   15
 
#define BA414E_CURVE25519_SLOT_P   0
 
#define BA414E_CURVE25519_SLOT_X1   2
 
#define BA414E_CURVE25519_SLOT_A24   3
 
#define BA414E_CURVE25519_SLOT_K   4
 
#define BA414E_CURVE25519_SLOT_X3   6
 
#define BA414E_ED25519_SLOT_P   0
 
#define BA414E_ED25519_SLOT_D2   1
 
#define BA414E_ED25519_SLOT_PX   2
 
#define BA414E_ED25519_SLOT_PY   3
 
#define BA414E_ED25519_SLOT_E   4
 
#define BA414E_ED25519_SLOT_CX   6
 
#define BA414E_ED25519_SLOT_CY   7
 
#define PKCOMMAND_OPSIZE_128B   0x00000200
 
#define PKCOMMAND_OPSIZE_256B   0x00000400
 
#define PKCOMMAND_OPSIZE_512B   0x00000800
 
#define PKCOMMAND_OP_MOD_ADD   0x00000001
 
#define PKCOMMAND_OP_MOD_SUB   0x00000002
 
#define PKCOMMAND_OP_MOD_MUL_ODD   0x00000003
 
#define PKCOMMAND_OP_MOD_RED_ODD   0x00000004
 
#define PKCOMMAND_OP_MOD_DIV_ODD   0x00000005
 
#define PKCOMMAND_OP_MOD_INV_ODD   0x00000006
 
#define PKCOMMAND_OP_MUL   0x00000008
 
#define PKCOMMAND_OP_MOD_INV_EVEN   0x00000009
 
#define PKCOMMAND_OP_RSA_MOD_EXP   0x00000010
 
#define PKCOMMAND_OP_RSA_PRIV_KEY_GEN   0x00000011
 
#define PKCOMMAND_OP_ECC_POINT_DBL   0x00000020
 
#define PKCOMMAND_OP_ECC_POINT_ADD   0x00000021
 
#define PKCOMMAND_OP_ECC_POINT_MUL   0x00000022
 
#define PKCOMMAND_OP_ECC_CHECK_AB   0x00000023
 
#define PKCOMMAND_OP_ECC_POINT_N   0x00000024
 
#define PKCOMMAND_OP_ECC_CHECK_RS   0x00000025
 
#define PKCOMMAND_OP_ECC_CHECK_POINT   0x00000026
 
#define PKCOMMAND_OP_CURVE25519_POINT_MUL   0x00000028
 
#define PKCOMMAND_OP_ED25519_XRECOVER   0x00000029
 
#define PKCOMMAND_OP_ED25519_SCALAR_MUL   0x0000002A
 
#define PKCOMMAND_OP_ED25519_CHECK_VALID   0x0000002B
 
#define PKCOMMAND_OP_ED25519_CHECK_POINT   0x0000002C
 
#define PKCOMMAND_OP_ECDSA_SIGN_GEN   0x00000030
 
#define PKCOMMAND_OP_ECDSA_SIGN_VERIFY   0x00000031
 
#define PKCOMMAND_OP_ECDSA_PARAMS_VALID   0x00000032
 

Functions

error_t ba414eInit (void)
 
void ba414eClearScm (void)
 

Detailed Description

PIC32MZ W1 public-key hardware accelerator (BA414E)

License

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

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

Definition in file pic32mz_crypto_pkc.h.

Macro Definition Documentation

◆ BA414E_CURVE25519_SLOT_A24

#define BA414E_CURVE25519_SLOT_A24   3

Definition at line 95 of file pic32mz_crypto_pkc.h.

◆ BA414E_CURVE25519_SLOT_K

#define BA414E_CURVE25519_SLOT_K   4

Definition at line 96 of file pic32mz_crypto_pkc.h.

◆ BA414E_CURVE25519_SLOT_P

#define BA414E_CURVE25519_SLOT_P   0

Definition at line 93 of file pic32mz_crypto_pkc.h.

◆ BA414E_CURVE25519_SLOT_X1

#define BA414E_CURVE25519_SLOT_X1   2

Definition at line 94 of file pic32mz_crypto_pkc.h.

◆ BA414E_CURVE25519_SLOT_X3

#define BA414E_CURVE25519_SLOT_X3   6

Definition at line 97 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_A

#define BA414E_ECC_SLOT_A   4

Definition at line 64 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_B

#define BA414E_ECC_SLOT_B   5

Definition at line 65 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_GX

#define BA414E_ECC_SLOT_GX   2

Definition at line 62 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_GY

#define BA414E_ECC_SLOT_GY   3

Definition at line 63 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_K

#define BA414E_ECC_SLOT_K   12

Definition at line 72 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_N

#define BA414E_ECC_SLOT_N   1

Definition at line 61 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_P

#define BA414E_ECC_SLOT_P   0

Definition at line 60 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_P1X

#define BA414E_ECC_SLOT_P1X   6

Definition at line 66 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_P1Y

#define BA414E_ECC_SLOT_P1Y   7

Definition at line 67 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_P2X

#define BA414E_ECC_SLOT_P2X   8

Definition at line 68 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_P2Y

#define BA414E_ECC_SLOT_P2Y   9

Definition at line 69 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_P3X

#define BA414E_ECC_SLOT_P3X   10

Definition at line 70 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECC_SLOT_P3Y

#define BA414E_ECC_SLOT_P3Y   11

Definition at line 71 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_A

#define BA414E_ECDSA_SLOT_A   4

Definition at line 79 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_B

#define BA414E_ECDSA_SLOT_B   5

Definition at line 80 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_D

#define BA414E_ECDSA_SLOT_D   6

Definition at line 81 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_GX

#define BA414E_ECDSA_SLOT_GX   2

Definition at line 77 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_GY

#define BA414E_ECDSA_SLOT_GY   3

Definition at line 78 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_H

#define BA414E_ECDSA_SLOT_H   12

Definition at line 87 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_K

#define BA414E_ECDSA_SLOT_K   7

Definition at line 82 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_N

#define BA414E_ECDSA_SLOT_N   1

Definition at line 76 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_P

#define BA414E_ECDSA_SLOT_P   0

Definition at line 75 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_P1X

#define BA414E_ECDSA_SLOT_P1X   14

Definition at line 89 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_P1Y

#define BA414E_ECDSA_SLOT_P1Y   15

Definition at line 90 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_QX

#define BA414E_ECDSA_SLOT_QX   8

Definition at line 83 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_QY

#define BA414E_ECDSA_SLOT_QY   9

Definition at line 84 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_R

#define BA414E_ECDSA_SLOT_R   10

Definition at line 85 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_S

#define BA414E_ECDSA_SLOT_S   11

Definition at line 86 of file pic32mz_crypto_pkc.h.

◆ BA414E_ECDSA_SLOT_W

#define BA414E_ECDSA_SLOT_W   13

Definition at line 88 of file pic32mz_crypto_pkc.h.

◆ BA414E_ED25519_SLOT_CX

#define BA414E_ED25519_SLOT_CX   6

Definition at line 105 of file pic32mz_crypto_pkc.h.

◆ BA414E_ED25519_SLOT_CY

#define BA414E_ED25519_SLOT_CY   7

Definition at line 106 of file pic32mz_crypto_pkc.h.

◆ BA414E_ED25519_SLOT_D2

#define BA414E_ED25519_SLOT_D2   1

Definition at line 101 of file pic32mz_crypto_pkc.h.

◆ BA414E_ED25519_SLOT_E

#define BA414E_ED25519_SLOT_E   4

Definition at line 104 of file pic32mz_crypto_pkc.h.

◆ BA414E_ED25519_SLOT_P

#define BA414E_ED25519_SLOT_P   0

Definition at line 100 of file pic32mz_crypto_pkc.h.

◆ BA414E_ED25519_SLOT_PX

#define BA414E_ED25519_SLOT_PX   2

Definition at line 102 of file pic32mz_crypto_pkc.h.

◆ BA414E_ED25519_SLOT_PY

#define BA414E_ED25519_SLOT_PY   3

Definition at line 103 of file pic32mz_crypto_pkc.h.

◆ BA414E_GET_SCM_SLOT

#define BA414E_GET_SCM_SLOT (   n)    ((uint32_t *) __CRYPTO1SCM_BASE + ((n) * 16))

Definition at line 45 of file pic32mz_crypto_pkc.h.

◆ BA414E_MOD_SLOT_A

#define BA414E_MOD_SLOT_A   1

Definition at line 49 of file pic32mz_crypto_pkc.h.

◆ BA414E_MOD_SLOT_B

#define BA414E_MOD_SLOT_B   2

Definition at line 50 of file pic32mz_crypto_pkc.h.

◆ BA414E_MOD_SLOT_C

#define BA414E_MOD_SLOT_C   3

Definition at line 51 of file pic32mz_crypto_pkc.h.

◆ BA414E_MOD_SLOT_P

#define BA414E_MOD_SLOT_P   0

Definition at line 48 of file pic32mz_crypto_pkc.h.

◆ BA414E_RSA_MOD_EXP_SLOT_A

#define BA414E_RSA_MOD_EXP_SLOT_A   1

Definition at line 55 of file pic32mz_crypto_pkc.h.

◆ BA414E_RSA_MOD_EXP_SLOT_C

#define BA414E_RSA_MOD_EXP_SLOT_C   3

Definition at line 57 of file pic32mz_crypto_pkc.h.

◆ BA414E_RSA_MOD_EXP_SLOT_E

#define BA414E_RSA_MOD_EXP_SLOT_E   2

Definition at line 56 of file pic32mz_crypto_pkc.h.

◆ BA414E_RSA_MOD_EXP_SLOT_P

#define BA414E_RSA_MOD_EXP_SLOT_P   0

Definition at line 54 of file pic32mz_crypto_pkc.h.

◆ PIC32MZ_CRYPTO_PKC_SUPPORT

#define PIC32MZ_CRYPTO_PKC_SUPPORT   DISABLED

Definition at line 39 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_CURVE25519_POINT_MUL

#define PKCOMMAND_OP_CURVE25519_POINT_MUL   0x00000028

Definition at line 131 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECC_CHECK_AB

#define PKCOMMAND_OP_ECC_CHECK_AB   0x00000023

Definition at line 127 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECC_CHECK_POINT

#define PKCOMMAND_OP_ECC_CHECK_POINT   0x00000026

Definition at line 130 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECC_CHECK_RS

#define PKCOMMAND_OP_ECC_CHECK_RS   0x00000025

Definition at line 129 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECC_POINT_ADD

#define PKCOMMAND_OP_ECC_POINT_ADD   0x00000021

Definition at line 125 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECC_POINT_DBL

#define PKCOMMAND_OP_ECC_POINT_DBL   0x00000020

Definition at line 124 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECC_POINT_MUL

#define PKCOMMAND_OP_ECC_POINT_MUL   0x00000022

Definition at line 126 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECC_POINT_N

#define PKCOMMAND_OP_ECC_POINT_N   0x00000024

Definition at line 128 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECDSA_PARAMS_VALID

#define PKCOMMAND_OP_ECDSA_PARAMS_VALID   0x00000032

Definition at line 138 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECDSA_SIGN_GEN

#define PKCOMMAND_OP_ECDSA_SIGN_GEN   0x00000030

Definition at line 136 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ECDSA_SIGN_VERIFY

#define PKCOMMAND_OP_ECDSA_SIGN_VERIFY   0x00000031

Definition at line 137 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ED25519_CHECK_POINT

#define PKCOMMAND_OP_ED25519_CHECK_POINT   0x0000002C

Definition at line 135 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ED25519_CHECK_VALID

#define PKCOMMAND_OP_ED25519_CHECK_VALID   0x0000002B

Definition at line 134 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ED25519_SCALAR_MUL

#define PKCOMMAND_OP_ED25519_SCALAR_MUL   0x0000002A

Definition at line 133 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_ED25519_XRECOVER

#define PKCOMMAND_OP_ED25519_XRECOVER   0x00000029

Definition at line 132 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_MOD_ADD

#define PKCOMMAND_OP_MOD_ADD   0x00000001

Definition at line 114 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_MOD_DIV_ODD

#define PKCOMMAND_OP_MOD_DIV_ODD   0x00000005

Definition at line 118 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_MOD_INV_EVEN

#define PKCOMMAND_OP_MOD_INV_EVEN   0x00000009

Definition at line 121 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_MOD_INV_ODD

#define PKCOMMAND_OP_MOD_INV_ODD   0x00000006

Definition at line 119 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_MOD_MUL_ODD

#define PKCOMMAND_OP_MOD_MUL_ODD   0x00000003

Definition at line 116 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_MOD_RED_ODD

#define PKCOMMAND_OP_MOD_RED_ODD   0x00000004

Definition at line 117 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_MOD_SUB

#define PKCOMMAND_OP_MOD_SUB   0x00000002

Definition at line 115 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_MUL

#define PKCOMMAND_OP_MUL   0x00000008

Definition at line 120 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_RSA_MOD_EXP

#define PKCOMMAND_OP_RSA_MOD_EXP   0x00000010

Definition at line 122 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OP_RSA_PRIV_KEY_GEN

#define PKCOMMAND_OP_RSA_PRIV_KEY_GEN   0x00000011

Definition at line 123 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OPSIZE_128B

#define PKCOMMAND_OPSIZE_128B   0x00000200

Definition at line 109 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OPSIZE_256B

#define PKCOMMAND_OPSIZE_256B   0x00000400

Definition at line 110 of file pic32mz_crypto_pkc.h.

◆ PKCOMMAND_OPSIZE_512B

#define PKCOMMAND_OPSIZE_512B   0x00000800

Definition at line 111 of file pic32mz_crypto_pkc.h.

Function Documentation

◆ ba414eClearScm()

void ba414eClearScm ( void  )

◆ ba414eInit()

error_t ba414eInit ( void  )