|
Botan
1.11.15
|
#include <ecdsa_sig.h>
Public Member Functions | |
| std::vector< byte > | DER_encode () const |
| ECDSA_Signature () | |
| ECDSA_Signature (const BigInt &r, const BigInt &s) | |
| ECDSA_Signature (const std::vector< byte > &ber) | |
| std::vector< byte > | get_concatenation () const |
| const BigInt & | get_r () const |
| const BigInt & | get_s () const |
| bool | operator== (const ECDSA_Signature &other) const |
Friends | |
| class | ECDSA_Signature_Decoder |
Class representing an ECDSA signature
Definition at line 21 of file ecdsa_sig.h.
| Botan::ECDSA_Signature::ECDSA_Signature | ( | ) | [inline] |
Definition at line 26 of file ecdsa_sig.h.
{}
| Botan::ECDSA_Signature::ECDSA_Signature | ( | const BigInt & | r, |
| const BigInt & | s | ||
| ) | [inline] |
Definition at line 27 of file ecdsa_sig.h.
:
m_r(r), m_s(s) {}
| Botan::ECDSA_Signature::ECDSA_Signature | ( | const std::vector< byte > & | ber | ) |
Definition at line 13 of file ecdsa_sig.cpp.
References Botan::BER_Decoder::decode(), Botan::BER_Decoder::end_cons(), Botan::SEQUENCE, Botan::BER_Decoder::start_cons(), and Botan::BER_Decoder::verify_end().
{
BER_Decoder(ber)
.start_cons(SEQUENCE)
.decode(m_r)
.decode(m_s)
.end_cons()
.verify_end();
}
| std::vector< byte > Botan::ECDSA_Signature::DER_encode | ( | ) | const |
Definition at line 23 of file ecdsa_sig.cpp.
References Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::get_contents_unlocked(), get_r(), get_s(), Botan::SEQUENCE, and Botan::DER_Encoder::start_cons().
Referenced by Botan::EAC1_1_obj< EAC1_1_Req >::check_signature().
| std::vector< byte > Botan::ECDSA_Signature::get_concatenation | ( | ) | const |
return the r||s
Definition at line 33 of file ecdsa_sig.cpp.
References Botan::BigInt::bytes(), Botan::BigInt::encode_1363(), and Botan::unlock().
Referenced by Botan::EAC1_1_obj< EAC1_1_Req >::get_concat_sig().
{
// use the larger
const size_t enc_len = m_r > m_s ? m_r.bytes() : m_s.bytes();
const auto sv_r = BigInt::encode_1363(m_r, enc_len);
const auto sv_s = BigInt::encode_1363(m_s, enc_len);
secure_vector<byte> result(sv_r);
result += sv_s;
return unlock(result);
}
| const BigInt& Botan::ECDSA_Signature::get_r | ( | ) | const [inline] |
Definition at line 32 of file ecdsa_sig.h.
Referenced by DER_encode(), and operator==().
{ return m_r; }
| const BigInt& Botan::ECDSA_Signature::get_s | ( | ) | const [inline] |
Definition at line 33 of file ecdsa_sig.h.
Referenced by DER_encode(), and operator==().
{ return m_s; }
| bool Botan::ECDSA_Signature::operator== | ( | const ECDSA_Signature & | other | ) | const [inline] |
friend class ECDSA_Signature_Decoder [friend] |
Definition at line 24 of file ecdsa_sig.h.
1.7.6.1