MAX32665 SDK Documentation  0.2
Software Development Kit Overview and API Documentation
Modular Arithmetic Accelerator (MAA)

Macros

#define MAA_MAX_SIZE   256
 
#define MAA_MAX_WORD_SIZE   2048
 

Enumerations

enum  tpu_maa_clcsel_t {
  TPU_MAA_EXP = MXC_V_TPU_MAA_CTRL_CLC_EXP,
  TPU_MAA_SQ = MXC_V_TPU_MAA_CTRL_CLC_SQ,
  TPU_MAA_MUL = MXC_V_TPU_MAA_CTRL_CLC_MUL,
  TPU_MAA_SQMUL = MXC_V_TPU_MAA_CTRL_CLC_SQMUL,
  TPU_MAA_ADD = MXC_V_TPU_MAA_CTRL_CLC_ADD,
  TPU_MAA_SUB = MXC_V_TPU_MAA_CTRL_CLC_SUB
}
 

Functions

void MAA_Reset (void)
 Reset the TPU accelerator.
 
int MAA_Init (unsigned int size)
 Configure MAA operation with appropriate MAA word size. More...
 
int MAA_Shutdown (void)
 Release MAA. More...
 
int MAA_Compute (tpu_maa_clcsel_t clc, char *multiplier, char *multiplicand, char *exp, char *mod, int *result, unsigned int len)
 MAA operation. More...
 

Detailed Description

Function Documentation

◆ MAA_Init()

int MAA_Init ( unsigned int  size)
Parameters
sizeDefines the number of bits for modular operation
Returns
E_BAD_PARAM Specified size size, out of range
E_SUCCESS Cipher algorithm configured successfully

◆ MAA_Shutdown()

int MAA_Shutdown ( void  )

Shuts down the MAA engine and any associated clocks

Returns
E_BAD_PARAM if MAA cannot be stopped
E_NO_ERROR otherwise

◆ MAA_Compute()

int MAA_Compute ( tpu_maa_clcsel_t  clc,
char *  multiplier,
char *  multiplicand,
char *  exp,
char *  mod,
int *  result,
unsigned int  len 
)
Parameters
clcSelects the MAA calculation operation
multiplierPointer to multiplier data
multiplicandPointer to multiplicand data
expPointer to exponent data
modPointer to modular data
resultOutput buffer
lenSpecifies length to the nearest 32-bit boundary
Returns
E_NULL_PTR Specified pointers multiplier; multiplicand; exp; mod points to null
E_INVALID Specified MAA calculation operation is invalid
E_BAD_STATE MAA Error occurs
E_SUCCESS MAA process completed successfully
Note
multiplier; multiplicand; exp; mod, data must be loaded with zero pad to specified length len, or the "garbage bits" will case erroneous results