1 Star 0 Fork 0

bubuzi_tool/cryptopp870

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dsa.h 2.19 KB
一键复制 编辑 原始数据 按行查看 历史
布布子 提交于 2022-12-12 16:37 . 初始化提交
// dsa.h - originally 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.
/// OpenSSL, Java and .Net use the DER format, and OpenPGP uses the OpenPGP format.
/// \sa <A HREF="http://www.cryptopp.com/wiki/DSAConvertSignatureFormat">DSAConvertSignatureFormat</A>
/// on the Crypto++ wiki.
/// \since Crypto++ 1.0
enum DSASignatureFormat {
/// \brief Crypto++ native signature encoding format
DSA_P1363,
/// \brief signature encoding format used by OpenSSL, 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
/// \return the number of bytes written during encoding
/// \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> or
/// <tt>verifier.SignatureLength()</tt>.
/// \details If the destination buffer is too small then the output of the
/// encoded <tt>r</tt> and <tt>s</tt> will be truncated. Be sure to provide
/// an adequately sized buffer and check the return value for the number of
/// bytes written.
/// \sa <A HREF="http://www.cryptopp.com/wiki/DSAConvertSignatureFormat">DSAConvertSignatureFormat</A>
/// on the Crypto++ wiki.
/// \since Crypto++ 1.0
size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat,
const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat);
NAMESPACE_END
#endif // CRYPTOPP_DSA_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/bubuzi_tool/cryptopp870.git
git@gitee.com:bubuzi_tool/cryptopp870.git
bubuzi_tool
cryptopp870
cryptopp870
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385