| 385 | } |
| 386 | |
| 387 | static uint8_t * |
| 388 | aesni_cipher_alloc(struct cryptop *crp, int start, int length, bool *allocated) |
| 389 | { |
| 390 | uint8_t *addr; |
| 391 | |
| 392 | addr = crypto_contiguous_subsegment(crp, start, length); |
| 393 | if (addr != NULL) { |
| 394 | *allocated = false; |
| 395 | return (addr); |
| 396 | } |
| 397 | addr = malloc(length, M_AESNI, M_NOWAIT); |
| 398 | if (addr != NULL) { |
| 399 | *allocated = true; |
| 400 | crypto_copydata(crp, start, length, addr); |
| 401 | } else |
| 402 | *allocated = false; |
| 403 | return (addr); |
| 404 | } |
| 405 | |
| 406 | static device_method_t aesni_methods[] = { |
| 407 | DEVMETHOD(device_identify, aesni_identify), |
no test coverage detected