rlib
Convenience library for useful things
Loading...
Searching...
No Matches

Heap-backed multi-precision integer. More...

#include <rlib/data/rmpint.h>

Data Fields

ruint16 dig_alloc
 
ruint16 dig_used
 
ruint32 sign
 
ruint32 flags
 Behaviour flags, currently only R_MPINT_FLAG_SECURE_CLEAR.
 
rmpint_digitdata
 

Detailed Description

Heap-backed multi-precision integer.

Stores a sign-magnitude representation: the absolute value lives in data[0 .. dig_used) (little-endian per-digit), with the sign carried separately. dig_alloc is the allocated capacity; the storage grows as values do.

Field Documentation

◆ data

rmpint_digit* rmpint::data

Digit array; little-endian.

◆ dig_alloc

ruint16 rmpint::dig_alloc

Allocated digit capacity.

◆ dig_used

ruint16 rmpint::dig_used

Digits actually carrying value.

◆ flags

ruint32 rmpint::flags

Behaviour flags, currently only R_MPINT_FLAG_SECURE_CLEAR.

Set R_MPINT_FLAG_SECURE_CLEAR on any mpint that carries a secret (private scalars, nonces, intermediate plaintexts) so the buffer is wiped via r_memclear_secure on r_mpint_clear, never leaking into freed heap.

◆ sign

ruint32 rmpint::sign

Non-zero for negative values.


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