1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 
8 #ifndef LLF_RSA_PRIVATE_H
9 #define LLF_RSA_PRIVATE_H
10 
11 /*
12  * All the includes that are needed for code using this module to
13  * compile correctly should be #included here.
14  */
15 
16 #include "cc_error.h"
17 #include "cc_rsa_types.h"
18 
19 
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 
26 typedef union {
27     struct {
28 /* the Barrett mod N tag  NP for N-modulus - used in the modular multiplication and
29   exponentiation, calculated in CC_RsaPrivKeyBuild function */
30         uint32_t NP[CC_PKA_BARRETT_MOD_TAG_BUFF_SIZE_IN_WORDS];
31 
32     }NonCrt;
33 
34     struct {
35 /* the Barrett mod P tag  PP for P-factor - used in the modular multiplication and
36   exponentiation, calculated in CC_RsaPrivKeyBuild function */
37         uint32_t PP[CC_PKA_BARRETT_MOD_TAG_BUFF_SIZE_IN_WORDS];
38 
39 /* the Barrett mod Q tag  QP for Q-factor - used in the modular multiplication and
40   exponentiation, calculated in CC_RsaPubKeyBuild function */
41         uint32_t QP[CC_PKA_BARRETT_MOD_TAG_BUFF_SIZE_IN_WORDS];
42 
43     }Crt;
44 
45 }RsaPrivKeyDb_t;
46 
47 CCError_t RsaInitPrivKeyDb(CCRsaPrivKey_t *pPrivKey);
48 
49 CCError_t RsaExecPrivKeyExp(CCRsaPrivKey_t    *pPrivKey,
50             CCRsaPrimeData_t *pPrivData);
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif
57