- Increased size of generated value X

This commit is contained in:
Paul Bakker 2009-07-27 21:05:24 +00:00
parent 2b222c830b
commit 2a1fadffd7

View File

@ -106,7 +106,7 @@ int dhm_make_params( dhm_context *ctx, int x_size,
MPI_CHK( mpi_grow( &ctx->X, n ) ); MPI_CHK( mpi_grow( &ctx->X, n ) );
MPI_CHK( mpi_lset( &ctx->X, 0 ) ); MPI_CHK( mpi_lset( &ctx->X, 0 ) );
n = x_size >> 3; n = x_size - 1;
p = (unsigned char *) ctx->X.p; p = (unsigned char *) ctx->X.p;
for( i = 0; i < n; i++ ) for( i = 0; i < n; i++ )
*p++ = (unsigned char) f_rng( p_rng ); *p++ = (unsigned char) f_rng( p_rng );
@ -183,7 +183,7 @@ int dhm_make_public( dhm_context *ctx, int x_size,
MPI_CHK( mpi_grow( &ctx->X, n ) ); MPI_CHK( mpi_grow( &ctx->X, n ) );
MPI_CHK( mpi_lset( &ctx->X, 0 ) ); MPI_CHK( mpi_lset( &ctx->X, 0 ) );
n = x_size >> 3; n = x_size - 1;
p = (unsigned char *) ctx->X.p; p = (unsigned char *) ctx->X.p;
for( i = 0; i < n; i++ ) for( i = 0; i < n; i++ )
*p++ = (unsigned char) f_rng( p_rng ); *p++ = (unsigned char) f_rng( p_rng );