From 875c0c2d16fbcaa61bfc46da58533ab0890bf513 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 26 Feb 2016 22:34:14 -0800 Subject: Functions for converting between buffers and integers. These functions convert between positive integers, and fixed-size memory buffers representing pure binary numbers in big endian byte order. This functionality will be used in some upcoming networking code. * arith.c (num_from_buffer, num_to_buffer): New functions. * arith.h (num_from_buffer, num_to_buffer): Declared. * mpi/mpi.c (mp_to_unsigned_buf): New function. * mpi/mpi.h (mp_to_unsigned_buf): Declared. --- mpi/mpi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'mpi/mpi.h') diff --git a/mpi/mpi.h b/mpi/mpi.h index 0e000643..cd7e823d 100644 --- a/mpi/mpi.h +++ b/mpi/mpi.h @@ -217,6 +217,7 @@ mp_err mp_to_signed_bin(mp_int *mp, unsigned char *str); mp_err mp_read_unsigned_bin(mp_int *mp, unsigned char *str, int len); int mp_unsigned_bin_size(mp_int *mp); mp_err mp_to_unsigned_bin(mp_int *mp, unsigned char *str); +mp_err mp_to_unsigned_buf(mp_int *mp, unsigned char *str, int size); int mp_count_bits(mp_int *mp); int mp_is_pow_two(mp_int *mp); -- cgit v1.2.3