Skip to content

Commit

Permalink
[nrf toup] [Crypto] Stop compiling legacy SPAKE2P if PSA is available
Browse files Browse the repository at this point in the history
If the CHIP_CRYPTO_PSA_SPAKE2P is enabled the build system should
not compile Legacy Spake2p implementation, because the PSA one
is available in the PSASpake2p.cpp file.
  • Loading branch information
ArekBalysNordic authored and bjarki-andreasen committed Sep 25, 2024
1 parent 3cff066 commit cc073ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/crypto/CHIPCryptoPALPSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,9 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t &
return CHIP_NO_ERROR;
}

// We should compile this SPAKE2P implementation only if the PSA implementation is not in use.
#if !CHIP_CRYPTO_PSA_SPAKE2P

typedef struct Spake2p_Context
{
mbedtls_ecp_group curve;
Expand Down Expand Up @@ -1066,5 +1069,7 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointIsValid(void * R)
return CHIP_NO_ERROR;
}

#endif // !CHIP_CRYPTO_PSA_SPAKE2P

} // namespace Crypto
} // namespace chip

0 comments on commit cc073ff

Please sign in to comment.