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

Typedefs

typedef uint8_t(* scalarmul_init_t) (ECC_State *state)
 
typedef uint32_t *(* invert_t) (ECC_State *state, uint32_t *in1)
 
typedef uint32_t(* importmodulus_t) (uint32_t *out, const uint32_t *in1)
 
typedef uint32_t(* importoperand_t) (ECC_State *state, uint32_t *out, const uint32_t *in1)
 
typedef uint32_t(* exportoperand_t) (ECC_State *state, uint32_t *out, const uint32_t *in1)
 
typedef void(* setoperand_t) (ECC_State *state, uint32_t *out, uint32_t inValue)
 
typedef void(* mset_t) (ECC_State *state, uint32_t *in1, uint32_t size)
 
typedef void(* mmult_t) (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)
 
typedef void(* msub_t) (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)
 
typedef void(* madd_t) (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)
 
typedef void(* mout_t) (uint32_t *out, const uint32_t *in1, uint32_t *mod, uint32_t len)
 
typedef void(* copy_t) (uint32_t *out, uint32_t *in1, uint32_t size)
 
typedef uint8_t(* getbit_t) (uint32_t *in1, uint32_t *in2)
 

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...
 

Variables

static const scalarmul_init_t scalarmul_init = (scalarmul_init_t)(0x1000530f)
 
static const invert_t invert = (invert_t)(0x10005e9d)
 
static const importmodulus_t importmodulus = (importmodulus_t)(0x10004bf1)
 
static const importoperand_t importoperand = (importoperand_t)(0x10004c1b)
 
static const exportoperand_t exportoperand = (exportoperand_t)(0x10004c67)
 
static const setoperand_t setoperand = (setoperand_t)(0x10004cb5)
 
static const mset_t mset = (mset_t)(0x10004d0f)
 
static const mmult_t mmult = (mmult_t)(0x10007229)
 
static const msub_t msub = (msub_t)(0x10007875)
 
static const madd_t madd = (madd_t)(0x1000714d)
 
static const mout_t mout = (mout_t)(0x100077e1)
 
static const copy_t copy = (copy_t)(0x10004cd9)
 
static const getbit_t getbit = (getbit_t)(0x10005a1b)
 

Typedef Documentation

§ copy_t

typedef void(* copy_t) (uint32_t *out, uint32_t *in1, uint32_t size)

§ exportoperand_t

typedef uint32_t(* exportoperand_t) (ECC_State *state, uint32_t *out, const uint32_t *in1)

§ getbit_t

typedef uint8_t(* getbit_t) (uint32_t *in1, uint32_t *in2)

§ importmodulus_t

typedef uint32_t(* importmodulus_t) (uint32_t *out, const uint32_t *in1)

§ importoperand_t

typedef uint32_t(* importoperand_t) (ECC_State *state, uint32_t *out, const uint32_t *in1)

§ invert_t

typedef uint32_t*(* invert_t) (ECC_State *state, uint32_t *in1)

§ madd_t

typedef void(* madd_t) (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)

§ mmult_t

typedef void(* mmult_t) (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)

§ mout_t

typedef void(* mout_t) (uint32_t *out, const uint32_t *in1, uint32_t *mod, uint32_t len)

§ mset_t

typedef void(* mset_t) (ECC_State *state, uint32_t *in1, uint32_t size)

§ msub_t

typedef void(* msub_t) (uint32_t *out, const uint32_t *in1, const uint32_t *in2, uint32_t *mod, uint32_t len)

§ scalarmul_init_t

typedef uint8_t(* scalarmul_init_t) (ECC_State *state)

§ setoperand_t

typedef void(* setoperand_t) (ECC_State *state, uint32_t *out, uint32_t inValue)

Variable Documentation

§ copy

const copy_t copy = (copy_t)(0x10004cd9)
static

Referenced by COPY().

§ exportoperand

const exportoperand_t exportoperand = (exportoperand_t)(0x10004c67)
static

Referenced by EXPORTOPERAND().

§ getbit

const getbit_t getbit = (getbit_t)(0x10005a1b)
static

Referenced by GETBIT().

§ importmodulus

const importmodulus_t importmodulus = (importmodulus_t)(0x10004bf1)
static

Referenced by IMPORTMODULUS().

§ importoperand

const importoperand_t importoperand = (importoperand_t)(0x10004c1b)
static

Referenced by IMPORTOPERAND().

§ invert

const invert_t invert = (invert_t)(0x10005e9d)
static

Referenced by INVERT().

§ madd

const madd_t madd = (madd_t)(0x1000714d)
static

Referenced by mADD().

§ mmult

const mmult_t mmult = (mmult_t)(0x10007229)
static

Referenced by mMULT().

§ mout

const mout_t mout = (mout_t)(0x100077e1)
static

Referenced by mOUT().

§ mset

const mset_t mset = (mset_t)(0x10004d0f)
static

Referenced by mSET().

§ msub

const msub_t msub = (msub_t)(0x10007875)
static

Referenced by mSUB().

§ scalarmul_init

const scalarmul_init_t scalarmul_init = (scalarmul_init_t)(0x1000530f)
static

Referenced by SCALARMUL_init().

§ setoperand

const setoperand_t setoperand = (setoperand_t)(0x10004cb5)
static

Referenced by SETOPERAND().