Home  Contents

mpi:size

Cipher/MPI Core4 Lua Commands

SYNOPSIS

  1. num = mpi:bitlen()
  2. num = mpi:size()
  3. num = #mpi

DESCRIPTION

The Core4 system includes a copy of mbed TLS.

The function mpi:bitlen() returns the number of bits stored in the object.

The function mpi:size() returns the object size in bytes. This is the default string length returned by mpi:toBinaryXX.

The term #mpi is a shortcut for mpi:size().

RETURN VALUE

Returns a number value on success.

In case of an error returns three values: nil, a string describing the error and a negative error code from the underlying mbed TLS implementation.