CreateAlgorithm returns new encryption.Encryptor with error correction.
(opts *Options)
| 36 | |
| 37 | // CreateAlgorithm returns new encryption.Encryptor with error correction. |
| 38 | func CreateAlgorithm(opts *Options) (encryption.Encryptor, error) { |
| 39 | factory, exists := factories[opts.Algorithm] |
| 40 | |
| 41 | if !exists { |
| 42 | return nil, errors.New("Unknown ECC algorithm: " + opts.Algorithm) |
| 43 | } |
| 44 | |
| 45 | return factory(opts) |
| 46 | } |
| 47 | |
| 48 | // Parameters encapsulates all ECC parameters. |
| 49 | type Parameters interface { |
no outgoing calls