s32k1_crypto.h File Reference

S32K1 hardware cryptographic accelerator (CSEq) More...

#include "core/crypto.h"

Go to the source code of this file.

Macros

#define CSEQ_CMD_ENC_ECB   0x01000000
 
#define CSEQ_CMD_ENC_CBC   0x02000000
 
#define CSEQ_CMD_DEC_ECB   0x03000000
 
#define CSEQ_CMD_DEC_CBC   0x04000000
 
#define CSEQ_CMD_GENERATE_MAC   0x05000000
 
#define CSEQ_CMD_VERIFY_MAC   0x06000000
 
#define CSEQ_CMD_LOAD_KEY   0x07000000
 
#define CSEQ_CMD_LOAD_PLAIN_KEY   0x08000000
 
#define CSEQ_CMD_EXPORT_RAM_KEY   0x09000000
 
#define CSEQ_CMD_INIT_RNG   0x0A000000
 
#define CSEQ_CMD_EXTEND_SEED   0x0B000000
 
#define CSEQ_CMD_RND   0x0C000000
 
#define CSEQ_CMD_BOOT_FAILURE   0x0E000000
 
#define CSEQ_CMD_BOOT_OK   0x0F000000
 
#define CSEQ_CMD_GET_ID   0x10000000
 
#define CSEQ_CMD_BOOT_DEFINE   0x11000000
 
#define CSEQ_CMD_DBG_CHAL   0x12000000
 
#define CSEQ_CMD_DBG_AUTH   0x13000000
 
#define CSEQ_CMD_MP_COMPRESS   0x16000000
 
#define CSEQ_FORMAT_COPY   0x00000000
 
#define CSEQ_FORMAT_POINTER   0x00010000
 
#define CSEQ_CALL_SEQ_FIRST   0x00000000
 
#define CSEQ_CALL_SEQ_SUBSEQUENT   0x00000100
 
#define CSEQ_SECRET_KEY   0x00000000
 
#define CSEQ_MASTER_ECU_KEY   0x00000001
 
#define CSEQ_BOOT_MAC_KEY   0x00000002
 
#define CSEQ_BOOT_MAC   0x00000003
 
#define CSEQ_KEY_1   0x00000004
 
#define CSEQ_KEY_2   0x00000005
 
#define CSEQ_KEY_3   0x00000006
 
#define CSEQ_KEY_4   0x00000007
 
#define CSEQ_KEY_5   0x00000008
 
#define CSEQ_KEY_6   0x00000009
 
#define CSEQ_KEY_7   0x0000000A
 
#define CSEQ_KEY_8   0x0000000B
 
#define CSEQ_KEY_9   0x0000000C
 
#define CSEQ_KEY_10   0x0000000D
 
#define CSEQ_RAM_KEY   0x0000000F
 
#define CSEQ_KEY_11   0x00000014
 
#define CSEQ_KEY_12   0x00000015
 
#define CSEQ_KEY_13   0x00000016
 
#define CSEQ_KEY_14   0x00000017
 
#define CSEQ_KEY_15   0x00000018
 
#define CSEQ_KEY_16   0x00000019
 
#define CSEQ_KEY_17   0x0000001A
 
#define CSEQ_KEY_18   0x0000001B
 
#define CSEQ_KEY_19   0x0000001C
 
#define CSEQ_KEY_20   0x0000001D
 
#define CSEQ_KEY_21   0x0000001E
 
#define CSEQ_ERC_NO_ERROR   0x0001
 
#define CSEQ_ERC_SEQUENCE_ERROR   0x0002
 
#define CSEQ_ERC_KEY_NOT_AVAILABLE   0x0004
 
#define CSEQ_ERC_KEY_INVALID   0x0008
 
#define CSEQ_ERC_KEY_EMPTY   0x0010
 
#define CSEQ_ERC_NO_SECURE_BOOT   0x0020
 
#define CSEQ_ERC_KEY_WRITE_PROTECTED   0x0040
 
#define CSEQ_ERC_KEY_UPDATE_ERROR   0x0080
 
#define CSEQ_ERC_RNG_SEED   0x0100
 
#define CSEQ_ERC_NO_DEBUGGING   0x0200
 
#define CSEQ_ERC_MEMORY_FAILURE   0x0400
 
#define CSEQ_ERC_GENERAL_ERROR   0x0800
 

Functions

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

Variables

OsMutex s32k1CryptoMutex
 

Detailed Description

S32K1 hardware cryptographic accelerator (CSEq)

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.0

Definition in file s32k1_crypto.h.

Macro Definition Documentation

◆ CSEQ_BOOT_MAC

#define CSEQ_BOOT_MAC   0x00000003

Definition at line 70 of file s32k1_crypto.h.

◆ CSEQ_BOOT_MAC_KEY

#define CSEQ_BOOT_MAC_KEY   0x00000002

Definition at line 69 of file s32k1_crypto.h.

◆ CSEQ_CALL_SEQ_FIRST

#define CSEQ_CALL_SEQ_FIRST   0x00000000

Definition at line 63 of file s32k1_crypto.h.

◆ CSEQ_CALL_SEQ_SUBSEQUENT

#define CSEQ_CALL_SEQ_SUBSEQUENT   0x00000100

Definition at line 64 of file s32k1_crypto.h.

◆ CSEQ_CMD_BOOT_DEFINE

#define CSEQ_CMD_BOOT_DEFINE   0x11000000

Definition at line 53 of file s32k1_crypto.h.

◆ CSEQ_CMD_BOOT_FAILURE

#define CSEQ_CMD_BOOT_FAILURE   0x0E000000

Definition at line 50 of file s32k1_crypto.h.

◆ CSEQ_CMD_BOOT_OK

#define CSEQ_CMD_BOOT_OK   0x0F000000

Definition at line 51 of file s32k1_crypto.h.

◆ CSEQ_CMD_DBG_AUTH

#define CSEQ_CMD_DBG_AUTH   0x13000000

Definition at line 55 of file s32k1_crypto.h.

◆ CSEQ_CMD_DBG_CHAL

#define CSEQ_CMD_DBG_CHAL   0x12000000

Definition at line 54 of file s32k1_crypto.h.

◆ CSEQ_CMD_DEC_CBC

#define CSEQ_CMD_DEC_CBC   0x04000000

Definition at line 41 of file s32k1_crypto.h.

◆ CSEQ_CMD_DEC_ECB

#define CSEQ_CMD_DEC_ECB   0x03000000

Definition at line 40 of file s32k1_crypto.h.

◆ CSEQ_CMD_ENC_CBC

#define CSEQ_CMD_ENC_CBC   0x02000000

Definition at line 39 of file s32k1_crypto.h.

◆ CSEQ_CMD_ENC_ECB

#define CSEQ_CMD_ENC_ECB   0x01000000

Definition at line 38 of file s32k1_crypto.h.

◆ CSEQ_CMD_EXPORT_RAM_KEY

#define CSEQ_CMD_EXPORT_RAM_KEY   0x09000000

Definition at line 46 of file s32k1_crypto.h.

◆ CSEQ_CMD_EXTEND_SEED

#define CSEQ_CMD_EXTEND_SEED   0x0B000000

Definition at line 48 of file s32k1_crypto.h.

◆ CSEQ_CMD_GENERATE_MAC

#define CSEQ_CMD_GENERATE_MAC   0x05000000

Definition at line 42 of file s32k1_crypto.h.

◆ CSEQ_CMD_GET_ID

#define CSEQ_CMD_GET_ID   0x10000000

Definition at line 52 of file s32k1_crypto.h.

◆ CSEQ_CMD_INIT_RNG

#define CSEQ_CMD_INIT_RNG   0x0A000000

Definition at line 47 of file s32k1_crypto.h.

◆ CSEQ_CMD_LOAD_KEY

#define CSEQ_CMD_LOAD_KEY   0x07000000

Definition at line 44 of file s32k1_crypto.h.

◆ CSEQ_CMD_LOAD_PLAIN_KEY

#define CSEQ_CMD_LOAD_PLAIN_KEY   0x08000000

Definition at line 45 of file s32k1_crypto.h.

◆ CSEQ_CMD_MP_COMPRESS

#define CSEQ_CMD_MP_COMPRESS   0x16000000

Definition at line 56 of file s32k1_crypto.h.

◆ CSEQ_CMD_RND

#define CSEQ_CMD_RND   0x0C000000

Definition at line 49 of file s32k1_crypto.h.

◆ CSEQ_CMD_VERIFY_MAC

#define CSEQ_CMD_VERIFY_MAC   0x06000000

Definition at line 43 of file s32k1_crypto.h.

◆ CSEQ_ERC_GENERAL_ERROR

#define CSEQ_ERC_GENERAL_ERROR   0x0800

Definition at line 106 of file s32k1_crypto.h.

◆ CSEQ_ERC_KEY_EMPTY

#define CSEQ_ERC_KEY_EMPTY   0x0010

Definition at line 99 of file s32k1_crypto.h.

◆ CSEQ_ERC_KEY_INVALID

#define CSEQ_ERC_KEY_INVALID   0x0008

Definition at line 98 of file s32k1_crypto.h.

◆ CSEQ_ERC_KEY_NOT_AVAILABLE

#define CSEQ_ERC_KEY_NOT_AVAILABLE   0x0004

Definition at line 97 of file s32k1_crypto.h.

◆ CSEQ_ERC_KEY_UPDATE_ERROR

#define CSEQ_ERC_KEY_UPDATE_ERROR   0x0080

Definition at line 102 of file s32k1_crypto.h.

◆ CSEQ_ERC_KEY_WRITE_PROTECTED

#define CSEQ_ERC_KEY_WRITE_PROTECTED   0x0040

Definition at line 101 of file s32k1_crypto.h.

◆ CSEQ_ERC_MEMORY_FAILURE

#define CSEQ_ERC_MEMORY_FAILURE   0x0400

Definition at line 105 of file s32k1_crypto.h.

◆ CSEQ_ERC_NO_DEBUGGING

#define CSEQ_ERC_NO_DEBUGGING   0x0200

Definition at line 104 of file s32k1_crypto.h.

◆ CSEQ_ERC_NO_ERROR

#define CSEQ_ERC_NO_ERROR   0x0001

Definition at line 95 of file s32k1_crypto.h.

◆ CSEQ_ERC_NO_SECURE_BOOT

#define CSEQ_ERC_NO_SECURE_BOOT   0x0020

Definition at line 100 of file s32k1_crypto.h.

◆ CSEQ_ERC_RNG_SEED

#define CSEQ_ERC_RNG_SEED   0x0100

Definition at line 103 of file s32k1_crypto.h.

◆ CSEQ_ERC_SEQUENCE_ERROR

#define CSEQ_ERC_SEQUENCE_ERROR   0x0002

Definition at line 96 of file s32k1_crypto.h.

◆ CSEQ_FORMAT_COPY

#define CSEQ_FORMAT_COPY   0x00000000

Definition at line 59 of file s32k1_crypto.h.

◆ CSEQ_FORMAT_POINTER

#define CSEQ_FORMAT_POINTER   0x00010000

Definition at line 60 of file s32k1_crypto.h.

◆ CSEQ_KEY_1

#define CSEQ_KEY_1   0x00000004

Definition at line 71 of file s32k1_crypto.h.

◆ CSEQ_KEY_10

#define CSEQ_KEY_10   0x0000000D

Definition at line 80 of file s32k1_crypto.h.

◆ CSEQ_KEY_11

#define CSEQ_KEY_11   0x00000014

Definition at line 82 of file s32k1_crypto.h.

◆ CSEQ_KEY_12

#define CSEQ_KEY_12   0x00000015

Definition at line 83 of file s32k1_crypto.h.

◆ CSEQ_KEY_13

#define CSEQ_KEY_13   0x00000016

Definition at line 84 of file s32k1_crypto.h.

◆ CSEQ_KEY_14

#define CSEQ_KEY_14   0x00000017

Definition at line 85 of file s32k1_crypto.h.

◆ CSEQ_KEY_15

#define CSEQ_KEY_15   0x00000018

Definition at line 86 of file s32k1_crypto.h.

◆ CSEQ_KEY_16

#define CSEQ_KEY_16   0x00000019

Definition at line 87 of file s32k1_crypto.h.

◆ CSEQ_KEY_17

#define CSEQ_KEY_17   0x0000001A

Definition at line 88 of file s32k1_crypto.h.

◆ CSEQ_KEY_18

#define CSEQ_KEY_18   0x0000001B

Definition at line 89 of file s32k1_crypto.h.

◆ CSEQ_KEY_19

#define CSEQ_KEY_19   0x0000001C

Definition at line 90 of file s32k1_crypto.h.

◆ CSEQ_KEY_2

#define CSEQ_KEY_2   0x00000005

Definition at line 72 of file s32k1_crypto.h.

◆ CSEQ_KEY_20

#define CSEQ_KEY_20   0x0000001D

Definition at line 91 of file s32k1_crypto.h.

◆ CSEQ_KEY_21

#define CSEQ_KEY_21   0x0000001E

Definition at line 92 of file s32k1_crypto.h.

◆ CSEQ_KEY_3

#define CSEQ_KEY_3   0x00000006

Definition at line 73 of file s32k1_crypto.h.

◆ CSEQ_KEY_4

#define CSEQ_KEY_4   0x00000007

Definition at line 74 of file s32k1_crypto.h.

◆ CSEQ_KEY_5

#define CSEQ_KEY_5   0x00000008

Definition at line 75 of file s32k1_crypto.h.

◆ CSEQ_KEY_6

#define CSEQ_KEY_6   0x00000009

Definition at line 76 of file s32k1_crypto.h.

◆ CSEQ_KEY_7

#define CSEQ_KEY_7   0x0000000A

Definition at line 77 of file s32k1_crypto.h.

◆ CSEQ_KEY_8

#define CSEQ_KEY_8   0x0000000B

Definition at line 78 of file s32k1_crypto.h.

◆ CSEQ_KEY_9

#define CSEQ_KEY_9   0x0000000C

Definition at line 79 of file s32k1_crypto.h.

◆ CSEQ_MASTER_ECU_KEY

#define CSEQ_MASTER_ECU_KEY   0x00000001

Definition at line 68 of file s32k1_crypto.h.

◆ CSEQ_RAM_KEY

#define CSEQ_RAM_KEY   0x0000000F

Definition at line 81 of file s32k1_crypto.h.

◆ CSEQ_SECRET_KEY

#define CSEQ_SECRET_KEY   0x00000000

Definition at line 67 of file s32k1_crypto.h.

Function Documentation

◆ s32k1CryptoInit()

error_t s32k1CryptoInit ( void  )

Initialize hardware cryptographic accelerator.

Returns
Error code

Definition at line 49 of file s32k1_crypto.c.

Variable Documentation

◆ s32k1CryptoMutex

OsMutex s32k1CryptoMutex
extern

Definition at line 41 of file s32k1_crypto.c.