Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

# dsa.h

Go to the documentation of this file.

    00001 #ifndef CRYPTOPP_DSA_H
    00002 #define CRYPTOPP_DSA_H
    00003
    00004 /** \file
    00005 */
    00006
    00007 #include "gfpcrypt.h"
    00008
    00009 NAMESPACE_BEGIN(CryptoPP)
    00010
    00011 /*! The DSA signature format used by Crypto++ is as defined by IEEE P1363.
    00012   Java uses the DER format, and OpenPGP uses the OpenPGP format. */
    00013 enum DSASignatureFormat {DSA_P1363, DSA_DER, DSA_OPENPGP};
    00014 /** This function converts between these formats, and returns length of signature in the target format.
    00015         If toFormat == DSA_P1363, bufferSize must equal publicKey.SignatureLength() */
    00016 unsigned int DSAConvertSignatureFormat(byte *buffer, unsigned int bufferSize, DSASignatureFormat toFormat,
    00017         const byte *signature, unsigned int signatureLen, DSASignatureFormat fromFormat);
    00018
    00019 #ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
    00020
    00021 typedef DSA::Signer DSAPrivateKey;
    00022 typedef DSA::Verifier DSAPublicKey;
    00023
    00024 const int MIN_DSA_PRIME_LENGTH = DSA::MIN_PRIME_LENGTH;
    00025 const int MAX_DSA_PRIME_LENGTH = DSA::MAX_PRIME_LENGTH;
    00026 const int DSA_PRIME_LENGTH_MULTIPLE = DSA::PRIME_LENGTH_MULTIPLE;
    00027
    00028 inline bool GenerateDSAPrimes(const byte *seed, unsigned int seedLength, int &counter, Integer &p, unsigned int primeLength, Integer &q)
    00029         {return DSA::GeneratePrimes(seed, seedLength, counter, p, primeLength, q);}
    00030
    00031 #endif
    00032
    00033 NAMESPACE_END
    00034
    00035 #endif