Implementation of type MPI (RFC4880 3.2)
Multiprecision integers (also called MPIs) are unsigned integers used to hold large integers such as the ones used in cryptographic calculations. An MPI consists of two pieces: a two-octet scalar that is the length of the MPI in bits followed by a string of octets that contain the actual integer.
Multiprecision integers (also called MPIs) are unsigned integers used to hold large integers such as the ones used in cryptographic calculations. An MPI consists of two pieces: a two-octet scalar that is the length of the MPI in bits followed by a string of octets that contain the actual integer.
new (require("type/mpi"))()
- Source:
- Source:
Requires
Members
-
data
-
An implementation dependent integer
- Source:
Methods
-
read(input) → {Integer}
-
Parsing function for a mpi (RFC 4880 3.2).
Parameters:
Name Type Description input
String Payload of mpi data - Source:
Returns:
Length of data read- Type
- Integer
-
write() → {String}
-
Converts the mpi object to a string as specified in RFC4880 3.2
- Source:
Returns:
mpi Byte representation- Type
- String