From ed0b0e09d3eb529dc83fab4f24d4fc3abe649bd2 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 31 Dec 1999 11:44:29 +0000 Subject: See ChangeLog: Fri Dec 31 12:48:31 CET 1999 Werner Koch --- cipher/primegen.c | 3 ++- cipher/pubkey.c | 24 ++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'cipher') diff --git a/cipher/primegen.c b/cipher/primegen.c index 1ad163332..450337905 100644 --- a/cipher/primegen.c +++ b/cipher/primegen.c @@ -241,7 +241,8 @@ generate_elg_prime( int mode, unsigned pbits, unsigned qbits, mpi_add_ui(g, g, 1); if( DBG_CIPHER ) { log_debug("checking g: "); - mpi_print( stderr, g, 1 ); + /*mpi_print( stderr, g, 1 );*/ + #warning we need an internal mpi_print for debugging } else progress('^'); diff --git a/cipher/pubkey.c b/cipher/pubkey.c index 4b2c55e41..86b797df2 100644 --- a/cipher/pubkey.c +++ b/cipher/pubkey.c @@ -635,6 +635,17 @@ release_mpi_array( MPI *array ) * * Returns: A pointer to an allocated array of MPIs if the return value is * zero; the caller has to release this array. + * + * Example of a DSA public key: + * (private-key + * (dsa + * (p ) + * (g ) + * (y ) + * (x ) + * ) + * ) + * The are expected to be in GCRYMPI_FMT_USG */ static int sexp_to_key( GCRY_SEXP sexp, int want_private, MPI **retarray, int *retalgo) @@ -783,8 +794,8 @@ gcry_pk_decrypt( GCRY_SEXP *result, GCRY_SEXP data, GCRY_SEXP skey ) /**************** * Create a signature. * - * Caller has to provide a secret kez as the SEXP skey and data expressed - * as a SEXP list hash with only one emelennt which should instantly be + * Caller has to provide a secret key as the SEXP skey and data expressed + * as a SEXP list hash with only one element which should instantly be * available as a MPI. Later versions of this functions may provide padding * and other things depending on data. * @@ -793,6 +804,15 @@ gcry_pk_decrypt( GCRY_SEXP *result, GCRY_SEXP data, GCRY_SEXP skey ) * signature value; the structure of this signature depends on the * other arguments but is always suitable to be passed to * gcry_pk_verify + * + * s_hash = () + * s_skey = + * r_sig = (sig-val + * ( + * ( ) + * ... + * ( ) + * )) */ int gcry_pk_sign( GCRY_SEXP *r_sig, GCRY_SEXP s_hash, GCRY_SEXP s_skey ) -- cgit v1.2.3