INNER CODE UNIT · Go

askArgon2Params

GGP1/kure · auth/auth.go:117

func askArgon2Params(r io.Reader) (authDB.Argon2, error) {
	fmt.Println("Set argon2 parameters, leave blank to use the default value")
	fmt.Println("For more information visit https://github.com/GGP1/kure/wiki/Authentication")

	reader := bufio.NewReader(r)

	iterations, err := scanParameter(reader, "Iterations", 1)
	if err != nil {
		return authDB.Argon2{}, err
	}

	// memory is measured in kibibytes, 1 kibibyte = 1024 bytes. 1048576 kibibytes -> 1GiB
	memory, err := scanParameter(reader, "Memory", 1<<20)
	if err != nil {
		return authDB.Argon2{}, err
	}

	threads, err := scanParameter(reader, "Threads", uint32(runtime.NumCPU()))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…