| 194 | } |
| 195 | |
| 196 | static int |
| 197 | blake2_newsession(device_t dev, crypto_session_t cses, |
| 198 | const struct crypto_session_params *csp) |
| 199 | { |
| 200 | struct blake2_softc *sc; |
| 201 | struct blake2_session *ses; |
| 202 | int error; |
| 203 | |
| 204 | sc = device_get_softc(dev); |
| 205 | |
| 206 | ses = crypto_get_driver_session(cses); |
| 207 | |
| 208 | rw_rlock(&sc->lock); |
| 209 | if (sc->dying) { |
| 210 | rw_runlock(&sc->lock); |
| 211 | return (EINVAL); |
| 212 | } |
| 213 | rw_runlock(&sc->lock); |
| 214 | |
| 215 | error = blake2_cipher_setup(ses, csp); |
| 216 | if (error != 0) { |
| 217 | CRYPTDEB("setup failed"); |
| 218 | return (error); |
| 219 | } |
| 220 | |
| 221 | return (0); |
| 222 | } |
| 223 | |
| 224 | static int |
| 225 | blake2_process(device_t dev, struct cryptop *crp, int hint __unused) |
nothing calls this directly
no test coverage detected