summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn.h
diff options
context:
space:
mode:
authortb <>2021-09-08 12:19:17 +0000
committertb <>2021-09-08 12:19:17 +0000
commitae0785bbe06a3bd6d1b155469685f3f19dd4c7e9 (patch)
tree6d7415ed4fa4fbe8aba04ef7c33529aa84e5361e /src/lib/libcrypto/bn/bn.h
parent5ef15c706587fade4c981dda1523f9c5344a2cb0 (diff)
downloadopenbsd-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.h7
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);
428void BN_swap(BIGNUM *a, BIGNUM *b); 428void BN_swap(BIGNUM *a, BIGNUM *b);
429BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); 429BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
430int BN_bn2bin(const BIGNUM *a, unsigned char *to); 430int BN_bn2bin(const BIGNUM *a, unsigned char *to);
431#if defined(LIBRESSL_INTERNAL)
432int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
433BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
434int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen);
435#endif
431BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret); 436BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);
432int BN_bn2mpi(const BIGNUM *a, unsigned char *to); 437int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
433int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); 438int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);