pic32mz_crypto.h File Reference

PIC32MZ hardware cryptographic accelerator. More...

#include "core/crypto.h"

Go to the source code of this file.

Data Structures

struct  Pic32mzCryptoBufferDesc
 Buffer description. More...
 
struct  Pic32mzCryptoSecurityAssoc
 Security association. More...
 

Macros

#define PIC32MZ_CRYPTO_BUFFER_SIZE   1024
 
#define BD_CTRL_DESC_EN   0x80000000
 
#define BD_CTRL_CRY_MODE   0x38000000
 
#define BD_CTRL_CRY_MODE_NORMAL   0x00000000
 
#define BD_CTRL_CRY_MODE_PREBOOT_AUTH   0x08000000
 
#define BD_CTRL_CRY_MODE_KEK   0x10000000
 
#define BD_CTRL_CRY_MODE_CEK   0x18000000
 
#define BD_CTRL_SA_FETCH_EN   0x00400000
 
#define BD_CTRL_LAST_BD   0x00080000
 
#define BD_CTRL_LIFM   0x00040000
 
#define BD_CTRL_PKT_INT_EN   0x00020000
 
#define BD_CTRL_CBD_INT_EN   0x00010000
 
#define BD_CTRL_BD_BUFLEN   0x0000FFFF
 
#define SA_CTRL_VERIFY   0x20000000
 
#define SA_CTRL_NO_RX   0x08000000
 
#define SA_CTRL_OR_EN   0x04000000
 
#define SA_CTRL_ICVONLY   0x02000000
 
#define SA_CTRL_IRFLAG   0x01000000
 
#define SA_CTRL_LNC   0x00800000
 
#define SA_CTRL_LOADIV   0x00400000
 
#define SA_CTRL_FB   0x00200000
 
#define SA_CTRL_FLAGS   0x00100000
 
#define SA_CTRL_ALGO   0x0001FC00
 
#define SA_CTRL_ALGO_DES   0x00000400
 
#define SA_CTRL_ALGO_TDES   0x00000800
 
#define SA_CTRL_ALGO_AES   0x00001000
 
#define SA_CTRL_ALGO_MD5   0x00002000
 
#define SA_CTRL_ALGO_SHA1   0x00004000
 
#define SA_CTRL_ALGO_SHA256   0x00008000
 
#define SA_CTRL_ALGO_HMAC   0x00010000
 
#define SA_CTRL_ENC   0x00000200
 
#define SA_CTRL_KEYSIZE   0x00000180
 
#define SA_CTRL_KEYSIZE_128   0x00000000
 
#define SA_CTRL_KEYSIZE_192   0x00000080
 
#define SA_CTRL_KEYSIZE_256   0x00000100
 
#define SA_CTRL_MULTITASK   0x00000070
 
#define SA_CTRL_MULTITASK_NO_PASS   0x00000000
 
#define SA_CTRL_MULTITASK_PIPE_PASS   0x00000050
 
#define SA_CTRL_MULTITASK_PARALLEL_PASS   0x00000070
 
#define SA_CTRL_CRYPTOALGO   0x0000000F
 
#define SA_CTRL_CRYPTOALGO_ECB   0x00000000
 
#define SA_CTRL_CRYPTOALGO_CBC   0x00000001
 
#define SA_CTRL_CRYPTOALGO_CFB   0x00000002
 
#define SA_CTRL_CRYPTOALGO_OFB   0x00000003
 
#define SA_CTRL_CRYPTOALGO_TECB   0x00000004
 
#define SA_CTRL_CRYPTOALGO_TCBC   0x00000005
 
#define SA_CTRL_CRYPTOALGO_TCFB   0x00000006
 
#define SA_CTRL_CRYPTOALGO_TOFB   0x00000007
 
#define SA_CTRL_CRYPTOALGO_RECB   0x00000008
 
#define SA_CTRL_CRYPTOALGO_RCBC   0x00000009
 
#define SA_CTRL_CRYPTOALGO_RCFB   0x0000000A
 
#define SA_CTRL_CRYPTOALGO_ROFB   0x0000000B
 
#define SA_CTRL_CRYPTOALGO_RCBC_MAC   0x0000000C
 
#define SA_CTRL_CRYPTOALGO_RCTR   0x0000000D
 
#define SA_CTRL_CRYPTOALGO_AES_GCM   0x0000000E
 

Functions

error_t pic32mzCryptoInit (void)
 Initialize hardware cryptographic accelerator. More...
 

Variables

OsMutex pic32mzCryptoMutex
 

Detailed Description

PIC32MZ hardware cryptographic 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 pic32mz_crypto.h.

Macro Definition Documentation

◆ BD_CTRL_BD_BUFLEN

#define BD_CTRL_BD_BUFLEN   0x0000FFFF

Definition at line 56 of file pic32mz_crypto.h.

◆ BD_CTRL_CBD_INT_EN

#define BD_CTRL_CBD_INT_EN   0x00010000

Definition at line 55 of file pic32mz_crypto.h.

◆ BD_CTRL_CRY_MODE

#define BD_CTRL_CRY_MODE   0x38000000

Definition at line 46 of file pic32mz_crypto.h.

◆ BD_CTRL_CRY_MODE_CEK

#define BD_CTRL_CRY_MODE_CEK   0x18000000

Definition at line 50 of file pic32mz_crypto.h.

◆ BD_CTRL_CRY_MODE_KEK

#define BD_CTRL_CRY_MODE_KEK   0x10000000

Definition at line 49 of file pic32mz_crypto.h.

◆ BD_CTRL_CRY_MODE_NORMAL

#define BD_CTRL_CRY_MODE_NORMAL   0x00000000

Definition at line 47 of file pic32mz_crypto.h.

◆ BD_CTRL_CRY_MODE_PREBOOT_AUTH

#define BD_CTRL_CRY_MODE_PREBOOT_AUTH   0x08000000

Definition at line 48 of file pic32mz_crypto.h.

◆ BD_CTRL_DESC_EN

#define BD_CTRL_DESC_EN   0x80000000

Definition at line 45 of file pic32mz_crypto.h.

◆ BD_CTRL_LAST_BD

#define BD_CTRL_LAST_BD   0x00080000

Definition at line 52 of file pic32mz_crypto.h.

◆ BD_CTRL_LIFM

#define BD_CTRL_LIFM   0x00040000

Definition at line 53 of file pic32mz_crypto.h.

◆ BD_CTRL_PKT_INT_EN

#define BD_CTRL_PKT_INT_EN   0x00020000

Definition at line 54 of file pic32mz_crypto.h.

◆ BD_CTRL_SA_FETCH_EN

#define BD_CTRL_SA_FETCH_EN   0x00400000

Definition at line 51 of file pic32mz_crypto.h.

◆ PIC32MZ_CRYPTO_BUFFER_SIZE

#define PIC32MZ_CRYPTO_BUFFER_SIZE   1024

Definition at line 39 of file pic32mz_crypto.h.

◆ SA_CTRL_ALGO

#define SA_CTRL_ALGO   0x0001FC00

Definition at line 68 of file pic32mz_crypto.h.

◆ SA_CTRL_ALGO_AES

#define SA_CTRL_ALGO_AES   0x00001000

Definition at line 71 of file pic32mz_crypto.h.

◆ SA_CTRL_ALGO_DES

#define SA_CTRL_ALGO_DES   0x00000400

Definition at line 69 of file pic32mz_crypto.h.

◆ SA_CTRL_ALGO_HMAC

#define SA_CTRL_ALGO_HMAC   0x00010000

Definition at line 75 of file pic32mz_crypto.h.

◆ SA_CTRL_ALGO_MD5

#define SA_CTRL_ALGO_MD5   0x00002000

Definition at line 72 of file pic32mz_crypto.h.

◆ SA_CTRL_ALGO_SHA1

#define SA_CTRL_ALGO_SHA1   0x00004000

Definition at line 73 of file pic32mz_crypto.h.

◆ SA_CTRL_ALGO_SHA256

#define SA_CTRL_ALGO_SHA256   0x00008000

Definition at line 74 of file pic32mz_crypto.h.

◆ SA_CTRL_ALGO_TDES

#define SA_CTRL_ALGO_TDES   0x00000800

Definition at line 70 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO

#define SA_CTRL_CRYPTOALGO   0x0000000F

Definition at line 85 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_AES_GCM

#define SA_CTRL_CRYPTOALGO_AES_GCM   0x0000000E

Definition at line 100 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_CBC

#define SA_CTRL_CRYPTOALGO_CBC   0x00000001

Definition at line 87 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_CFB

#define SA_CTRL_CRYPTOALGO_CFB   0x00000002

Definition at line 88 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_ECB

#define SA_CTRL_CRYPTOALGO_ECB   0x00000000

Definition at line 86 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_OFB

#define SA_CTRL_CRYPTOALGO_OFB   0x00000003

Definition at line 89 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_RCBC

#define SA_CTRL_CRYPTOALGO_RCBC   0x00000009

Definition at line 95 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_RCBC_MAC

#define SA_CTRL_CRYPTOALGO_RCBC_MAC   0x0000000C

Definition at line 98 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_RCFB

#define SA_CTRL_CRYPTOALGO_RCFB   0x0000000A

Definition at line 96 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_RCTR

#define SA_CTRL_CRYPTOALGO_RCTR   0x0000000D

Definition at line 99 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_RECB

#define SA_CTRL_CRYPTOALGO_RECB   0x00000008

Definition at line 94 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_ROFB

#define SA_CTRL_CRYPTOALGO_ROFB   0x0000000B

Definition at line 97 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_TCBC

#define SA_CTRL_CRYPTOALGO_TCBC   0x00000005

Definition at line 91 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_TCFB

#define SA_CTRL_CRYPTOALGO_TCFB   0x00000006

Definition at line 92 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_TECB

#define SA_CTRL_CRYPTOALGO_TECB   0x00000004

Definition at line 90 of file pic32mz_crypto.h.

◆ SA_CTRL_CRYPTOALGO_TOFB

#define SA_CTRL_CRYPTOALGO_TOFB   0x00000007

Definition at line 93 of file pic32mz_crypto.h.

◆ SA_CTRL_ENC

#define SA_CTRL_ENC   0x00000200

Definition at line 76 of file pic32mz_crypto.h.

◆ SA_CTRL_FB

#define SA_CTRL_FB   0x00200000

Definition at line 66 of file pic32mz_crypto.h.

◆ SA_CTRL_FLAGS

#define SA_CTRL_FLAGS   0x00100000

Definition at line 67 of file pic32mz_crypto.h.

◆ SA_CTRL_ICVONLY

#define SA_CTRL_ICVONLY   0x02000000

Definition at line 62 of file pic32mz_crypto.h.

◆ SA_CTRL_IRFLAG

#define SA_CTRL_IRFLAG   0x01000000

Definition at line 63 of file pic32mz_crypto.h.

◆ SA_CTRL_KEYSIZE

#define SA_CTRL_KEYSIZE   0x00000180

Definition at line 77 of file pic32mz_crypto.h.

◆ SA_CTRL_KEYSIZE_128

#define SA_CTRL_KEYSIZE_128   0x00000000

Definition at line 78 of file pic32mz_crypto.h.

◆ SA_CTRL_KEYSIZE_192

#define SA_CTRL_KEYSIZE_192   0x00000080

Definition at line 79 of file pic32mz_crypto.h.

◆ SA_CTRL_KEYSIZE_256

#define SA_CTRL_KEYSIZE_256   0x00000100

Definition at line 80 of file pic32mz_crypto.h.

◆ SA_CTRL_LNC

#define SA_CTRL_LNC   0x00800000

Definition at line 64 of file pic32mz_crypto.h.

◆ SA_CTRL_LOADIV

#define SA_CTRL_LOADIV   0x00400000

Definition at line 65 of file pic32mz_crypto.h.

◆ SA_CTRL_MULTITASK

#define SA_CTRL_MULTITASK   0x00000070

Definition at line 81 of file pic32mz_crypto.h.

◆ SA_CTRL_MULTITASK_NO_PASS

#define SA_CTRL_MULTITASK_NO_PASS   0x00000000

Definition at line 82 of file pic32mz_crypto.h.

◆ SA_CTRL_MULTITASK_PARALLEL_PASS

#define SA_CTRL_MULTITASK_PARALLEL_PASS   0x00000070

Definition at line 84 of file pic32mz_crypto.h.

◆ SA_CTRL_MULTITASK_PIPE_PASS

#define SA_CTRL_MULTITASK_PIPE_PASS   0x00000050

Definition at line 83 of file pic32mz_crypto.h.

◆ SA_CTRL_NO_RX

#define SA_CTRL_NO_RX   0x08000000

Definition at line 60 of file pic32mz_crypto.h.

◆ SA_CTRL_OR_EN

#define SA_CTRL_OR_EN   0x04000000

Definition at line 61 of file pic32mz_crypto.h.

◆ SA_CTRL_VERIFY

#define SA_CTRL_VERIFY   0x20000000

Definition at line 59 of file pic32mz_crypto.h.

Function Documentation

◆ pic32mzCryptoInit()

error_t pic32mzCryptoInit ( void  )

Initialize hardware cryptographic accelerator.

Returns
Error code

Definition at line 49 of file pic32mz_crypto.c.

Variable Documentation

◆ pic32mzCryptoMutex

OsMutex pic32mzCryptoMutex
extern

Definition at line 41 of file pic32mz_crypto.c.