diff options
Diffstat (limited to 'g10/elg.c')
-rw-r--r-- | g10/elg.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -37,7 +37,6 @@ void g10_elg_encrypt( PKT_public_cert *pkc, PKT_pubkey_enc *enc, DEK *dek ) { - ELG_public_key pkey; MPI frame; assert( enc->pubkey_algo == PUBKEY_ALGO_ELGAMAL ); @@ -46,12 +45,9 @@ g10_elg_encrypt( PKT_public_cert *pkc, PKT_pubkey_enc *enc, DEK *dek ) enc->d.elg.b = mpi_alloc( mpi_get_nlimbs(pkc->d.elg.p) ); keyid_from_pkc( pkc, enc->keyid ); frame = encode_session_key( dek, mpi_get_nbits(pkc->d.elg.p) ); - pkey.p = pkc->d.elg.p; - pkey.g = pkc->d.elg.g; - pkey.y = pkc->d.elg.y; if( DBG_CIPHER ) log_mpidump("Plain DEK frame: ", frame); - elg_encrypt( enc->d.elg.a, enc->d.elg.b, frame, &pkey); + elg_encrypt( enc->d.elg.a, enc->d.elg.b, frame, &pkc->d.elg ); mpi_free( frame ); if( DBG_CIPHER ) { log_mpidump("Encry DEK a: ", enc->d.elg.a ); @@ -69,7 +65,6 @@ void g10_elg_sign( PKT_secret_cert *skc, PKT_signature *sig, MD_HANDLE md, int digest_algo ) { - ELG_secret_key skey; MPI frame; byte *dp; @@ -85,12 +80,7 @@ g10_elg_sign( PKT_secret_cert *skc, PKT_signature *sig, sig->d.elg.a = mpi_alloc( mpi_get_nlimbs(skc->d.elg.p) ); sig->d.elg.b = mpi_alloc( mpi_get_nlimbs(skc->d.elg.p) ); frame = encode_md_value( md, mpi_get_nbits(skc->d.elg.p)); - skey.p = skc->d.elg.p; - skey.g = skc->d.elg.g; - skey.y = skc->d.elg.y; - skey.x = skc->d.elg.x; - elg_sign( sig->d.elg.a, sig->d.elg.b, frame, &skey); - memset( &skey, 0, sizeof skey ); + elg_sign( sig->d.elg.a, sig->d.elg.b, frame, &skc->d.elg ); mpi_free(frame); if( opt.verbose ) { char *ustr = get_user_id_string( sig->keyid ); |