|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
RSA-2048 PKCS#1 v1.5 verify + software sign (see rsa.h). More...
#include "crypto/asymmetric/rsa.h"#include "crypto/crypto_opt.h"#include "crypto/crypto_scratch.h"#include "crypto/hash/sha256.h"#include "crypto/hash/sha512.h"#include "server/mmgr/secure.h"#include <string.h>#include <mbedtls/md.h>#include <mbedtls/rsa.h>Go to the source code of this file.
Functions | |
| int | pc_rsa_verify (const uint8_t n_be[PC_RSA_KEY_BYTES], const uint8_t e_be4[4], const uint8_t *msg, size_t msg_len, const uint8_t *sig, size_t sig_len, pc_rsa_hash hash) |
Verify an RSA-2048 PKCS#1 v1.5 signature over msg. | |
Variables | |
| PC_CRYPTO_HOT const uint8_t | pc_pkcs1_sha256_digestinfo [PC_PKCS1_DIGESTINFO_LEN] |
| The DER-encoded DigestInfo wrapper for SHA-256 (prepend to the 32-byte digest). | |
| const uint8_t | pc_pkcs1_sha512_digestinfo [PC_PKCS1_SHA512_DIGESTINFO_LEN] |
| The DER-encoded DigestInfo wrapper for SHA-512 (prepend to the 64-byte digest). | |
RSA-2048 PKCS#1 v1.5 verify + software sign (see rsa.h).
Verify: mbedtls on Arduino (hardware/mbedTLS), software full-width modexp on native. Software sign (native) is the test reference path. Protocol-agnostic - raw big-endian key material in, no SSH.
Definition in file rsa.cpp.
| int pc_rsa_verify | ( | const uint8_t | n_be[PC_RSA_KEY_BYTES], |
| const uint8_t | e_be4[4], | ||
| const uint8_t * | msg, | ||
| size_t | msg_len, | ||
| const uint8_t * | sig, | ||
| size_t | sig_len, | ||
| pc_rsa_hash | hash | ||
| ) |
Verify an RSA-2048 PKCS#1 v1.5 signature over msg.
| n_be | Modulus n, 256 bytes big-endian. |
| e_be4 | Public exponent e, 4 bytes big-endian (typically 65537). |
| msg | Message that was signed (this hashes it; do not pre-hash). |
| msg_len | Message length. |
| sig | Signature, big-endian. |
| sig_len | Signature length (must equal PC_RSA_KEY_BYTES). |
| hash | Digest algorithm (SHA-256 / SHA-512). |
Definition at line 55 of file rsa.cpp.
References PC_RSA_KEY_BYTES, pc_sha256(), PC_SHA256_DIGEST_LEN, pc_sha512(), PC_SHA512_DIGEST_LEN, and SHA512.
| PC_CRYPTO_HOT const uint8_t pc_pkcs1_sha256_digestinfo[PC_PKCS1_DIGESTINFO_LEN] |
| const uint8_t pc_pkcs1_sha512_digestinfo[PC_PKCS1_SHA512_DIGESTINFO_LEN] |