Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Braithwaite <mab@google.com>2015-08-12 03:17:28 +0300
committerAdam Langley <agl@google.com>2015-08-19 02:49:31 +0300
commit6488725e5e1ba04276733f67035ae44abd6641ec (patch)
tree30b4f03b2af6ebcd832c5506edf1d5fbe43863b3 /include/openssl/bn.h
parent1f4881fb950f248be7dbdd98a7575bc0650f1116 (diff)
Re-add |BN_bn2mpi| and |BN_mpi2bn| from OpenSSL at fd682e4c.
This benefits mainly M2Crypto. Change-Id: I29bd0fa31b218760055ba467673f3882e46010c7 Reviewed-on: https://boringssl-review.googlesource.com/5722 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'include/openssl/bn.h')
-rw-r--r--include/openssl/bn.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/openssl/bn.h b/include/openssl/bn.h
index 70c05460..7edb7784 100644
--- a/include/openssl/bn.h
+++ b/include/openssl/bn.h
@@ -794,6 +794,25 @@ OPENSSL_EXPORT int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1,
BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+/* Deprecated functions */
+
+/* BN_bn2mpi serialises the value of |in| to |out|, using a format that consists
+ * of the number's length in bytes represented as a 4-byte big-endian number,
+ * and the number itself in big-endian format, where the most significant bit
+ * signals a negative number. (The representation of numbers with the MSB set is
+ * prefixed with null byte). |out| must have sufficient space available; to
+ * find the needed amount of space, call the function with |out| set to NULL. */
+OPENSSL_EXPORT size_t BN_bn2mpi(const BIGNUM *in, uint8_t *out);
+
+/* BN_bin2bn parses |len| bytes from |in| and returns the resulting value. The
+ * bytes at |in| are expected to be in the format emitted by |BN_bn2mpi|.
+ *
+ * If |out| is NULL then a fresh |BIGNUM| is allocated and returned, otherwise
+ * |out| is reused and returned. On error, NULL is returned and the error queue
+ * is updated. */
+OPENSSL_EXPORT BIGNUM *BN_mpi2bn(const uint8_t *in, size_t len, BIGNUM *out);
+
+
/* Private functions */
struct bignum_st {