parseKV parses a key/value pair into the appropriate field of c.
(k, v string)
| 112 | |
| 113 | // parseKV parses a key/value pair into the appropriate field of c. |
| 114 | func (c *Crypto) parseKV(k, v string) error { |
| 115 | vp := util.NewValueParser(v) |
| 116 | |
| 117 | switch k { |
| 118 | case "async": |
| 119 | // Interpret literal yes as true. |
| 120 | c.Async = v == "yes" |
| 121 | case "blocksize": |
| 122 | c.Blocksize = vp.PUInt64() |
| 123 | case "chunksize": |
| 124 | c.Chunksize = vp.PUInt64() |
| 125 | case "digestsize": |
| 126 | c.Digestsize = vp.PUInt64() |
| 127 | case "driver": |
| 128 | c.Driver = v |
| 129 | case "geniv": |
| 130 | c.Geniv = v |
| 131 | case "internal": |
| 132 | c.Internal = v |
| 133 | case "ivsize": |
| 134 | c.Ivsize = vp.PUInt64() |
| 135 | case "maxauthsize": |
| 136 | c.Maxauthsize = vp.PUInt64() |
| 137 | case "max keysize": |
| 138 | c.MaxKeysize = vp.PUInt64() |
| 139 | case "min keysize": |
| 140 | c.MinKeysize = vp.PUInt64() |
| 141 | case "module": |
| 142 | c.Module = v |
| 143 | case "name": |
| 144 | c.Name = v |
| 145 | case "priority": |
| 146 | c.Priority = vp.PInt64() |
| 147 | case "refcnt": |
| 148 | c.Refcnt = vp.PInt64() |
| 149 | case "seedsize": |
| 150 | c.Seedsize = vp.PUInt64() |
| 151 | case "selftest": |
| 152 | c.Selftest = v |
| 153 | case "type": |
| 154 | c.Type = v |
| 155 | case "walksize": |
| 156 | c.Walksize = vp.PUInt64() |
| 157 | } |
| 158 | |
| 159 | return vp.Err() |
| 160 | } |
no test coverage detected