Documentation fixes

This commit is contained in:
Andrzej Kurek 2018-02-12 09:34:39 -05:00
parent dc5770a62f
commit 024ab067cd
4 changed files with 11 additions and 8 deletions

View file

@ -85,6 +85,7 @@ static inline size_t mbedtls_ecdsa_max_sig_len( size_t bits )
/** The maximal size of an ECDSA signature in Bytes. */
#define MBEDTLS_ECDSA_MAX_LEN (MBEDTLS_ECDSA_MAX_SIG_LEN( \
8 * MBEDTLS_ECP_MAX_BYTES ) )
/**
* \brief The ECDSA context structure.
*/
@ -287,7 +288,7 @@ int mbedtls_ecdsa_write_signature_det( mbedtls_ecdsa_context *ctx,
#endif /* MBEDTLS_ECDSA_DETERMINISTIC */
/**
* \brief Convert a signature from numbers to ASN.1
* \brief Convert an ECDSA signature from number pair format to ASN.1
*
* \param r First number of the signature
* \param s Second number of the signature

View file

@ -470,7 +470,8 @@ int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
* \brief Calculate the size of a signature made with this key.
* \brief Provide an upper bound for the size of a signature made
* with this key.
*
* \param ctx PK context to use
*

View file

@ -4,7 +4,8 @@
* \brief Public Key cryptography abstraction layer: object interface
*
* This file contains the info structure interface used by developers to
* provide engine-specific implementations of opaque key handling functions.
* provide target-specific implementations of opaque key handling functions
* (called engines in the following).
*
* Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
@ -112,7 +113,7 @@ struct mbedtls_pk_info_t
size_t (*get_bitlen)( const void *ctx );
/** Tell if the context implements the algorithm specified by
* the provided type (e.g.\ ECKEY can do ECDSA).
* the provided type (e.g. ECKEY can do ECDSA).
*
* mbedtls_pk_can_do() calls this function.
*
@ -144,7 +145,7 @@ struct mbedtls_pk_info_t
*
* mbedtls_pk_sign() calls this function.
*
* Assume that the buffer \c sig has room for
* Assumes that the buffer \c sig has room for
* \c signature_size_func(ctx) bytes.
*
* The arguments \c f_rng and \c p_rng are provided in case the
@ -154,7 +155,7 @@ struct mbedtls_pk_info_t
* return #MBEDTLS_ERR_PK_BAD_INPUT_DATA otherwise.
*
* Opaque implementations may omit this method if they do not support
* signature. */
* signing. */
int (*sign_func)( void *ctx, mbedtls_md_type_t md_alg,
const unsigned char *hash, size_t hash_len,
unsigned char *sig, size_t *sig_len,

View file

@ -427,13 +427,13 @@ void ecp_ansi_write_group( int id, char *hex )
/* Positive test */
ret = mbedtls_ecp_ansi_write_group( &grp, tested, sizeof( tested ),
&received_len );
&received_len );
TEST_ASSERT( ret == 0 && good_len == (unsigned) received_len );
TEST_ASSERT( memcmp( good, tested, good_len ) == 0 );
/* Buffer too small */
TEST_ASSERT( mbedtls_ecp_ansi_write_group( &grp, tested, good_len - 1,
&received_len ) ==
&received_len ) ==
MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL );
exit: