diff options
author | David Benjamin <davidben@google.com> | 2016-08-24 06:53:12 +0300 |
---|---|---|
committer | CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> | 2016-09-18 23:12:25 +0300 |
commit | 40a63113e4b1d1878bbbec74fbd8d1684ce79db0 (patch) | |
tree | bd82749ffc4121406828f8bace62f6955207a789 /include/openssl | |
parent | c446ce52944cb2fd9073a9072fc6e151af16919b (diff) |
Add BN_set_u64.
Android currently implements this manually (see NativeBN_putULongInt) by
reaching into BIGNUM's internals. BN_ULONG is a somewhat unfortunate API
anyway as the size is platform-dependent, so add a platform-independent
way to do this.
The other things Android needs are going to need more work, but this
one's easy.
BUG=97
Change-Id: I4af4dc29f9845bdce0f0663c379b4b5d3e1dc46e
Reviewed-on: https://boringssl-review.googlesource.com/11088
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Diffstat (limited to 'include/openssl')
-rw-r--r-- | include/openssl/bn.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/openssl/bn.h b/include/openssl/bn.h index 554a81ba..66945cb9 100644 --- a/include/openssl/bn.h +++ b/include/openssl/bn.h @@ -221,6 +221,10 @@ OPENSSL_EXPORT int BN_one(BIGNUM *bn); * allocation failure. */ OPENSSL_EXPORT int BN_set_word(BIGNUM *bn, BN_ULONG value); +/* BN_set_u64 sets |bn| to |value|. It returns one on success or zero on + * allocation failure. */ +OPENSSL_EXPORT int BN_set_u64(BIGNUM *bn, uint64_t value); + /* BN_set_negative sets the sign of |bn|. */ OPENSSL_EXPORT void BN_set_negative(BIGNUM *bn, int sign); |