Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
Using Matter SDK 1.3 with ESP-IDF 5.2.1 on ESP32-C6
Added esp-cryptoauthlib as component, enabled the secure element and enabled CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN in sdkconfig
Used the light example as a template to create a simple light on/off switch Matter endpoint
Launch the commissioning from a smartphone and a Matter compatible app
The commissioning fails reporting this error in ESP log: E (117103) chip[CR]: mbedTLS error: BIGNUM - The buffer is too small to write to
Bug prevalence
Always
GitHub hash of the SDK that was being used
82748b9f0e5a4cdc4d10715f10c6160d49d87e75
Platform
esp32-c6
Platform Version(s)
ESP-IDF 5.2.1
Anything else?
Without the step 2, i.e. removing the esp-cryptoauthlib and disable the CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN flag the commissioning works perfectly.
Insepcting the SDK code it seems the error comes from P256Keypair::ECDSA_sign_msg method in config/esp32/third_party/connectedhomeip/src/crypto/CHIPCryptoPALmbedTLS.cpp file and the call to method mbedtls_ecdsa_sign returns the error.
I report the error log:
I (117073) chip[ZCL]: OpCreds: Received an AttestationRequest command
I (117083) chip[EM]: <<< [E:27454r S:61872 M:244198318 (Ack:142956033)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [UDP:192.168.1.121:28710] --- Type 0000:10 (SecureChannel:StandaloneAck)
D (117093) chip[EM]: Flushed pending ack for MessageCounter:142956033 on exchange 27454r
E (117103) chip[CR]: mbedTLS error: BIGNUM - The buffer is too small to write to
E (117123) chip[DMG]: Endpoint=0 Cluster=0x0000_003E Command=0x0000_0000 status 0x01 (no additional context)
D (117133) chip[DMG]: Command handler moving to [NewRespons]
Reproduction steps
CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN
in sdkconfiglight
example as a template to create a simple light on/off switch Matter endpointE (117103) chip[CR]: mbedTLS error: BIGNUM - The buffer is too small to write to
Bug prevalence
Always
GitHub hash of the SDK that was being used
82748b9f0e5a4cdc4d10715f10c6160d49d87e75
Platform
esp32-c6
Platform Version(s)
ESP-IDF 5.2.1
Anything else?
Without the step 2, i.e. removing the
esp-cryptoauthlib
and disable theCONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN
flag the commissioning works perfectly. Insepcting the SDK code it seems the error comes fromP256Keypair::ECDSA_sign_msg
method inconfig/esp32/third_party/connectedhomeip/src/crypto/CHIPCryptoPALmbedTLS.cpp
file and the call to methodmbedtls_ecdsa_sign
returns the error. I report the error log: