[ecdsa] fix -Wimplicit-int-conversion warnings (#3382)

This commit is contained in:
Jonathan Hui
2018-12-17 09:28:43 -08:00
committed by GitHub
parent 4e331fec9b
commit 5b0ba23c10
+2 -2
View File
@@ -82,7 +82,7 @@ otError Ecdsa::Sign(uint8_t * aOutput,
// Concatenate the two octet sequences in the order R and then S.
VerifyOrExit(mbedtls_mpi_write_binary(&rMpi, aOutput, mbedtls_mpi_size(&rMpi)) == 0, error = OT_ERROR_FAILED);
*aOutputLength = mbedtls_mpi_size(&rMpi);
*aOutputLength = static_cast<uint16_t>(mbedtls_mpi_size(&rMpi));
VerifyOrExit(mbedtls_mpi_write_binary(&sMpi, aOutput + *aOutputLength, mbedtls_mpi_size(&sMpi)) == 0,
error = OT_ERROR_FAILED);
@@ -99,7 +99,7 @@ exit:
int Ecdsa::FillRandom(void *, unsigned char *aBuffer, size_t aSize)
{
Random::FillBuffer(aBuffer, aSize);
Random::FillBuffer(aBuffer, static_cast<uint16_t>(aSize));
return 0;
}