comparison rsa.c @ 198:65585699d980

* add a "label" argument to printhex() * make some vars static in random.c
author Matt Johnston <matt@ucc.asn.au>
date Tue, 10 May 2005 17:02:05 +0000
parents c9483550701b
children ea9277442ef2
comparison
equal deleted inserted replaced
197:a6eb598d8686 198:65585699d980
331 } 331 }
332 buf_incrwritepos(buf, ssize); 332 buf_incrwritepos(buf, ssize);
333 mp_clear(&rsa_s); 333 mp_clear(&rsa_s);
334 334
335 #if defined(DEBUG_RSA) && defined(DEBUG_TRACE) 335 #if defined(DEBUG_RSA) && defined(DEBUG_TRACE)
336 printhex(buf->data, buf->len); 336 printhex("RSA sig", buf->data, buf->len);
337 #endif 337 #endif
338 338
339 339
340 TRACE(("leave buf_put_rsa_sign")) 340 TRACE(("leave buf_put_rsa_sign"))
341 } 341 }
355 static void rsa_pad_em(rsa_key * key, 355 static void rsa_pad_em(rsa_key * key,
356 const unsigned char * data, unsigned int len, 356 const unsigned char * data, unsigned int len,
357 mp_int * rsa_em) { 357 mp_int * rsa_em) {
358 358
359 /* ASN1 designator (including the 0x00 preceding) */ 359 /* ASN1 designator (including the 0x00 preceding) */
360 const char rsa_asn1_magic[] = 360 const unsigned char rsa_asn1_magic[] =
361 {0x00, 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 361 {0x00, 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b,
362 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14}; 362 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14};
363 #define RSA_ASN1_MAGIC_LEN 16 363 const unsigned int RSA_ASN1_MAGIC_LEN = 16;
364
364 buffer * rsa_EM = NULL; 365 buffer * rsa_EM = NULL;
365 hash_state hs; 366 hash_state hs;
366 unsigned int nsize; 367 unsigned int nsize;
367 368
368 assert(key != NULL); 369 assert(key != NULL);