瀏覽代碼

Expose two, rather internal, BIGNUM functions.

Android uses these for some conversions from Java formats. The code is
sufficiently bespoke that putting the conversion functions into
BoringSSL doesn't make a lot of sense, but the alternative is to expose
these ones.

Change-Id: If1362bc4a5c44cba4023c909e2ba6488ae019ddb
kris/onging/CECPQ3_patch15
Adam Langley 10 年之前
父節點
當前提交
b8b5478248
共有 2 個檔案被更改,包括 16 行新增9 行删除
  1. +0
    -9
      crypto/bn/internal.h
  2. +16
    -0
      include/openssl/bn.h

+ 0
- 9
crypto/bn/internal.h 查看文件

@@ -131,19 +131,10 @@
extern "C" {
#endif

/* BN_wexpand ensures that |bn| has at least |words| works of space without
* altering its value. It returns one on success or zero on allocation
* failure. */
BIGNUM *bn_wexpand(BIGNUM *bn, unsigned words);

/* bn_expand acts the same as |BN_wexpand|, but takes a number of bits rather
* than a number of words. */
BIGNUM *bn_expand(BIGNUM *bn, unsigned bits);

/* bn_correct_top decrements |bn->top| until |bn->d[top-1]| is non-zero or
* until |top| is zero. */
void bn_correct_top(BIGNUM *bn);

#if defined(OPENSSL_64_BIT)

#define BN_ULLONG unsigned long long


+ 16
- 0
include/openssl/bn.h 查看文件

@@ -284,6 +284,22 @@ OPENSSL_EXPORT int BN_print_fp(FILE *fp, const BIGNUM *a);
OPENSSL_EXPORT BN_ULONG BN_get_word(const BIGNUM *bn);


/* Internal functions.
*
* These functions are useful for code that is doing low-level manipulations of
* BIGNUM values. However, be sure that no other function in this file does
* what you want before turning to these. */

/* bn_correct_top decrements |bn->top| until |bn->d[top-1]| is non-zero or
* until |top| is zero. */
OPENSSL_EXPORT void bn_correct_top(BIGNUM *bn);

/* bn_wexpand ensures that |bn| has at least |words| works of space without
* altering its value. It returns one on success or zero on allocation
* failure. */
OPENSSL_EXPORT BIGNUM *bn_wexpand(BIGNUM *bn, unsigned words);


/* BIGNUM pools.
*
* Certain BIGNUM operations need to use many temporary variables and


Loading…
取消
儲存