mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 08:05:45 +01:00
Fixup: Minor style corrections around use of TinyCrypt
This commit is contained in:
parent
e8f1448306
commit
ad353f289b
@ -552,10 +552,13 @@ static int uecc_eckey_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
|
||||
((void) md_alg);
|
||||
p = (unsigned char*) sig;
|
||||
|
||||
if( (ret = extract_ecdsa_sig( &p, sig + sig_len, signature, NUM_ECC_BYTES ) ) != 0 )
|
||||
ret = extract_ecdsa_sig( &p, sig + sig_len, signature, NUM_ECC_BYTES );
|
||||
if( ret != 0 )
|
||||
return( ret );
|
||||
|
||||
if( (ret = uECC_verify( (uint8_t *) ctx, hash, (unsigned) hash_len, signature, uecc_curve ) ) != 0 )
|
||||
ret = uECC_verify( (uint8_t *) ctx, hash,
|
||||
(unsigned) hash_len, signature, uecc_curve );
|
||||
if( ret != 0 )
|
||||
return( MBEDTLS_ERR_PK_SIG_LEN_MISMATCH );
|
||||
|
||||
return( ret );
|
||||
|
@ -554,7 +554,7 @@ static int uecc_public_key_read_binary( uint8_t *pt,
|
||||
if( ilen < 1 )
|
||||
return( MBEDTLS_ERR_PK_INVALID_PUBKEY );
|
||||
|
||||
//We are not handling the infinity point right now
|
||||
/* We are not handling the point at infinity. */
|
||||
|
||||
if( buf[0] != 0x04 )
|
||||
return( MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE );
|
||||
@ -917,7 +917,7 @@ static int pk_parse_key_sec1_der( mbedtls_uecc_keypair *keypair,
|
||||
if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_OCTET_STRING ) ) != 0 )
|
||||
return( MBEDTLS_ERR_PK_KEY_INVALID_FORMAT + ret );
|
||||
|
||||
memcpy(keypair->private_key, p, len);
|
||||
memcpy( keypair->private_key, p, len );
|
||||
|
||||
p += len;
|
||||
|
||||
@ -960,9 +960,11 @@ static int pk_parse_key_sec1_der( mbedtls_uecc_keypair *keypair,
|
||||
return( MBEDTLS_ERR_PK_KEY_INVALID_FORMAT +
|
||||
MBEDTLS_ERR_ASN1_LENGTH_MISMATCH );
|
||||
|
||||
if( ( ret = uecc_public_key_read_binary( keypair->public_key,
|
||||
if( ( ret = uecc_public_key_read_binary( keypair->public_key,
|
||||
(const unsigned char *) p, end2 - p ) ) == 0 )
|
||||
{
|
||||
pubkey_done = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user