dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::crypto::rsa Class Reference

an RSA public key of up to 4096 bits: the signature verification of RSASSA-PKCS1-v1_5 (RFC 8017 8.2.2) More...

#include <dx_crypto_rsa.h>

Classes

struct  sha256_digestinfo
 SHA-256's DigestInfo for verify(): the DER prefix and the digest. More...

Public Member Functions

bool key (const uint8_t *modulus, size_t ms, const uint8_t *exponent, size_t exponents) noexcept
 the key: modulus and public exponent as big endian bytes (an INTEGER's content); false when the modulus is even, too large or the exponent 0
bool power (const uint8_t *signature, size_t size, uint8_t *out) noexcept
 the encoded message EM= signature^e mod n as bytes: false when the signature is not one of this key (size, or no smaller than n)
bool verify (const uint8_t *digestinfo, size_t size, const uint8_t *signature, size_t signatures) noexcept
 RSASSA-PKCS1-v1_5 verification: EM= 00 01 FF.. 00 T, T the DigestInfo (RFC 8017 9.2) - at least 8 FF octets.

Static Public Attributes

static constexpr size_t bits = 4096
static constexpr size_t limbs = bits/ 32

Detailed Description

an RSA public key of up to 4096 bits: the signature verification of RSASSA-PKCS1-v1_5 (RFC 8017 8.2.2)

Verification only - no private key ever - so the arithmetic (Montgomery products, base 2^32) needs no constant time; the work buffers are members, the stack stays small for the kernel.

Member Function Documentation

◆ key()

bool dx::crypto::rsa::key ( const uint8_t * modulus,
size_t ms,
const uint8_t * exponent,
size_t exponents )
inlinenoexcept

the key: modulus and public exponent as big endian bytes (an INTEGER's content); false when the modulus is even, too large or the exponent 0

◆ power()

bool dx::crypto::rsa::power ( const uint8_t * signature,
size_t size,
uint8_t * out )
inlinenoexcept

the encoded message EM= signature^e mod n as bytes: false when the signature is not one of this key (size, or no smaller than n)

Here is the caller graph for this function:

◆ verify()

bool dx::crypto::rsa::verify ( const uint8_t * digestinfo,
size_t size,
const uint8_t * signature,
size_t signatures )
inlinenoexcept

RSASSA-PKCS1-v1_5 verification: EM= 00 01 FF.. 00 T, T the DigestInfo (RFC 8017 9.2) - at least 8 FF octets.

Here is the call graph for this function:

Member Data Documentation

◆ bits

size_t dx::crypto::rsa::bits = 4096
staticconstexpr

◆ limbs

size_t dx::crypto::rsa::limbs = bits/ 32
static

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

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.