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

Function aesni_cipher_alloc

freebsd/crypto/aesni/aesni.c:387–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387static uint8_t *
388aesni_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
406static device_method_t aesni_methods[] = {
407 DEVMETHOD(device_identify, aesni_identify),

Callers 1

aesni_cipher_cryptFunction · 0.85

Calls 3

mallocFunction · 0.85
crypto_copydataFunction · 0.85

Tested by

no test coverage detected