Branch: Tag:

2014-02-22

2014-02-22 12:19:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Crypto.Sign: Added public_key_equal() and _equal().

* public_key_equal() and _equal() added to the common API for
cryptographic signing.

* Implemented _equal() in all current signing algorithms.

* Added public_key_equal() to ECDSA.

81:    return n == rsa->get_n() && e == rsa->get_e();   }    + //! Compares the keys of this RSA object with something other. + protected int(0..1) _equal(mixed other) + { +  if (!objectp(other) || (object_program(other) != object_program(this)) || +  !public_key_equal([object(this_program)]other)) { +  return 0; +  } +  this_program rsa = [object(this_program)]other; +  return d == rsa->get_d(); + } +    //! Sets the private key.   //! @param priv   //! The private RSA exponent, often called d.