diff options
author | tb <> | 2021-09-08 12:19:17 +0000 |
---|---|---|
committer | tb <> | 2021-09-08 12:19:17 +0000 |
commit | ae0785bbe06a3bd6d1b155469685f3f19dd4c7e9 (patch) | |
tree | 6d7415ed4fa4fbe8aba04ef7c33529aa84e5361e /src/lib/libcrypto/bn/bn.h | |
parent | 5ef15c706587fade4c981dda1523f9c5344a2cb0 (diff) | |
download | openbsd-ae0785bbe06a3bd6d1b155469685f3f19dd4c7e9.tar.gz openbsd-ae0785bbe06a3bd6d1b155469685f3f19dd4c7e9.tar.bz2 openbsd-ae0785bbe06a3bd6d1b155469685f3f19dd4c7e9.zip |
Prepare to provide BN_bn2{,le}binpad() and BN_lebin2bn()
As found by jsg and patrick, this is needed for newer uboot and
will also be used in upcoming elliptic curve work.
This is from OpenSSL 1.1.1l with minor style tweaks.
ok beck inoguchi
Diffstat (limited to 'src/lib/libcrypto/bn/bn.h')
-rw-r--r-- | src/lib/libcrypto/bn/bn.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index cc1f467523..f03b2c7be7 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn.h,v 1.39 2019/08/25 19:23:59 schwarze Exp $ */ | 1 | /* $OpenBSD: bn.h,v 1.40 2021/09/08 12:19:17 tb Exp $ */ |
2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -428,6 +428,11 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); | |||
428 | void BN_swap(BIGNUM *a, BIGNUM *b); | 428 | void BN_swap(BIGNUM *a, BIGNUM *b); |
429 | BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); | 429 | BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); |
430 | int BN_bn2bin(const BIGNUM *a, unsigned char *to); | 430 | int BN_bn2bin(const BIGNUM *a, unsigned char *to); |
431 | #if defined(LIBRESSL_INTERNAL) | ||
432 | int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen); | ||
433 | BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret); | ||
434 | int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen); | ||
435 | #endif | ||
431 | BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret); | 436 | BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret); |
432 | int BN_bn2mpi(const BIGNUM *a, unsigned char *to); | 437 | int BN_bn2mpi(const BIGNUM *a, unsigned char *to); |
433 | int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); | 438 | int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); |