Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c
Show First 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* Since the auth data is part of the iovec array, all we need to know | * Since the auth data is part of the iovec array, all we need to know | ||||
* is the length: 0 means there's no AAD. | * is the length: 0 means there's no AAD. | ||||
* | * | ||||
*/ | */ | ||||
static int | static int | ||||
zio_do_crypt_uio_opencrypto(boolean_t encrypt, freebsd_crypt_session_t *sess, | zio_do_crypt_uio_opencrypto(boolean_t encrypt, freebsd_crypt_session_t *sess, | ||||
uint64_t crypt, crypto_key_t *key, uint8_t *ivbuf, uint_t datalen, | uint64_t crypt, crypto_key_t *key, uint8_t *ivbuf, uint_t datalen, | ||||
uio_t *uio, uint_t auth_len) | zfs_uio_t *uio, uint_t auth_len) | ||||
{ | { | ||||
zio_crypt_info_t *ci; | zio_crypt_info_t *ci; | ||||
int ret; | int ret; | ||||
ci = &zio_crypt_table[crypt]; | ci = &zio_crypt_table[crypt]; | ||||
if (ci->ci_crypt_type != ZC_TYPE_GCM && | if (ci->ci_crypt_type != ZC_TYPE_GCM && | ||||
ci->ci_crypt_type != ZC_TYPE_CCM) | ci->ci_crypt_type != ZC_TYPE_CCM) | ||||
return (ENOTSUP); | return (ENOTSUP); | ||||
Show All 18 Lines | |||||
{ | { | ||||
int ret; | int ret; | ||||
uint64_t aad[3]; | uint64_t aad[3]; | ||||
/* | /* | ||||
* With OpenCrypto in FreeBSD, the same buffer is used for | * With OpenCrypto in FreeBSD, the same buffer is used for | ||||
* input and output. Also, the AAD (for AES-GMC at least) | * input and output. Also, the AAD (for AES-GMC at least) | ||||
* needs to logically go in front. | * needs to logically go in front. | ||||
*/ | */ | ||||
uio_t cuio; | zfs_uio_t cuio; | ||||
struct uio cuio_s; | |||||
iovec_t iovecs[4]; | iovec_t iovecs[4]; | ||||
uint64_t crypt = key->zk_crypt; | uint64_t crypt = key->zk_crypt; | ||||
uint_t enc_len, keydata_len, aad_len; | uint_t enc_len, keydata_len, aad_len; | ||||
ASSERT3U(crypt, <, ZIO_CRYPT_FUNCTIONS); | ASSERT3U(crypt, <, ZIO_CRYPT_FUNCTIONS); | ||||
ASSERT3U(cwkey->ck_format, ==, CRYPTO_KEY_RAW); | ASSERT3U(cwkey->ck_format, ==, CRYPTO_KEY_RAW); | ||||
zfs_uio_init(&cuio, &cuio_s); | |||||
keydata_len = zio_crypt_table[crypt].ci_keylen; | keydata_len = zio_crypt_table[crypt].ci_keylen; | ||||
/* generate iv for wrapping the master and hmac key */ | /* generate iv for wrapping the master and hmac key */ | ||||
ret = random_get_pseudo_bytes(iv, WRAPPING_IV_LEN); | ret = random_get_pseudo_bytes(iv, WRAPPING_IV_LEN); | ||||
if (ret != 0) | if (ret != 0) | ||||
goto error; | goto error; | ||||
/* | /* | ||||
Show All 26 Lines | if (key->zk_version == 0) { | ||||
aad[1] = LE_64(crypt); | aad[1] = LE_64(crypt); | ||||
aad[2] = LE_64(key->zk_version); | aad[2] = LE_64(key->zk_version); | ||||
} | } | ||||
iovecs[0].iov_base = aad; | iovecs[0].iov_base = aad; | ||||
iovecs[0].iov_len = aad_len; | iovecs[0].iov_len = aad_len; | ||||
enc_len = zio_crypt_table[crypt].ci_keylen + SHA512_HMAC_KEYLEN; | enc_len = zio_crypt_table[crypt].ci_keylen + SHA512_HMAC_KEYLEN; | ||||
cuio.uio_iov = iovecs; | GET_UIO_STRUCT(&cuio)->uio_iov = iovecs; | ||||
cuio.uio_iovcnt = 4; | zfs_uio_iovcnt(&cuio) = 4; | ||||
cuio.uio_segflg = UIO_SYSSPACE; | zfs_uio_segflg(&cuio) = UIO_SYSSPACE; | ||||
/* encrypt the keys and store the resulting ciphertext and mac */ | /* encrypt the keys and store the resulting ciphertext and mac */ | ||||
ret = zio_do_crypt_uio_opencrypto(B_TRUE, NULL, crypt, cwkey, | ret = zio_do_crypt_uio_opencrypto(B_TRUE, NULL, crypt, cwkey, | ||||
iv, enc_len, &cuio, aad_len); | iv, enc_len, &cuio, aad_len); | ||||
if (ret != 0) | if (ret != 0) | ||||
goto error; | goto error; | ||||
return (0); | return (0); | ||||
Show All 9 Lines | |||||
{ | { | ||||
int ret; | int ret; | ||||
uint64_t aad[3]; | uint64_t aad[3]; | ||||
/* | /* | ||||
* With OpenCrypto in FreeBSD, the same buffer is used for | * With OpenCrypto in FreeBSD, the same buffer is used for | ||||
* input and output. Also, the AAD (for AES-GMC at least) | * input and output. Also, the AAD (for AES-GMC at least) | ||||
* needs to logically go in front. | * needs to logically go in front. | ||||
*/ | */ | ||||
uio_t cuio; | zfs_uio_t cuio; | ||||
struct uio cuio_s; | |||||
iovec_t iovecs[4]; | iovec_t iovecs[4]; | ||||
void *src, *dst; | void *src, *dst; | ||||
uint_t enc_len, keydata_len, aad_len; | uint_t enc_len, keydata_len, aad_len; | ||||
ASSERT3U(crypt, <, ZIO_CRYPT_FUNCTIONS); | ASSERT3U(crypt, <, ZIO_CRYPT_FUNCTIONS); | ||||
ASSERT3U(cwkey->ck_format, ==, CRYPTO_KEY_RAW); | ASSERT3U(cwkey->ck_format, ==, CRYPTO_KEY_RAW); | ||||
keydata_len = zio_crypt_table[crypt].ci_keylen; | keydata_len = zio_crypt_table[crypt].ci_keylen; | ||||
rw_init(&key->zk_salt_lock, NULL, RW_DEFAULT, NULL); | rw_init(&key->zk_salt_lock, NULL, RW_DEFAULT, NULL); | ||||
zfs_uio_init(&cuio, &cuio_s); | |||||
/* | /* | ||||
* Since we only support one buffer, we need to copy | * Since we only support one buffer, we need to copy | ||||
* the encrypted buffer (source) to the plain buffer | * the encrypted buffer (source) to the plain buffer | ||||
* (dest). We set iovecs[0] -- the authentication data -- | * (dest). We set iovecs[0] -- the authentication data -- | ||||
* below. | * below. | ||||
*/ | */ | ||||
dst = key->zk_master_keydata; | dst = key->zk_master_keydata; | ||||
src = keydata; | src = keydata; | ||||
Show All 21 Lines | if (version == 0) { | ||||
aad[1] = LE_64(crypt); | aad[1] = LE_64(crypt); | ||||
aad[2] = LE_64(version); | aad[2] = LE_64(version); | ||||
} | } | ||||
enc_len = keydata_len + SHA512_HMAC_KEYLEN; | enc_len = keydata_len + SHA512_HMAC_KEYLEN; | ||||
iovecs[0].iov_base = aad; | iovecs[0].iov_base = aad; | ||||
iovecs[0].iov_len = aad_len; | iovecs[0].iov_len = aad_len; | ||||
cuio.uio_iov = iovecs; | GET_UIO_STRUCT(&cuio)->uio_iov = iovecs; | ||||
cuio.uio_iovcnt = 4; | zfs_uio_iovcnt(&cuio) = 4; | ||||
cuio.uio_segflg = UIO_SYSSPACE; | zfs_uio_segflg(&cuio) = UIO_SYSSPACE; | ||||
/* decrypt the keys and store the result in the output buffers */ | /* decrypt the keys and store the result in the output buffers */ | ||||
ret = zio_do_crypt_uio_opencrypto(B_FALSE, NULL, crypt, cwkey, | ret = zio_do_crypt_uio_opencrypto(B_FALSE, NULL, crypt, cwkey, | ||||
iv, enc_len, &cuio, aad_len); | iv, enc_len, &cuio, aad_len); | ||||
if (ret != 0) | if (ret != 0) | ||||
goto error; | goto error; | ||||
▲ Show 20 Lines • Show All 566 Lines • ▼ Show 20 Lines | |||||
error: | error: | ||||
bzero(portable_mac, ZIO_OBJSET_MAC_LEN); | bzero(portable_mac, ZIO_OBJSET_MAC_LEN); | ||||
bzero(local_mac, ZIO_OBJSET_MAC_LEN); | bzero(local_mac, ZIO_OBJSET_MAC_LEN); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
static void | static void | ||||
zio_crypt_destroy_uio(uio_t *uio) | zio_crypt_destroy_uio(zfs_uio_t *uio) | ||||
{ | { | ||||
if (uio->uio_iov) | if (GET_UIO_STRUCT(uio)->uio_iov) | ||||
kmem_free(uio->uio_iov, uio->uio_iovcnt * sizeof (iovec_t)); | kmem_free(GET_UIO_STRUCT(uio)->uio_iov, | ||||
zfs_uio_iovcnt(uio) * sizeof (iovec_t)); | |||||
} | } | ||||
/* | /* | ||||
* This function parses an uncompressed indirect block and returns a checksum | * This function parses an uncompressed indirect block and returns a checksum | ||||
* of all the portable fields from all of the contained bps. The portable | * of all the portable fields from all of the contained bps. The portable | ||||
* fields are the MAC and all of the fields from blk_prop except for the dedup, | * fields are the MAC and all of the fields from blk_prop except for the dedup, | ||||
* checksum, and psize bits. For an explanation of the purpose of this, see | * checksum, and psize bits. For an explanation of the purpose of this, see | ||||
* the comment block on object set authentication. | * the comment block on object set authentication. | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
* the zil_chain_t header. Everything that is not encrypted is authenticated. | * the zil_chain_t header. Everything that is not encrypted is authenticated. | ||||
*/ | */ | ||||
/* | /* | ||||
* The OpenCrypto used in FreeBSD does not use separate source and | * The OpenCrypto used in FreeBSD does not use separate source and | ||||
* destination buffers; instead, the same buffer is used. Further, to | * destination buffers; instead, the same buffer is used. Further, to | ||||
* accommodate some of the drivers, the authbuf needs to be logically before | * accommodate some of the drivers, the authbuf needs to be logically before | ||||
* the data. This means that we need to copy the source to the destination, | * the data. This means that we need to copy the source to the destination, | ||||
* and set up an extra iovec_t at the beginning to handle the authbuf. | * and set up an extra iovec_t at the beginning to handle the authbuf. | ||||
* It also means we'll only return one uio_t. | * It also means we'll only return one zfs_uio_t. | ||||
*/ | */ | ||||
/* ARGSUSED */ | /* ARGSUSED */ | ||||
static int | static int | ||||
zio_crypt_init_uios_zil(boolean_t encrypt, uint8_t *plainbuf, | zio_crypt_init_uios_zil(boolean_t encrypt, uint8_t *plainbuf, | ||||
uint8_t *cipherbuf, uint_t datalen, boolean_t byteswap, uio_t *puio, | uint8_t *cipherbuf, uint_t datalen, boolean_t byteswap, zfs_uio_t *puio, | ||||
uio_t *out_uio, uint_t *enc_len, uint8_t **authbuf, uint_t *auth_len, | zfs_uio_t *out_uio, uint_t *enc_len, uint8_t **authbuf, uint_t *auth_len, | ||||
boolean_t *no_crypt) | boolean_t *no_crypt) | ||||
{ | { | ||||
uint8_t *aadbuf = zio_buf_alloc(datalen); | uint8_t *aadbuf = zio_buf_alloc(datalen); | ||||
uint8_t *src, *dst, *slrp, *dlrp, *blkend, *aadp; | uint8_t *src, *dst, *slrp, *dlrp, *blkend, *aadp; | ||||
iovec_t *dst_iovecs; | iovec_t *dst_iovecs; | ||||
zil_chain_t *zilc; | zil_chain_t *zilc; | ||||
lr_t *lr; | lr_t *lr; | ||||
uint64_t txtype, lr_len; | uint64_t txtype, lr_len; | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | zio_crypt_init_uios_zil(boolean_t encrypt, uint8_t *plainbuf, | ||||
/* MAC */ | /* MAC */ | ||||
dst_iovecs[vec].iov_base = 0; | dst_iovecs[vec].iov_base = 0; | ||||
dst_iovecs[vec].iov_len = 0; | dst_iovecs[vec].iov_len = 0; | ||||
*no_crypt = (vec == 1); | *no_crypt = (vec == 1); | ||||
*enc_len = total_len; | *enc_len = total_len; | ||||
*authbuf = aadbuf; | *authbuf = aadbuf; | ||||
*auth_len = aad_len; | *auth_len = aad_len; | ||||
out_uio->uio_iov = dst_iovecs; | GET_UIO_STRUCT(out_uio)->uio_iov = dst_iovecs; | ||||
out_uio->uio_iovcnt = nr_iovecs; | zfs_uio_iovcnt(out_uio) = nr_iovecs; | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Special case handling routine for encrypting / decrypting dnode blocks. | * Special case handling routine for encrypting / decrypting dnode blocks. | ||||
*/ | */ | ||||
static int | static int | ||||
zio_crypt_init_uios_dnode(boolean_t encrypt, uint64_t version, | zio_crypt_init_uios_dnode(boolean_t encrypt, uint64_t version, | ||||
uint8_t *plainbuf, uint8_t *cipherbuf, uint_t datalen, boolean_t byteswap, | uint8_t *plainbuf, uint8_t *cipherbuf, uint_t datalen, boolean_t byteswap, | ||||
uio_t *puio, uio_t *out_uio, uint_t *enc_len, uint8_t **authbuf, | zfs_uio_t *puio, zfs_uio_t *out_uio, uint_t *enc_len, uint8_t **authbuf, | ||||
uint_t *auth_len, boolean_t *no_crypt) | uint_t *auth_len, boolean_t *no_crypt) | ||||
{ | { | ||||
uint8_t *aadbuf = zio_buf_alloc(datalen); | uint8_t *aadbuf = zio_buf_alloc(datalen); | ||||
uint8_t *src, *dst, *aadp; | uint8_t *src, *dst, *aadp; | ||||
dnode_phys_t *dnp, *adnp, *sdnp, *ddnp; | dnode_phys_t *dnp, *adnp, *sdnp, *ddnp; | ||||
iovec_t *dst_iovecs; | iovec_t *dst_iovecs; | ||||
uint_t nr_iovecs, crypt_len, vec; | uint_t nr_iovecs, crypt_len, vec; | ||||
uint_t aad_len = 0, total_len = 0; | uint_t aad_len = 0, total_len = 0; | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | zio_crypt_init_uios_dnode(boolean_t encrypt, uint64_t version, | ||||
/* MAC */ | /* MAC */ | ||||
dst_iovecs[vec].iov_base = 0; | dst_iovecs[vec].iov_base = 0; | ||||
dst_iovecs[vec].iov_len = 0; | dst_iovecs[vec].iov_len = 0; | ||||
*no_crypt = (vec == 1); | *no_crypt = (vec == 1); | ||||
*enc_len = total_len; | *enc_len = total_len; | ||||
*authbuf = aadbuf; | *authbuf = aadbuf; | ||||
*auth_len = aad_len; | *auth_len = aad_len; | ||||
out_uio->uio_iov = dst_iovecs; | GET_UIO_STRUCT(out_uio)->uio_iov = dst_iovecs; | ||||
out_uio->uio_iovcnt = nr_iovecs; | zfs_uio_iovcnt(out_uio) = nr_iovecs; | ||||
return (0); | return (0); | ||||
} | } | ||||
/* ARGSUSED */ | /* ARGSUSED */ | ||||
static int | static int | ||||
zio_crypt_init_uios_normal(boolean_t encrypt, uint8_t *plainbuf, | zio_crypt_init_uios_normal(boolean_t encrypt, uint8_t *plainbuf, | ||||
uint8_t *cipherbuf, uint_t datalen, uio_t *puio, uio_t *out_uio, | uint8_t *cipherbuf, uint_t datalen, zfs_uio_t *puio, zfs_uio_t *out_uio, | ||||
uint_t *enc_len) | uint_t *enc_len) | ||||
{ | { | ||||
int ret; | int ret; | ||||
uint_t nr_plain = 1, nr_cipher = 2; | uint_t nr_plain = 1, nr_cipher = 2; | ||||
iovec_t *plain_iovecs = NULL, *cipher_iovecs = NULL; | iovec_t *plain_iovecs = NULL, *cipher_iovecs = NULL; | ||||
void *src, *dst; | void *src, *dst; | ||||
cipher_iovecs = kmem_alloc(nr_cipher * sizeof (iovec_t), | cipher_iovecs = kmem_alloc(nr_cipher * sizeof (iovec_t), | ||||
Show All 11 Lines | if (encrypt) { | ||||
src = cipherbuf; | src = cipherbuf; | ||||
dst = plainbuf; | dst = plainbuf; | ||||
} | } | ||||
bcopy(src, dst, datalen); | bcopy(src, dst, datalen); | ||||
cipher_iovecs[0].iov_base = dst; | cipher_iovecs[0].iov_base = dst; | ||||
cipher_iovecs[0].iov_len = datalen; | cipher_iovecs[0].iov_len = datalen; | ||||
*enc_len = datalen; | *enc_len = datalen; | ||||
out_uio->uio_iov = cipher_iovecs; | GET_UIO_STRUCT(out_uio)->uio_iov = cipher_iovecs; | ||||
out_uio->uio_iovcnt = nr_cipher; | zfs_uio_iovcnt(out_uio) = nr_cipher; | ||||
return (0); | return (0); | ||||
error: | error: | ||||
if (plain_iovecs != NULL) | if (plain_iovecs != NULL) | ||||
kmem_free(plain_iovecs, nr_plain * sizeof (iovec_t)); | kmem_free(plain_iovecs, nr_plain * sizeof (iovec_t)); | ||||
if (cipher_iovecs != NULL) | if (cipher_iovecs != NULL) | ||||
kmem_free(cipher_iovecs, nr_cipher * sizeof (iovec_t)); | kmem_free(cipher_iovecs, nr_cipher * sizeof (iovec_t)); | ||||
*enc_len = 0; | *enc_len = 0; | ||||
out_uio->uio_iov = NULL; | GET_UIO_STRUCT(out_uio)->uio_iov = NULL; | ||||
out_uio->uio_iovcnt = 0; | zfs_uio_iovcnt(out_uio) = 0; | ||||
return (ret); | return (ret); | ||||
} | } | ||||
/* | /* | ||||
* This function builds up the plaintext (puio) and ciphertext (cuio) uios so | * This function builds up the plaintext (puio) and ciphertext (cuio) uios so | ||||
* that they can be used for encryption and decryption by zio_do_crypt_uio(). | * that they can be used for encryption and decryption by zio_do_crypt_uio(). | ||||
* Most blocks will use zio_crypt_init_uios_normal(), with ZIL and dnode blocks | * Most blocks will use zio_crypt_init_uios_normal(), with ZIL and dnode blocks | ||||
* requiring special handling to parse out pieces that are to be encrypted. The | * requiring special handling to parse out pieces that are to be encrypted. The | ||||
* authbuf is used by these special cases to store additional authenticated | * authbuf is used by these special cases to store additional authenticated | ||||
* data (AAD) for the encryption modes. | * data (AAD) for the encryption modes. | ||||
*/ | */ | ||||
static int | static int | ||||
zio_crypt_init_uios(boolean_t encrypt, uint64_t version, dmu_object_type_t ot, | zio_crypt_init_uios(boolean_t encrypt, uint64_t version, dmu_object_type_t ot, | ||||
uint8_t *plainbuf, uint8_t *cipherbuf, uint_t datalen, boolean_t byteswap, | uint8_t *plainbuf, uint8_t *cipherbuf, uint_t datalen, boolean_t byteswap, | ||||
uint8_t *mac, uio_t *puio, uio_t *cuio, uint_t *enc_len, uint8_t **authbuf, | uint8_t *mac, zfs_uio_t *puio, zfs_uio_t *cuio, uint_t *enc_len, | ||||
uint_t *auth_len, boolean_t *no_crypt) | uint8_t **authbuf, uint_t *auth_len, boolean_t *no_crypt) | ||||
{ | { | ||||
int ret; | int ret; | ||||
iovec_t *mac_iov; | iovec_t *mac_iov; | ||||
ASSERT(DMU_OT_IS_ENCRYPTED(ot) || ot == DMU_OT_NONE); | ASSERT(DMU_OT_IS_ENCRYPTED(ot) || ot == DMU_OT_NONE); | ||||
/* route to handler */ | /* route to handler */ | ||||
switch (ot) { | switch (ot) { | ||||
Show All 15 Lines | default: | ||||
*no_crypt = B_FALSE; | *no_crypt = B_FALSE; | ||||
break; | break; | ||||
} | } | ||||
if (ret != 0) | if (ret != 0) | ||||
goto error; | goto error; | ||||
/* populate the uios */ | /* populate the uios */ | ||||
cuio->uio_segflg = UIO_SYSSPACE; | zfs_uio_segflg(cuio) = UIO_SYSSPACE; | ||||
mac_iov = ((iovec_t *)&cuio->uio_iov[cuio->uio_iovcnt - 1]); | mac_iov = | ||||
((iovec_t *)&(GET_UIO_STRUCT(cuio)-> | |||||
uio_iov[zfs_uio_iovcnt(cuio) - 1])); | |||||
mac_iov->iov_base = (void *)mac; | mac_iov->iov_base = (void *)mac; | ||||
mac_iov->iov_len = ZIO_DATA_MAC_LEN; | mac_iov->iov_len = ZIO_DATA_MAC_LEN; | ||||
return (0); | return (0); | ||||
error: | error: | ||||
return (ret); | return (ret); | ||||
} | } | ||||
Show All 10 Lines | zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key, | ||||
uint8_t *mac, uint_t datalen, uint8_t *plainbuf, uint8_t *cipherbuf, | uint8_t *mac, uint_t datalen, uint8_t *plainbuf, uint8_t *cipherbuf, | ||||
boolean_t *no_crypt) | boolean_t *no_crypt) | ||||
{ | { | ||||
int ret; | int ret; | ||||
boolean_t locked = B_FALSE; | boolean_t locked = B_FALSE; | ||||
uint64_t crypt = key->zk_crypt; | uint64_t crypt = key->zk_crypt; | ||||
uint_t keydata_len = zio_crypt_table[crypt].ci_keylen; | uint_t keydata_len = zio_crypt_table[crypt].ci_keylen; | ||||
uint_t enc_len, auth_len; | uint_t enc_len, auth_len; | ||||
uio_t puio, cuio; | zfs_uio_t puio, cuio; | ||||
struct uio puio_s, cuio_s; | |||||
uint8_t enc_keydata[MASTER_KEY_MAX_LEN]; | uint8_t enc_keydata[MASTER_KEY_MAX_LEN]; | ||||
crypto_key_t tmp_ckey, *ckey = NULL; | crypto_key_t tmp_ckey, *ckey = NULL; | ||||
freebsd_crypt_session_t *tmpl = NULL; | freebsd_crypt_session_t *tmpl = NULL; | ||||
uint8_t *authbuf = NULL; | uint8_t *authbuf = NULL; | ||||
bzero(&puio, sizeof (uio_t)); | |||||
bzero(&cuio, sizeof (uio_t)); | zfs_uio_init(&puio, &puio_s); | ||||
zfs_uio_init(&cuio, &cuio_s); | |||||
bzero(GET_UIO_STRUCT(&puio), sizeof (struct uio)); | |||||
bzero(GET_UIO_STRUCT(&cuio), sizeof (struct uio)); | |||||
#ifdef FCRYPTO_DEBUG | #ifdef FCRYPTO_DEBUG | ||||
printf("%s(%s, %p, %p, %d, %p, %p, %u, %s, %p, %p, %p)\n", | printf("%s(%s, %p, %p, %d, %p, %p, %u, %s, %p, %p, %p)\n", | ||||
__FUNCTION__, | __FUNCTION__, | ||||
encrypt ? "encrypt" : "decrypt", | encrypt ? "encrypt" : "decrypt", | ||||
key, salt, ot, iv, mac, datalen, | key, salt, ot, iv, mac, datalen, | ||||
byteswap ? "byteswap" : "native_endian", plainbuf, | byteswap ? "byteswap" : "native_endian", plainbuf, | ||||
cipherbuf, no_crypt); | cipherbuf, no_crypt); | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |