mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-30 03:00:21 -04:00 
			
		
		
		
	Minor changes to comments in hkdf.c
This commit is contained in:
		
							parent
							
								
									1ab9b57148
								
							
						
					
					
						commit
						a61d123e0e
					
				| @ -114,6 +114,10 @@ int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk, | |||||||
|         n++; |         n++; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /*
 | ||||||
|  |      * Per RFC 5869 Section 2.3, okm_len must not exceed | ||||||
|  |      * 255 times the hash length | ||||||
|  |      */ | ||||||
|     if( n > 255 ) |     if( n > 255 ) | ||||||
|     { |     { | ||||||
|         return( MBEDTLS_ERR_HKDF_BAD_INPUT_DATA ); |         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; |         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++ ) |     for( i = 1; i <= n; i++ ) | ||||||
|     { |     { | ||||||
|         size_t num_to_copy; |         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; |             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 ); |         ret = mbedtls_md_hmac_update( &ctx, &c, 1 ); | ||||||
|         if( ret != 0 ) |         if( ret != 0 ) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Brian J Murray
						Brian J Murray