|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Software Montgomery modexp - the bignum backend for a vendor with no accelerator. More...
#include "board_drivers/board_profiles/pc_platform.h"#include "crypto/asymmetric/bignum.h"#include "crypto/crypto_opt.h"#include "server/mmgr/secure.h"#include <string.h>Go to the source code of this file.
Classes | |
| struct | PC_CRYPTO_HOT::Group14Ctx |
Namespaces | |
| namespace | PC_CRYPTO_HOT |
Functions | |
| void | bn_expmod_group14 (pc_bignum *out, const pc_bignum *base, const pc_bignum *exp) |
Software Montgomery modexp - the bignum backend for a vendor with no accelerator.
Selected EXPLICITLY by a vendor profile that sets PC_HAS_HW_BIGNUM 0. It is never a fallback: the core declares bn_expmod_group14() and links whatever backend the vendor provides, so linking none is an undefined reference and linking two is a duplicate definition. Both fail the build.
Software crypto is a legitimate choice and on some parts the only one - what must not happen is arriving here by default. This implementation is data-dependent and NOT constant time (SECURITY.md, timing), so a vendor whose silicon can do the modexp in hardware must never end up on it silently; with no weak symbol anywhere in the chain, it cannot.
Definition in file portable_bignum.cpp.
Definition at line 195 of file portable_bignum.cpp.
References pc_span::buf, pc_bignum::d, PC_BN_LIMBS, pc_span_ok(), PC_CRYPTO_HOT::Group14Ctx::r1, PC_CRYPTO_HOT::Group14Ctx::r2, and SecureBorrow::span().
Referenced by ssh_dh_generate(), and ssh_kexdh_handle().