Elliptic Curve Nyberg-Rueppel

From Crypto++ Wiki
Jump to navigation Jump to search
ECNR
Documentation
#include <cryptopp/eccrypto.h>

Elliptic Curve Nyberg-Rueppel is a signature scheme used in a number of standards, including P1363. It is a variation on ElGamal's original signature scheme, and Crypto++ provides Nyberg-Rueppel rather than ElGamal.

Ján Jančár showed Crypto++ 8.2 and below leaked timing information in elliptic curve gear. You should upgrade to Crypto++ 8.3 and above. Also see Issue 869, Elliptic Curve timing leaks.

A version of Nyberg-Rueppel over integers is available at Nyberg-Rueppel.

Sample Program

ECNR<ECP>::PrivateKey privateKey = ...;
ECNR<ECP>::PublicKey publicKey = ...;

string message = "Yoda said, Do or do not. There is no try.";
string signature;

StringSource ss1( message, true,
  new SignerFilter( prng,
    ECNR<ECP>::Signer(key),
    new StringSink( signature )
  ) // SignerFilter
); // StringSource

bool result = false;
StringSource ss2( message+signature, true,
  new SignatureVerificationFilter(
    ECNR<ECP>::Verifier(key),
    new ArraySink( (byte*)&result, sizeof(result) ),
    SIGNATURE_AT_END | PUT_RESULT
  ) // SignatureVerificationFilter
);

if(result)
  cout << "Verified signature on message." << endl;
else
  cout << "Failed to verify signature on message." << endl;

Downloads

ECNR.zip - Elliptic Curve Nyberg Rueppel (ECNR) sample program.