xref: /optee_os/core/drivers/crypto/caam/acipher/local.h (revision 8bdff4a4c3ac0005b0668ea887528b96110be104)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright 2018-2021 NXP
4  *
5  * CAAM Cipher Local header.
6  */
7 #ifndef __LOCAL_H__
8 #define __LOCAL_H__
9 
10 #include "caam_common.h"
11 
12 /*
13  * Prime generator structure for RSA
14  */
15 struct prime_data_rsa {
16 	uint8_t era;	   /* CAAM Era version */
17 	size_t key_size;   /* Key size in bits */
18 	struct caambuf *e; /* Key exponent e */
19 	struct caambuf *p; /* Prime p */
20 	struct caambuf *q; /* Prime q (can be NULL of only p asked) */
21 };
22 
23 /*
24  * Generate prime numbers for RSA
25  * Algorithm based on the Chapter B.3.3 of the FIPS.184-6 specification
26  *
27  * @data  [in/out] Prime generation data
28  */
29 enum caam_status caam_prime_rsa_gen(struct prime_data_rsa *data);
30 
31 #endif /* __LOCAL_H__ */
32