From 6c45741d6a91c5a2f1aedcc4c59f9149e8ee8f78 Mon Sep 17 00:00:00 2001 From: Evgeny Margolis Date: Wed, 2 Mar 2022 02:44:14 -0800 Subject: [PATCH] Minor Update to Spake2pVerifier Serializer APIs (#15703) --- src/crypto/CHIPCryptoPAL.cpp | 4 ++-- src/crypto/CHIPCryptoPAL.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crypto/CHIPCryptoPAL.cpp b/src/crypto/CHIPCryptoPAL.cpp index 20f345eb59871f..6e29a8b8665df2 100644 --- a/src/crypto/CHIPCryptoPAL.cpp +++ b/src/crypto/CHIPCryptoPAL.cpp @@ -515,7 +515,7 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::ComputeW0(uint8_t * w0out, size_t * w0 return CHIP_NO_ERROR; } -CHIP_ERROR Spake2pVerifier::Serialize(MutableByteSpan & outSerialized) +CHIP_ERROR Spake2pVerifier::Serialize(MutableByteSpan & outSerialized) const { VerifyOrReturnError(outSerialized.size() >= kSpake2p_VerifierSerialized_Length, CHIP_ERROR_INVALID_ARGUMENT); @@ -527,7 +527,7 @@ CHIP_ERROR Spake2pVerifier::Serialize(MutableByteSpan & outSerialized) return CHIP_NO_ERROR; } -CHIP_ERROR Spake2pVerifier::Deserialize(ByteSpan inSerialized) +CHIP_ERROR Spake2pVerifier::Deserialize(const ByteSpan & inSerialized) { VerifyOrReturnError(inSerialized.size() >= kSpake2p_VerifierSerialized_Length, CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 9ccbdbd62e79f1..aeab2efa0de674 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -1252,8 +1252,8 @@ class Spake2pVerifier uint8_t mW0[kP256_FE_Length]; uint8_t mL[kP256_Point_Length]; - CHIP_ERROR Serialize(MutableByteSpan & outSerialized); - CHIP_ERROR Deserialize(ByteSpan inSerialized); + CHIP_ERROR Serialize(MutableByteSpan & outSerialized) const; + CHIP_ERROR Deserialize(const ByteSpan & inSerialized); /** * @brief Generate the Spake2+ verifier.