From 3cb10d14b7671ceee374d90ae0d4c3d024838f8a Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 27 Apr 2022 09:02:53 -0400 Subject: [dev.boringcrypto] crypto/internal/boring: avoid allocation in big.Int conversion The conversion via byte slices is inefficient; we can convert via word slices and avoid the copy entirely. For #51940. Change-Id: I06f747e0acffffae427d9706d43bdacf146c027d Reviewed-on: https://go-review.googlesource.com/c/go/+/395875 Reviewed-by: Roland Shoemaker Run-TryBot: Russ Cox TryBot-Result: Gopher Robot --- src/crypto/internal/boring/goboringcrypto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/crypto/internal/boring/goboringcrypto.h') diff --git a/src/crypto/internal/boring/goboringcrypto.h b/src/crypto/internal/boring/goboringcrypto.h index 37b7917c04..d6d99b1dcd 100644 --- a/src/crypto/internal/boring/goboringcrypto.h +++ b/src/crypto/internal/boring/goboringcrypto.h @@ -141,7 +141,9 @@ unsigned _goboringcrypto_BN_num_bits(const GO_BIGNUM*); unsigned _goboringcrypto_BN_num_bytes(const GO_BIGNUM*); int _goboringcrypto_BN_is_negative(const GO_BIGNUM*); GO_BIGNUM* _goboringcrypto_BN_bin2bn(const uint8_t*, size_t, GO_BIGNUM*); +GO_BIGNUM* _goboringcrypto_BN_le2bn(const uint8_t*, size_t, GO_BIGNUM*); size_t _goboringcrypto_BN_bn2bin(const GO_BIGNUM*, uint8_t*); +int _goboringcrypto_BN_bn2le_padded(uint8_t*, size_t, const GO_BIGNUM*); // #include /*unchecked (opaque)*/ typedef struct GO_EC_GROUP { char data[1]; } GO_EC_GROUP; -- cgit v1.2.3-54-g00ecf