Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

  1. #ifndef CRYPTOPP_DSA_H
  2. #define CRYPTOPP_DSA_H
  3. /** \file
  4. */
  5. #include "gfpcrypt.h"
  6. NAMESPACE_BEGIN(CryptoPP)
  7. /*! The DSA signature format used by Crypto++ is as defined by IEEE P1363.
  8. Java uses the DER format, and OpenPGP uses the OpenPGP format. */
  9. enum DSASignatureFormat {DSA_P1363, DSA_DER, DSA_OPENPGP};
  10. /** This function converts between these formats, and returns length of signature in the target format.
  11. If toFormat == DSA_P1363, bufferSize must equal publicKey.SignatureLength() */
  12. size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat,
  13. const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat);
  14. #ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
  15. typedef DSA::Signer DSAPrivateKey;
  16. typedef DSA::Verifier DSAPublicKey;
  17. const int MIN_DSA_PRIME_LENGTH = DSA::MIN_PRIME_LENGTH;
  18. const int MAX_DSA_PRIME_LENGTH = DSA::MAX_PRIME_LENGTH;
  19. const int DSA_PRIME_LENGTH_MULTIPLE = DSA::PRIME_LENGTH_MULTIPLE;
  20. inline bool GenerateDSAPrimes(const byte *seed, size_t seedLength, int &counter, Integer &p, unsigned int primeLength, Integer &q)
  21. {return DSA::GeneratePrimes(seed, seedLength, counter, p, primeLength, q);}
  22. #endif
  23. NAMESPACE_END
  24. #endif