kubernetes/vendor/golang.org/x/crypto/bcrypt/bcrypt.go

const MinCost

const MaxCost

const DefaultCost

var ErrMismatchedHashAndPassword

var ErrHashTooShort

type HashVersionTooNewError

func (hv HashVersionTooNewError) Error() string {}

type InvalidHashPrefixError

func (ih InvalidHashPrefixError) Error() string {}

type InvalidCostError

func (ic InvalidCostError) Error() string {}

const majorVersion

const minorVersion

const maxSaltSize

const maxCryptedHashSize

const encodedSaltSize

const encodedHashSize

const minHashSize

var magicCipherData

type hashed

var ErrPasswordTooLong

// GenerateFromPassword returns the bcrypt hash of the password at the given
// cost. If the cost given is less than MinCost, the cost will be set to
// DefaultCost, instead. Use CompareHashAndPassword, as defined in this package,
// to compare the returned hashed password with its cleartext version.
// GenerateFromPassword does not accept passwords longer than 72 bytes, which
// is the longest password bcrypt will operate on.
func GenerateFromPassword(password []byte, cost int) ([]byte, error) {}

// CompareHashAndPassword compares a bcrypt hashed password with its possible
// plaintext equivalent. Returns nil on success, or an error on failure.
func CompareHashAndPassword(hashedPassword, password []byte) error {}

// Cost returns the hashing cost used to create the given hashed
// password. When, in the future, the hashing cost of a password system needs
// to be increased in order to adjust for greater computational power, this
// function allows one to establish which passwords need to be updated.
func Cost(hashedPassword []byte) (int, error) {}

func newFromPassword(password []byte, cost int) (*hashed, error) {}

func newFromHash(hashedSecret []byte) (*hashed, error) {}

func bcrypt(password []byte, cost int, salt []byte) ([]byte, error) {}

func expensiveBlowfishSetup(key []byte, cost uint32, salt []byte) (*blowfish.Cipher, error) {}

func (p *hashed) Hash() []byte {}

func (p *hashed) decodeVersion(sbytes []byte) (int, error) {}

// sbytes should begin where decodeVersion left off.
func (p *hashed) decodeCost(sbytes []byte) (int, error) {}

func (p *hashed) String() string {}

func checkCost(cost int) error {}