mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 11:08:09 +00:00
Minor changes to comments in hkdf.c
This commit is contained in:
parent
1ab9b57148
commit
a61d123e0e
1 changed files with 9 additions and 2 deletions
|
@ -114,6 +114,10 @@ int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
|
|||
n++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Per RFC 5869 Section 2.3, okm_len must not exceed
|
||||
* 255 times the hash length
|
||||
*/
|
||||
if( n > 255 )
|
||||
{
|
||||
return( MBEDTLS_ERR_HKDF_BAD_INPUT_DATA );
|
||||
|
@ -126,7 +130,10 @@ int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
/* RFC 5869 Section 2.3. */
|
||||
/*
|
||||
* Compute T = T(1) | T(2) | T(3) | ... | T(N)
|
||||
* Where T(N) is defined in RFC 5869 Section 2.3
|
||||
*/
|
||||
for( i = 1; i <= n; i++ )
|
||||
{
|
||||
size_t num_to_copy;
|
||||
|
@ -150,7 +157,7 @@ int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
/* The constant concatenated to the end of each t(n) is a single octet.
|
||||
/* The constant concatenated to the end of each T(n) is a single octet.
|
||||
* */
|
||||
ret = mbedtls_md_hmac_update( &ctx, &c, 1 );
|
||||
if( ret != 0 )
|
||||
|
|
Loading…
Reference in a new issue