Macros | Functions
BigNum.h File Reference

Detailed Description

BigNum module provides APIs for performing big number operations.

============================================================================

Limitations

#include <stdint.h>
#include <stdio.h>
Include dependency graph for BigNum.h:

Go to the source code of this file.

Macros

#define BigNum_STATUS_SUCCESS   ((int_fast16_t)0)
 Successful status code. More...
 
#define BigNum_STATUS_ERROR   ((int_fast16_t)-1)
 Generic error status code. More...
 
#define BigNum_MOD_REDUCTION_MAX_INPUT_LEN_IN_WORDS   16
 Maximum input length in words supported by modular reduction API. More...
 

Functions

int_fast16_t BigNum_modularReduction (uint32_t *result, size_t resultLenBytes, const uint32_t *input, size_t inputLenBytes, const uint32_t *mod, size_t modLenBytes)
 Perform modular reduction on large integer array. More...
 

Macro Definition Documentation

§ BigNum_STATUS_SUCCESS

#define BigNum_STATUS_SUCCESS   ((int_fast16_t)0)

Successful status code.

Functions return BigNum_STATUS_SUCCESS if the function was executed successfully.

§ BigNum_STATUS_ERROR

#define BigNum_STATUS_ERROR   ((int_fast16_t)-1)

Generic error status code.

Functions return BigNum_STATUS_ERROR if the function was not executed successfully and no more specific error is applicable.

§ BigNum_MOD_REDUCTION_MAX_INPUT_LEN_IN_WORDS

#define BigNum_MOD_REDUCTION_MAX_INPUT_LEN_IN_WORDS   16

Maximum input length in words supported by modular reduction API.

Function Documentation

§ BigNum_modularReduction()

int_fast16_t BigNum_modularReduction ( uint32_t *  result,
size_t  resultLenBytes,
const uint32_t *  input,
size_t  inputLenBytes,
const uint32_t *  mod,
size_t  modLenBytes 
)

Perform modular reduction on large integer array.

This function supports inputs up to BigNum_MOD_REDUCTION_MAX_INPUT_LEN_IN_WORDS in word length.

Parameters
resultPointer to a word-aligned buffer to store result in little-endian, where result[0] contains the least significant 32-bits of result.
resultLenBytesResult buffer length in bytes.
inputPointer to the word-aligned buffer containing input in little-endian, where input[0] contains the least significant 32-bits of input.
inputLenBytesInput buffer length in bytes.
modPointer to a word-aligned buffer containing the modulus in little-endian, where mod[0] contains the least significant 32-bits of mod.
modLenBytesModulus buffer length in bytes.
Return values
BigNum_STATUS_SUCCESSThe operation succeeded.
BigNum_STATUS_ERRORThe operation failed.
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale