argon2: Index | Files

package argon2

import ""

Package argon2 is a pure Go conversion of the libargon2 library. Exports a simple API with the most essential features.


Package Files

api.go errors.go port_argon2_c.go port_argon2_h.go port_blake2b_c.go port_core_c.go port_core_h.go port_ref_c.go port_thread_c.go round.go


var (
    ErrIncorrectType      = errors.New("argon2: Invalid type passed (must be either Argon2i or Argon2d)")
    ErrIncorrectParameter = errors.New("argon2: Incorrect parameter passed to the argon function")
    ErrOutputPtrNull      = errors.New("argon2: Output must be an allocated slice")
    ErrOutputTooShort     = errors.New("argon2: Output is too short")
    ErrOutputTooLong      = errors.New("argon2: Output is too long")
    ErrPwdTooShort        = errors.New("argon2: Password is too short")
    ErrPwdTooLong         = errors.New("argon2: Password is too long")
    ErrSaltTooShort       = errors.New("argon2: Salt is too short")
    ErrSaltTooLong        = errors.New("argon2: Salt is too long")
    ErrSecretTooShort     = errors.New("argon2: Secret is too short")
    ErrSecretTooLong      = errors.New("argon2: Secret is too long")
    ErrADTooShort         = errors.New("argon2: Additional data is too short")
    ErrADTooLong          = errors.New("argon2: Additional data is too long")
    ErrMemoryTooLittle    = errors.New("argon2: Too little memory passed")
    ErrMemoryTooMuch      = errors.New("argon2: Too much memory passed")
    ErrTimeTooSmall       = errors.New("argon2: Time cost too small")
    ErrTimeTooLarge       = errors.New("argon2: Time cost too high")
    ErrLanesTooFew        = errors.New("argon2: Too few lanes")
    ErrLanesTooMany       = errors.New("argon2: Too many lanes")
    ErrThreadsTooFew      = errors.New("argon2: Too few threads")
    ErrThreadsTooMany     = errors.New("argon2: Too many threads")
    ErrThreadFail         = errors.New("argon2: Thread failed")

Various errors returned by the library

func Key Uses

func Key(password, salt []byte, iterations, parallelism, memory uint32, keyLength int, variant Variant) ([]byte, error)

Key derives an Argon2(i|d) hash from the input.

type Variant Uses

type Variant uint8

Variant is the type of algorithm to use

const (
    Argon2d Variant = iota

Argon2i uses data-derived pseudorandom numbers, protecting from side-channel attacks.

Package argon2 imports 4 packages (graph) and is imported by 2 packages. Updated 2017-08-26. Refresh now. Tools for package owners.