1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #define CC_PAL_LOG_CUR_COMPONENT CC_LOG_MASK_CC_API
8 
9 #ifndef _SRP_H
10 #define _SRP_H
11 
12 #include "mbedtls_cc_srp.h"
13 
14 
15 
16 uint32_t  SrpPwdVerifierCalc(mbedtls_srp_digest xBuff,
17         mbedtls_srp_modulus pwdVerifier,
18         mbedtls_srp_context *pCtx);
19 
20 /* calculates S=(((A*v^u)^b)%N */
21 uint32_t   SrpHostSharedSecretCalc(mbedtls_srp_modulus   userPubKeyA,
22         mbedtls_srp_modulus pwdVerifier,
23         mbedtls_srp_digest uScramble,
24                 mbedtls_srp_modulus  sessionKey,
25                 mbedtls_srp_context  *pCtx);
26 
27 
28 // Use PKA to calculate S=((B-g^x)^(a+u*x))%N
29 uint32_t   SrpUserSharedSecretCalc(mbedtls_srp_modulus  hostPubKeyB,
30         mbedtls_srp_digest    xBuff,
31         mbedtls_srp_digest    uScramble,
32                 mbedtls_srp_modulus   sessionKey,
33                 mbedtls_srp_context   *pCtx);
34 
35 /* calculates B = (k*v+ g^b)%N */
36 uint32_t  SrpHostPublicKeyCalc(mbedtls_srp_modulus  pwdVerifier,    // in
37         mbedtls_srp_modulus hostPubKey,     // out
38         mbedtls_srp_context *pCtx);
39 
40 /* calculates A = (g^a)%N */
41 uint32_t  SrpUserPublicKeyCalc(mbedtls_srp_modulus  userPubKeyA,    // out
42         mbedtls_srp_context *pCtx);
43 
44 #endif
45 
46