CC26xx Driver Library
rom_bignum.h File Reference
#include <stdint.h>
#include "rom.h"

Functions

uint32_t * INVERT (ECC_State *state, uint32_t *in1)
 Perform a modular inversion of the element at address in in1. More...
 
uint32_t IMPORTMODULUS (uint32_t *out, const uint32_t *in1)
 Imports the integer in LV format found at address in1 into address out in modulus format [0, 0, LSW, ..., MSW]. Returns the wordsize of the imported modulus. More...
 
uint32_t IMPORTOPERAND (ECC_State *state, uint32_t *out, const uint32_t *in1)
 Imports the integer in LV format found at address in1 into address out in operand format [LSW, ..., MSW, 0, ..., 0], making sure that the obtained array has LEN+1 words, thus truncating or right-padding with zeroes as needed. Returns the wordsize of the imported integer. More...
 
uint32_t EXPORTOPERAND (ECC_State *state, uint32_t *out, const uint32_t *in1)
 Exports the integer found at address in1 to address out in LV format [LEN, LSW, ..., MSW]. Returns LEN. More...
 
void SETOPERAND (ECC_State *state, uint32_t *out, uint32_t inValue)
 Writes the 32-bit integer in aux at address out in operand format. More...
 
void mSET (ECC_State *state, uint32_t *in1, uint32_t size)
 Initializes the modulus at address in1 for later modular operations. Completes the modulus with the modulus-specific constant alpha = -1/m mod 2^64. More...
 
void mMULT (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)
 Montgomery modular multiplication out = in1 * in2 * K mod MOD where K is the Montgomery factor K = 2^-(32*LEN) mod MOD. More...
 
void mSUB (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)
 Computes out = in1 - in2 mod MOD. More...
 
void mADD (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)
 Computes out = in1 + in2 mod MOD. More...
 
void mOUT (uint32_t *out, const uint32_t *in1, uint32_t *mod, uint32_t len)
 Computes the scrict modular remainder out = in1 mod MOD < MOD. More...
 
void COPY (uint32_t *out, uint32_t *in1, uint32_t size)
 Copies aux words from address in1 to address out. More...
 
uint8_t GETBIT (uint32_t *in1, uint32_t *in2)
 Extract the bit of given index. More...
 
uint8_t SCALARMUL_init (ECC_State *state)
 Initialization for scalar multiplication. More...