package boring
Import Path
crypto/internal/boring (on go.dev)
Dependency Relation
imports 4 packages, and imported by 11 packages
Involved Source Files
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.
notboring.go
goboringcrypto.h
Package-Level Type Names (total 7)
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.
func GenerateKeyECDSA(curve string) (X, Y, D BigInt, err error)
func GenerateKeyRSA(bits int) (N, E, D, P, Q, Dp, Dq, Qinv BigInt, err error)
func crypto/internal/boring/bbig.Enc(b *big.Int) BigInt
func NewPrivateKeyECDSA(curve string, X, Y, D BigInt) (*PrivateKeyECDSA, error)
func NewPrivateKeyRSA(N, E, D, P, Q, Dp, Dq, Qinv BigInt) (*PrivateKeyRSA, error)
func NewPublicKeyECDSA(curve string, X, Y BigInt) (*PublicKeyECDSA, error)
func NewPublicKeyRSA(N, E BigInt) (*PublicKeyRSA, error)
func crypto/internal/boring/bbig.Dec(b BigInt) *big.Int
(*PrivateKeyECDH) PublicKey() (*PublicKeyECDH, error)
func GenerateKeyECDH(string) (*PrivateKeyECDH, []byte, error)
func NewPrivateKeyECDH(string, []byte) (*PrivateKeyECDH, error)
func ECDH(*PrivateKeyECDH, *PublicKeyECDH) ([]byte, error)
func NewPrivateKeyECDSA(curve string, X, Y, D BigInt) (*PrivateKeyECDSA, error)
func SignMarshalECDSA(priv *PrivateKeyECDSA, hash []byte) ([]byte, error)
func NewPrivateKeyRSA(N, E, D, P, Q, Dp, Dq, Qinv BigInt) (*PrivateKeyRSA, error)
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 SignRSAPKCS1v15(priv *PrivateKeyRSA, h crypto.Hash, hashed []byte) ([]byte, error)
func SignRSAPSS(priv *PrivateKeyRSA, h crypto.Hash, hashed []byte, saltLen int) ([]byte, error)
(*PublicKeyECDH) Bytes() []byte
func NewPublicKeyECDH(string, []byte) (*PublicKeyECDH, error)
func (*PrivateKeyECDH).PublicKey() (*PublicKeyECDH, error)
func ECDH(*PrivateKeyECDH, *PublicKeyECDH) ([]byte, error)
func NewPublicKeyECDSA(curve string, X, Y BigInt) (*PublicKeyECDSA, error)
func VerifyECDSA(pub *PublicKeyECDSA, hash []byte, sig []byte) bool
func NewPublicKeyRSA(N, E BigInt) (*PublicKeyRSA, 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 VerifyRSAPKCS1v15(pub *PublicKeyRSA, h crypto.Hash, hashed, sig []byte) error
func VerifyRSAPSS(pub *PublicKeyRSA, h crypto.Hash, hashed, sig []byte, saltLen int) error
Package-Level Functions (total 37)
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 GenerateKeyECDH(string) (*PrivateKeyECDH, []byte, error) func GenerateKeyECDSA(curve string) (X, Y, D BigInt, err error) func GenerateKeyRSA(bits int) (N, E, D, P, Q, Dp, Dq, Qinv BigInt, err error) func NewAESCipher(key []byte) (cipher.Block, error) func NewPrivateKeyECDH(string, []byte) (*PrivateKeyECDH, error) func NewPrivateKeyECDSA(curve string, X, Y, D BigInt) (*PrivateKeyECDSA, error) func NewPrivateKeyRSA(N, E, D, P, Q, Dp, Dq, Qinv BigInt) (*PrivateKeyRSA, error) func NewPublicKeyECDH(string, []byte) (*PublicKeyECDH, error) func NewPublicKeyECDSA(curve string, X, Y BigInt) (*PublicKeyECDSA, error) func NewPublicKeyRSA(N, E BigInt) (*PublicKeyRSA, error) 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)
Unreachable marks code that should be unreachable
when BoringCrypto is in use. It is a no-op without BoringCrypto.
UnreachableExceptTests marks code that should be unreachable
when BoringCrypto is in use. It is a no-op without BoringCrypto.
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
Package-Level Constants (total 2)
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
The pages are generated with Golds v0.7.0-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |