summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ccree/ssi_fips.h
blob: 19bcdeb34308c669704a5880aca1480eb7603a1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright (C) 2012-2017 ARM Limited or its affiliates.
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * 
 * 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, see <http://www.gnu.org/licenses/>.
 */

#ifndef __SSI_FIPS_H__
#define __SSI_FIPS_H__


#ifndef INT32_MAX /* Missing in Linux kernel */
#define INT32_MAX 0x7FFFFFFFL
#endif


/*! 
@file
@brief This file contains FIPS related defintions and APIs.
*/

typedef enum ssi_fips_state {
        CC_FIPS_STATE_NOT_SUPPORTED = 0,
        CC_FIPS_STATE_SUPPORTED,
        CC_FIPS_STATE_ERROR,
        CC_FIPS_STATE_RESERVE32B = INT32_MAX
} ssi_fips_state_t;


typedef enum ssi_fips_error {
	CC_REE_FIPS_ERROR_OK = 0,
	CC_REE_FIPS_ERROR_GENERAL,
	CC_REE_FIPS_ERROR_FROM_TEE,
	CC_REE_FIPS_ERROR_AES_ECB_PUT,
	CC_REE_FIPS_ERROR_AES_CBC_PUT,
	CC_REE_FIPS_ERROR_AES_OFB_PUT,
	CC_REE_FIPS_ERROR_AES_CTR_PUT,
	CC_REE_FIPS_ERROR_AES_CBC_CTS_PUT,
	CC_REE_FIPS_ERROR_AES_XTS_PUT,
	CC_REE_FIPS_ERROR_AES_CMAC_PUT,
	CC_REE_FIPS_ERROR_AESCCM_PUT,
	CC_REE_FIPS_ERROR_AESGCM_PUT,
	CC_REE_FIPS_ERROR_DES_ECB_PUT,
	CC_REE_FIPS_ERROR_DES_CBC_PUT,
	CC_REE_FIPS_ERROR_SHA1_PUT,
	CC_REE_FIPS_ERROR_SHA256_PUT,
	CC_REE_FIPS_ERROR_SHA512_PUT,
	CC_REE_FIPS_ERROR_HMAC_SHA1_PUT,
	CC_REE_FIPS_ERROR_HMAC_SHA256_PUT,
	CC_REE_FIPS_ERROR_HMAC_SHA512_PUT,
	CC_REE_FIPS_ERROR_ROM_CHECKSUM,
	CC_REE_FIPS_ERROR_RESERVE32B = INT32_MAX
} ssi_fips_error_t;



int ssi_fips_get_state(ssi_fips_state_t *p_state);
int ssi_fips_get_error(ssi_fips_error_t *p_err);

#endif  /*__SSI_FIPS_H__*/

OpenPOWER on IntegriCloud