mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Prepare for ECDH point blinding just in case
This commit is contained in:
		
							parent
							
								
									c972770f78
								
							
						
					
					
						commit
						c83e418149
					
				@ -44,6 +44,9 @@ typedef struct
 | 
				
			|||||||
    ecp_point Qp;       /*!<  peer's public value       */
 | 
					    ecp_point Qp;       /*!<  peer's public value       */
 | 
				
			||||||
    mpi z;              /*!<  shared secret             */
 | 
					    mpi z;              /*!<  shared secret             */
 | 
				
			||||||
    int point_format;   /*!<  format for point export   */
 | 
					    int point_format;   /*!<  format for point export   */
 | 
				
			||||||
 | 
					    ecp_point Vi;       /*!<  blinding value (for later)    */
 | 
				
			||||||
 | 
					    ecp_point Vf;       /*!<  un-blinding value (for later) */
 | 
				
			||||||
 | 
					    mpi _d;             /*!<  previous d                    */
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
ecdh_context;
 | 
					ecdh_context;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -85,12 +85,7 @@ cleanup:
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
void ecdh_init( ecdh_context *ctx )
 | 
					void ecdh_init( ecdh_context *ctx )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    ecp_group_init( &ctx->grp );
 | 
					    memset( ctx, 0, sizeof( ecdh_context ) );
 | 
				
			||||||
    mpi_init      ( &ctx->d   );
 | 
					 | 
				
			||||||
    ecp_point_init( &ctx->Q   );
 | 
					 | 
				
			||||||
    ecp_point_init( &ctx->Qp  );
 | 
					 | 
				
			||||||
    mpi_init      ( &ctx->z   );
 | 
					 | 
				
			||||||
    ctx->point_format = POLARSSL_ECP_PF_UNCOMPRESSED;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
@ -106,6 +101,9 @@ void ecdh_free( ecdh_context *ctx )
 | 
				
			|||||||
    ecp_point_free( &ctx->Q   );
 | 
					    ecp_point_free( &ctx->Q   );
 | 
				
			||||||
    ecp_point_free( &ctx->Qp  );
 | 
					    ecp_point_free( &ctx->Qp  );
 | 
				
			||||||
    mpi_free      ( &ctx->z   );
 | 
					    mpi_free      ( &ctx->z   );
 | 
				
			||||||
 | 
					    ecp_point_free( &ctx->Vi  );
 | 
				
			||||||
 | 
					    ecp_point_free( &ctx->Vf  );
 | 
				
			||||||
 | 
					    mpi_free      ( &ctx->_d  );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user