You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Spake2p cryptographic class is currently part of the Crypto PAL within the CHIPCryptoPAL.h file. It uses raw keys and has many methods that are not needed for the PSA (Platform Security Architecture) version.
To improve organization and flexibility, we can restructure the Spake2p code as follows:
1. Create a base interface class for Spake2p with these virtual methods:
Init()
Clear()
BeginVerifier()
BeginProver()
ComputeRoundOne()
ComputeRoundTwo()
KeyConfirm()
GetKeys()
2. Develop a RawKey Spake2p class that extends the base interface. This class will implement methods related to finite element and point operations, such as:
FELoad()
FEWrite()
FEGenerate()
FEMul()
PointLoad()
PointWrite()
PointMul()
PointAddMul()
PointInvert()
PointCofactorMul()
PointIsValid()
ComputeW0()
ComputeL()
3. The RawKey Spake2p class should also define an interface for cryptographic methods that will be provided by MbedTLS or OpenSSL:
InitImpl()
Hash()
HashFinalize()
Mac()
MacVerify()
KDF()
By doing this, we will have a clear Spake2p base interface that can be used for different implementations, leading to better-organized code. The new structure will result in the following implementations:
PSA_Spake2p_P256_SHA256_HKDF_HMAC derived from the Spake2p base interface.
RawKey_Spake2p_P256_SHA256_HKDF_HMAC also derived from the Spake2p base interface.
An MbedTLS version of the RawKey_Spake2p_P256_SHA256_HKDF_HMAC interface to handle specific cryptographic operations.
An OpenSSL version of the RawKey_Spake2p_P256_SHA256_HKDF_HMAC interface to handle specific cryptographic operations.
In the CHIPCryptoPAL.h file or the GN configuration, we should select the appropriate Spake2p version based on the cryptographic backend in use. This chosen version will then be utilized in the PASESession.
This extracting will help use the Spake2p implementation proposed in this PR: #32924 and remove choosing between RawKey spake2+ and PSA spake2+ from the PASESession.h file.
Platform
all
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Feature description
The Spake2p cryptographic class is currently part of the Crypto PAL within the CHIPCryptoPAL.h file. It uses raw keys and has many methods that are not needed for the PSA (Platform Security Architecture) version.
To improve organization and flexibility, we can restructure the Spake2p code as follows:
1. Create a base interface class for Spake2p with these virtual methods:
2. Develop a RawKey Spake2p class that extends the base interface. This class will implement methods related to finite element and point operations, such as:
3. The RawKey Spake2p class should also define an interface for cryptographic methods that will be provided by MbedTLS or OpenSSL:
By doing this, we will have a clear Spake2p base interface that can be used for different implementations, leading to better-organized code. The new structure will result in the following implementations:
PSA_Spake2p_P256_SHA256_HKDF_HMAC
derived from the Spake2p base interface.RawKey_Spake2p_P256_SHA256_HKDF_HMAC
also derived from the Spake2p base interface.RawKey_Spake2p_P256_SHA256_HKDF_HMAC
interface to handle specific cryptographic operations.RawKey_Spake2p_P256_SHA256_HKDF_HMAC
interface to handle specific cryptographic operations.In the
CHIPCryptoPAL.h
file or the GN configuration, we should select the appropriate Spake2p version based on the cryptographic backend in use. This chosen version will then be utilized in the PASESession.This extracting will help use the Spake2p implementation proposed in this PR: #32924 and remove choosing between RawKey spake2+ and PSA spake2+ from the PASESession.h file.
Platform
all
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: