diff options
author | Russ Cox <rsc@golang.org> | 2022-04-27 09:02:53 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2022-04-29 14:23:26 +0000 |
commit | 3cb10d14b7671ceee374d90ae0d4c3d024838f8a (patch) | |
tree | 13ff63b42da344a776ca02a08085316d42f9a3ba /src/crypto/internal/boring/goboringcrypto.h | |
parent | 509776be5dca8d7ca47cc6ef2e4fc452eb99dc96 (diff) | |
download | go-3cb10d14b7671ceee374d90ae0d4c3d024838f8a.tar.gz go-3cb10d14b7671ceee374d90ae0d4c3d024838f8a.zip |
[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 <roland@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/crypto/internal/boring/goboringcrypto.h')
-rw-r--r-- | src/crypto/internal/boring/goboringcrypto.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 <openssl/ec.h> /*unchecked (opaque)*/ typedef struct GO_EC_GROUP { char data[1]; } GO_EC_GROUP; |