Example #1
0
func register(config Config) error {
	// Constructor function. Provide fresh copy each time.
	fn := func() bridge.Implementer {
		c := config
		return &c
	}

	enc := bridge.New([]byte("scrypt"), fn)

	return mcf.Register(mcf.SCRYPT, enc)
}
Example #2
0
func register(config Config) error {

	// Constructor for Implementer. Always return a fresh copy.
	fn := func() bridge.Implementer {
		c := config
		return &c
	}

	// the bridge handles the generic parts of the interface
	enc := bridge.New([]byte("pbkdf2"), fn)

	return mcf.Register(mcf.PBKDF2, enc)
}