import (
"crypto/internal/boring"
"crypto/internal/boring/bbig"
+ "crypto/internal/boring/bcache"
"math/big"
"unsafe"
)
// still matches before using the cached key. The theory is that the real
// operations are significantly more expensive than the comparison.
-var pubCache boring.Cache
-var privCache boring.Cache
+var pubCache bcache.Cache
+var privCache bcache.Cache
func init() {
pubCache.Register()
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package boring
+// Package bcache implements a GC-friendly cache (see [Cache]) for BoringCrypto.
+package bcache
import (
"sync/atomic"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package boring
+package bcache
import (
"fmt"
import (
"crypto/internal/boring"
"crypto/internal/boring/bbig"
+ "crypto/internal/boring/bcache"
"math/big"
"unsafe"
)
orig PublicKey
}
-var pubCache boring.Cache
-var privCache boring.Cache
+var pubCache bcache.Cache
+var privCache bcache.Cache
func init() {
pubCache.Register()
< net/mail;
NONE < crypto/internal/boring/sig, crypto/internal/boring/syso;
- sync/atomic < crypto/internal/boring/fipstls;
+ sync/atomic < crypto/internal/boring/bcache, crypto/internal/boring/fipstls;
crypto/internal/boring/sig, crypto/internal/boring/fipstls < crypto/tls/fipsonly;
# CRYPTO is core crypto algorithms - no cgo, fmt, net.
< crypto/internal/nistec
< crypto/internal/edwards25519/field, golang.org/x/crypto/curve25519/internal/field
< crypto/internal/edwards25519
- < crypto/cipher
+ < crypto/cipher;
+
+ crypto/cipher,
+ crypto/internal/boring/bcache
< crypto/internal/boring
< crypto/boring
< crypto/aes, crypto/des, crypto/hmac, crypto/md5, crypto/rc4,
poolcleanup = f
}
-//go:linkname boring_registerCache crypto/internal/boring.registerCache
+//go:linkname boring_registerCache crypto/internal/boring/bcache.registerCache
func boring_registerCache(p unsafe.Pointer) {
boringCaches = append(boringCaches, p)
}