www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


Crypt_BN_Mul

Big number multiply.

int far Crypt_BN_Mul ( Crypt_BigNumS      far *result,
                 const Crypt_BigNumConstS far *a,
                 const Crypt_BigNumConstS far *b) ;

Parameters

result

[out]   On success the product of a and b will be reported here.   This location may reference one of the other inputs, which would then be overwritten.   ( Note that pointers to Crypt_BigNumConstS type can be safely cast to pointers to Crypt_BigNumS type. )   In any case, the caller must provide space for at least

         a->bnDigitCnt
                 plus
         b->bnDigitCnt

digits in the buffer referenced by result->bnDataPtr.

a

[in]   Pointer to big number for the first factor of product.

b

[in]   Pointer to the big number for the second factor of product.

Return Value

error code:
    0 - Success (no error).
    1 - Memory allocation failed.
    3 - Invalid big number size.

Comments

This API multiplies two big numbers.   The value computed is:

     result = a * b ;

The big number inputs must not exceed 512 bytes size or an error will result.   The result can range up to twice this size.

This function requires a 5 kByte workspace allocated from the system memory.   The function will execute significantly faster if this workspace memory is available in the system's fast memory area.

See Also

RTOS API

On the first call, this library function invokes a software interrupt which modifies the code at the calling site inside your application program.   A direct FAR JMP into the @CHIP-RTOS-x86 implementation for this function is installed so that on return and on any subsequent calls to this API this dynamic link reaches the function's implementation directly.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    n/an/an/aV1.35V1.35

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.19

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document