MCPcopy Create free account
hub / github.com/F-Stack/f-stack / blake2_newsession

Function blake2_newsession

freebsd/crypto/blake2/blake2_cryptodev.c:196–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196static int
197blake2_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
224static int
225blake2_process(device_t dev, struct cryptop *crp, int hint __unused)

Callers

nothing calls this directly

Calls 3

device_get_softcFunction · 0.85
blake2_cipher_setupFunction · 0.85

Tested by

no test coverage detected