boring
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package boring provides access to BoringCrypto implementation functions.Check the constant Enabled to find out whether BoringCrypto is available.If BoringCrypto is not available, the functions in this package all panic.
Index¶
- Constants
- func DecryptRSANoPadding(priv *PrivateKeyRSA, ciphertext []byte) ([]byte, error)
- func DecryptRSAOAEP(h, mgfHash hash.Hash, priv *PrivateKeyRSA, ciphertext, label []byte) ([]byte, error)
- func DecryptRSAPKCS1(priv *PrivateKeyRSA, ciphertext []byte) ([]byte, error)
- func ECDH(*PrivateKeyECDH, *PublicKeyECDH) ([]byte, error)
- func EncryptRSANoPadding(pub *PublicKeyRSA, msg []byte) ([]byte, error)
- func EncryptRSAOAEP(h, mgfHash hash.Hash, pub *PublicKeyRSA, msg, label []byte) ([]byte, error)
- func EncryptRSAPKCS1(pub *PublicKeyRSA, msg []byte) ([]byte, error)
- func NewAESCipher(key []byte) (cipher.Block, error)
- func NewGCMTLS(cipher.Block) (cipher.AEAD, error)
- func NewGCMTLS13(cipher.Block) (cipher.AEAD, error)
- func NewHMAC(h func() hash.Hash, key []byte) hash.Hash
- func NewSHA1() hash.Hash
- func NewSHA224() hash.Hash
- func NewSHA256() hash.Hash
- func NewSHA384() hash.Hash
- func NewSHA512() hash.Hash
- func SHA1([]byte) [20]byte
- func SHA224([]byte) [28]byte
- func SHA256([]byte) [32]byte
- func SHA384([]byte) [48]byte
- func SHA512([]byte) [64]byte
- func SignMarshalECDSA(priv *PrivateKeyECDSA, hash []byte) ([]byte, error)
- func SignRSAPKCS1v15(priv *PrivateKeyRSA, h crypto.Hash, hashed []byte) ([]byte, error)
- func SignRSAPSS(priv *PrivateKeyRSA, h crypto.Hash, hashed []byte, saltLen int) ([]byte, error)
- func Unreachable()
- func UnreachableExceptTests()
- func VerifyECDSA(pub *PublicKeyECDSA, hash []byte, sig []byte) bool
- func VerifyRSAPKCS1v15(pub *PublicKeyRSA, h crypto.Hash, hashed, sig []byte) error
- func VerifyRSAPSS(pub *PublicKeyRSA, h crypto.Hash, hashed, sig []byte, saltLen int) error
- type BigInt
- type PrivateKeyECDH
- type PrivateKeyECDSA
- type PrivateKeyRSA
- type PublicKeyECDH
- type PublicKeyECDSA
- type PublicKeyRSA
Constants¶
const Enabled = available
Enabled reports whether BoringCrypto is available.When enabled is false, all functions in this package panic.
BoringCrypto is only available on linux/amd64 and linux/arm64 systems.
const RandReader = randReader(0)
Variables¶
This section is empty.
Functions¶
funcDecryptRSANoPadding¶
func DecryptRSANoPadding(priv *PrivateKeyRSA, ciphertext []byte) ([]byte,error)
funcDecryptRSAOAEP¶
funcDecryptRSAPKCS1¶
func DecryptRSAPKCS1(priv *PrivateKeyRSA, ciphertext []byte) ([]byte,error)
funcECDH¶added ingo1.20
func ECDH(*PrivateKeyECDH, *PublicKeyECDH) ([]byte,error)
funcEncryptRSANoPadding¶
func EncryptRSANoPadding(pub *PublicKeyRSA, msg []byte) ([]byte,error)
funcEncryptRSAOAEP¶
funcEncryptRSAPKCS1¶
func EncryptRSAPKCS1(pub *PublicKeyRSA, msg []byte) ([]byte,error)
funcSignMarshalECDSA¶
func SignMarshalECDSA(priv *PrivateKeyECDSA, hash []byte) ([]byte,error)
funcSignRSAPKCS1v15¶
funcSignRSAPSS¶
funcUnreachable¶
func Unreachable()
Unreachable marks code that should be unreachablewhen BoringCrypto is in use. It is a no-op without BoringCrypto.
funcUnreachableExceptTests¶
func UnreachableExceptTests()
UnreachableExceptTests marks code that should be unreachablewhen BoringCrypto is in use. It is a no-op without BoringCrypto.
funcVerifyECDSA¶
func VerifyECDSA(pub *PublicKeyECDSA, hash []byte, sig []byte)bool
funcVerifyRSAPKCS1v15¶
func VerifyRSAPKCS1v15(pub *PublicKeyRSA, hcrypto.Hash, hashed, sig []byte)error
funcVerifyRSAPSS¶
Types¶
typeBigInt¶
type BigInt []uint
A BigInt is the raw words from a BigInt.This definition allows us to avoid importing math/big.Conversion between BigInt and *big.Int is in crypto/internal/boring/bbig.
funcGenerateKeyRSA¶
typePrivateKeyECDH¶added ingo1.20
type PrivateKeyECDH struct{}
funcGenerateKeyECDH¶added ingo1.20
func GenerateKeyECDH(string) (*PrivateKeyECDH, []byte,error)
funcNewPrivateKeyECDH¶added ingo1.20
func NewPrivateKeyECDH(string, []byte) (*PrivateKeyECDH,error)
func (*PrivateKeyECDH)PublicKey¶added ingo1.20
func (*PrivateKeyECDH) PublicKey() (*PublicKeyECDH,error)
typePrivateKeyECDSA¶
type PrivateKeyECDSA struct {// contains filtered or unexported fields}
funcNewPrivateKeyECDSA¶
func NewPrivateKeyECDSA(curvestring, X, Y, DBigInt) (*PrivateKeyECDSA,error)
typePrivateKeyRSA¶
type PrivateKeyRSA struct {// contains filtered or unexported fields}
funcNewPrivateKeyRSA¶
func NewPrivateKeyRSA(N, E, D, P, Q, Dp, Dq, QinvBigInt) (*PrivateKeyRSA,error)
typePublicKeyECDH¶added ingo1.20
type PublicKeyECDH struct{}
funcNewPublicKeyECDH¶added ingo1.20
func NewPublicKeyECDH(string, []byte) (*PublicKeyECDH,error)
func (*PublicKeyECDH)Bytes¶added ingo1.20
func (*PublicKeyECDH) Bytes() []byte
typePublicKeyECDSA¶
type PublicKeyECDSA struct {// contains filtered or unexported fields}
funcNewPublicKeyECDSA¶
func NewPublicKeyECDSA(curvestring, X, YBigInt) (*PublicKeyECDSA,error)
typePublicKeyRSA¶
type PublicKeyRSA struct {// contains filtered or unexported fields}
funcNewPublicKeyRSA¶
func NewPublicKeyRSA(N, EBigInt) (*PublicKeyRSA,error)
Directories¶
Path | Synopsis |
---|---|
Package bcache implements a GC-friendly cache (see Cache) for BoringCrypto. | Package bcache implements a GC-friendly cache (see Cache) for BoringCrypto. |
Package sig holds “code signatures” that can be called and will result in certain code sequences being linked into the final binary. | Package sig holds “code signatures” that can be called and will result in certain code sequences being linked into the final binary. |