a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment
briandmyers  ·  4268 days ago  ·  link  ·    ·  parent  ·  post: A simple hexadecimal "bignum" library, in C.

{Edited to point out that there was a bug in here - see later discussion. I've fixed the bug.}

My bad - I meant to include it. Here 'tis :

  ////////////////////////////////////////////////////////////////////////////
  //
  void rsaDecrypt( hex_bignum_t *ciphertext_ptr, hex_bignum_t *plaintext_ptr, rsaKey_t *prikey_ptr )
  {
     modexp( plaintext_ptr, &(prikey_ptr->e), &(prikey_ptr->n), ciphertext_ptr );
  }