Copyright 2012 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

package packet

import (
	
	
	
	
)
Config collects a number of parameters along with sensible defaults. A nil *Config is valid and results in all default values.
Rand provides the source of entropy. If nil, the crypto/rand Reader is used.
DefaultHash is the default hash function to be used. If zero, SHA-256 is used.
DefaultCipher is the cipher to be used. If zero, AES-128 is used.
Time returns the current time as the number of seconds since the epoch. If Time is nil, time.Now is used.
DefaultCompressionAlgo is the compression algorithm to be applied to the plaintext before encryption. If zero, no compression is done.
CompressionConfig configures the compression settings.
S2KCount is only used for symmetric encryption. It determines the strength of the passphrase stretching when the said passphrase is hashed to produce a key. S2KCount should be between 1024 and 65011712, inclusive. If Config is nil or S2KCount is 0, the value 65536 used. Not all values in the above range can be represented. S2KCount will be rounded up to the next representable value if it cannot be encoded exactly. When set, it is strongly encrouraged to use a value that is at least 65536. See RFC 4880 Section 3.7.1.3.
RSABits is the number of bits in new RSA keys made with NewEntity. If zero, then 2048 bit keys are created.
	RSABits int
}

func ( *Config) () io.Reader {
	if  == nil || .Rand == nil {
		return rand.Reader
	}
	return .Rand
}

func ( *Config) () crypto.Hash {
	if  == nil || uint(.DefaultHash) == 0 {
		return crypto.SHA256
	}
	return .DefaultHash
}

func ( *Config) () CipherFunction {
	if  == nil || uint8(.DefaultCipher) == 0 {
		return CipherAES128
	}
	return .DefaultCipher
}

func ( *Config) () time.Time {
	if  == nil || .Time == nil {
		return time.Now()
	}
	return .Time()
}

func ( *Config) () CompressionAlgo {
	if  == nil {
		return CompressionNone
	}
	return .DefaultCompressionAlgo
}

func ( *Config) () int {
	if  == nil || .S2KCount == 0 {
		return 0
	}
	return .S2KCount