aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-09-24 12:11:27 -0400
committerRusty Russell <rusty@rustcorp.com.au>2012-10-07 23:20:21 -0400
commite1045992949160b56309b730b8bdc428f2f8b69e (patch)
treeca0e00fcd4502cb66df19f4e1aecbb1b4544908c /include/linux
parent42d5ec27f873c654a68f7f865dcd7737513e9508 (diff)
MPILIB: Provide a function to read raw data into an MPI
Provide a function to read raw data of a predetermined size into an MPI rather than expecting the size to be encoded within the data. The data is assumed to represent an unsigned integer, and the resulting MPI will be positive. The function looks like this: MPI mpi_read_raw_data(const void *, size_t); This is useful for reading ASN.1 integer primitives where the length is encoded in the ASN.1 metadata. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mpi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mpi.h b/include/linux/mpi.h
index d02cca6cc8ce..5af1b81def49 100644
--- a/include/linux/mpi.h
+++ b/include/linux/mpi.h
@@ -76,6 +76,7 @@ void mpi_swap(MPI a, MPI b);
76 76
77/*-- mpicoder.c --*/ 77/*-- mpicoder.c --*/
78MPI do_encode_md(const void *sha_buffer, unsigned nbits); 78MPI do_encode_md(const void *sha_buffer, unsigned nbits);
79MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes);
79MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread); 80MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread);
80int mpi_fromstr(MPI val, const char *str); 81int mpi_fromstr(MPI val, const char *str);
81u32 mpi_get_keyid(MPI a, u32 *keyid); 82u32 mpi_get_keyid(MPI a, u32 *keyid);