summaryrefslogtreecommitdiff
path: root/external/crypto++-5.6.3/dsa.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /external/crypto++-5.6.3/dsa.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'external/crypto++-5.6.3/dsa.h')
-rw-r--r--external/crypto++-5.6.3/dsa.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/external/crypto++-5.6.3/dsa.h b/external/crypto++-5.6.3/dsa.h
new file mode 100644
index 0000000..5e6ef30
--- /dev/null
+++ b/external/crypto++-5.6.3/dsa.h
@@ -0,0 +1,41 @@
+// dsa.h - written and placed in the public domain by Wei Dai
+
+//! \file dsa.h
+//! \brief Classes for the DSA signature algorithm
+
+#ifndef CRYPTOPP_DSA_H
+#define CRYPTOPP_DSA_H
+
+#include "cryptlib.h"
+#include "gfpcrypt.h"
+
+NAMESPACE_BEGIN(CryptoPP)
+
+//! \brief DSA Signature Format
+//! \details The DSA signature format used by Crypto++ is as defined by IEEE P1363.
+//! Java nad .Net use the DER format, and OpenPGP uses the OpenPGP format.
+enum DSASignatureFormat {
+ //! \brief Crypto++ native signature encoding format
+ DSA_P1363,
+ //! \brief signature encoding format used by Java and .Net
+ DSA_DER,
+ //! \brief OpenPGP signature encoding format
+ DSA_OPENPGP
+};
+
+//! \brief Converts between signature encoding formats
+//! \param buffer byte buffer for the converted signature encoding
+//! \param bufferSize the length of the converted signature encoding buffer
+//! \param toFormat the source signature format
+//! \param signature byte buffer for the existing signature encoding
+//! \param signatureLen the length of the existing signature encoding buffer
+//! \param fromFormat the source signature format
+//! \details This function converts between these formats, and returns length
+//! of signature in the target format. If <tt>toFormat == DSA_P1363</tt>, then
+//! <tt>bufferSize</tt> must equal <tt>publicKey.SignatureLength()</tt>
+size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat,
+ const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat);
+
+NAMESPACE_END
+
+#endif