Botan: Botan::RSA_Public_Operation Class Reference

Botan 1.10.12

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::RSA_Public_Operation Class Reference

`#include <rsa.h>`

Inheritance diagram for Botan::RSA_Public_Operation:

## Public Member Functions
SecureVector< byte > | encrypt (const byte msg[], size_t msg_len, RandomNumberGenerator &)
size_t | max_input_bits () const
virtual size_t | message_part_size () const
virtual size_t | message_parts () const
| RSA_Public_Operation (const RSA_PublicKey &rsa)
virtual bool | verify (const byte[], size_t, const byte[], size_t)
SecureVector< byte > | verify_mr (const byte msg[], size_t msg_len)
bool | with_recovery () const

## Detailed Description

RSA public (encrypt/verify) operation

Definition at line 116 of file rsa.h.

## Constructor & Destructor Documentation

Botan::RSA_Public_Operation::RSA_Public_Operation | ( | const RSA_PublicKey & | rsa | ) |
| inline

Definition at line 120 of file rsa.h.

120 :
121 n(rsa.get_n()), powermod_e_n(rsa.get_e(), rsa.get_n())
122 {}

## Member Function Documentation

SecureVector<byte> Botan::RSA_Public_Operation::encrypt | ( | const byte | msg[],
|  | size_t | msg_len,
|  | RandomNumberGenerator & |
| ) |  |
| inlinevirtual

Implements Botan::PK_Ops::Encryption.

Definition at line 127 of file rsa.h.

References Botan::BigInt::encode_1363(), and m.

129 {
130 BigInt m(msg, msg_len);
131 return BigInt::encode_1363(public_op(m), n.bytes());
132 }
m
endian little unaligned ok family x86< aliases > ia32 x86 ix86 i86pc x86pc bepc</aliases >< submodels > i386 i486 i586 i686 pentium2 pentium3 pentium4 pentium m prescott k6 athlon atom32</submodels >< submodel_aliases > pentium i586 pentiumpro i686 pentium_pro i686 pentium2 pentium2 pentiumii pentium2 pentium3 pentium3 pentiumiii pentium3 x86family5 i586 x86family6 i686 pentiumm pentium m intelpentiumm pentium m intelpentium4 pentium4 duron athlon athlon xp athlon k7 athlon p2 i686 p3 i686 p4 pentium4 intelcput2250 prescott intelcput2300 prescott intelcput2400 prescott intelcput2500 prescott intelcput2600 prescott intelcput2700 prescott</submodel_aliases >< isa_extn > pentium m
Definition: x86_32.txt:65
Botan::BigInt::encode_1363
static SecureVector< byte > encode_1363(const BigInt &n, size_t bytes)
Definition: big_code.cpp:78
Botan::BigInt::bytes
size_t bytes() const
Definition: bigint.cpp:245

size_t Botan::RSA_Public_Operation::max_input_bits | ( |  | ) | const
| inlinevirtual

Implements Botan::PK_Ops::Encryption.

Definition at line 124 of file rsa.h.

124 { return (n.bits() - 1); }
Botan::BigInt::bits
size_t bits() const
Definition: bigint.cpp:253

virtual size_t Botan::PK_Ops::Verification::message_part_size | ( |  | ) | const
| inlinevirtualinherited

Find out the message part size supported by this scheme/key.

Returns
  size of the message parts

Reimplemented in Botan::ECDSA_Verification_Operation, Botan::DSA_Verification_Operation, and Botan::NR_Verification_Operation.

Definition at line 104 of file pk_ops.h.

104 { return 0; }

virtual size_t Botan::PK_Ops::Verification::message_parts | ( |  | ) | const
| inlinevirtualinherited

Find out the number of message parts supported by this scheme.

Returns
  number of message parts

Reimplemented in Botan::ECDSA_Verification_Operation, Botan::DSA_Verification_Operation, and Botan::NR_Verification_Operation.

Definition at line 98 of file pk_ops.h.

98 { return 1; }

virtual bool Botan::PK_Ops::Verification::verify | ( | const byte | [],
|  | size_t | ,
|  | const byte | [],
|  | size_t |
| ) |  |
| inlinevirtualinherited

Reimplemented in Botan::ECDSA_Verification_Operation, and Botan::DSA_Verification_Operation.

Definition at line 120 of file pk_ops.h.

122 {
123 throw Invalid_State("Message recovery required");
124 }

SecureVector<byte> Botan::RSA_Public_Operation::verify_mr | ( | const byte | msg[],
|  | size_t | msg_len
| ) |  |
| inlinevirtual

Reimplemented from Botan::PK_Ops::Verification.

Definition at line 134 of file rsa.h.

References Botan::BigInt::encode(), and m.

135 {
136 BigInt m(msg, msg_len);
137 return BigInt::encode(public_op(m));
138 }
Botan::BigInt::encode
static SecureVector< byte > encode(const BigInt &n, Base base=Binary)
Definition: big_code.cpp:64
m
endian little unaligned ok family x86< aliases > ia32 x86 ix86 i86pc x86pc bepc</aliases >< submodels > i386 i486 i586 i686 pentium2 pentium3 pentium4 pentium m prescott k6 athlon atom32</submodels >< submodel_aliases > pentium i586 pentiumpro i686 pentium_pro i686 pentium2 pentium2 pentiumii pentium2 pentium3 pentium3 pentiumiii pentium3 x86family5 i586 x86family6 i686 pentiumm pentium m intelpentiumm pentium m intelpentium4 pentium4 duron athlon athlon xp athlon k7 athlon p2 i686 p3 i686 p4 pentium4 intelcput2250 prescott intelcput2300 prescott intelcput2400 prescott intelcput2500 prescott intelcput2600 prescott intelcput2700 prescott</submodel_aliases >< isa_extn > pentium m
Definition: x86_32.txt:65

bool Botan::RSA_Public_Operation::with_recovery | ( |  | ) | const
| inlinevirtual

Returns
  boolean specifying if this key type supports message recovery and thus if you need to call verify() or verify_mr()

Implements Botan::PK_Ops::Verification.

Definition at line 125 of file rsa.h.

125 { return true; }

The documentation for this class was generated from the following file:

- src/pubkey/rsa/rsa.h