module: icp: fix unused, remove argsused
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12844
This commit is contained in:
parent
14e4e3cb9f
commit
18e4f67960
|
@ -206,7 +206,6 @@ aes_decrypt_block(const void *ks, const uint8_t *ct, uint8_t *pt)
|
|||
* size Size of key schedule allocated, in bytes
|
||||
* kmflag Flag passed to kmem_alloc(9F); ignored in userland.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
aes_alloc_keysched(size_t *size, int kmflag)
|
||||
{
|
||||
|
|
|
@ -137,7 +137,6 @@ out:
|
|||
#define OTHER(a, ctx) \
|
||||
(((a) == (ctx)->cbc_lastblock) ? (ctx)->cbc_iv : (ctx)->cbc_lastblock)
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
cbc_decrypt_contiguous_blocks(cbc_ctx_t *ctx, char *data, size_t length,
|
||||
crypto_data_t *out, size_t block_size,
|
||||
|
@ -259,7 +258,6 @@ cbc_init_ctx(cbc_ctx_t *cbc_ctx, char *param, size_t param_len,
|
|||
return (CRYPTO_SUCCESS);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
cbc_alloc_ctx(int kmflag)
|
||||
{
|
||||
|
|
|
@ -190,7 +190,6 @@ calculate_ccm_mac(ccm_ctx_t *ctx, uint8_t *ccm_mac,
|
|||
}
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
ccm_encrypt_final(ccm_ctx_t *ctx, crypto_data_t *out, size_t block_size,
|
||||
int (*encrypt_block)(const void *, const uint8_t *, uint8_t *),
|
||||
|
@ -342,7 +341,6 @@ ccm_decrypt_incomplete_block(ccm_ctx_t *ctx,
|
|||
* returned to the caller. It will be returned when decrypt_final() is
|
||||
* called if the MAC matches
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
ccm_mode_decrypt_contiguous_blocks(ccm_ctx_t *ctx, char *data, size_t length,
|
||||
crypto_data_t *out, size_t block_size,
|
||||
|
@ -350,6 +348,7 @@ ccm_mode_decrypt_contiguous_blocks(ccm_ctx_t *ctx, char *data, size_t length,
|
|||
void (*copy_block)(uint8_t *, uint8_t *),
|
||||
void (*xor_block)(uint8_t *, uint8_t *))
|
||||
{
|
||||
(void) out;
|
||||
size_t remainder = length;
|
||||
size_t need = 0;
|
||||
uint8_t *datap = (uint8_t *)data;
|
||||
|
|
|
@ -214,7 +214,6 @@ ctr_init_ctx(ctr_ctx_t *ctr_ctx, ulong_t count, uint8_t *cb,
|
|||
return (CRYPTO_SUCCESS);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
ctr_alloc_ctx(int kmflag)
|
||||
{
|
||||
|
|
|
@ -114,7 +114,6 @@ out:
|
|||
return (CRYPTO_SUCCESS);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
ecb_alloc_ctx(int kmflag)
|
||||
{
|
||||
|
|
|
@ -199,13 +199,13 @@ out:
|
|||
return (CRYPTO_SUCCESS);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
gcm_encrypt_final(gcm_ctx_t *ctx, crypto_data_t *out, size_t block_size,
|
||||
int (*encrypt_block)(const void *, const uint8_t *, uint8_t *),
|
||||
void (*copy_block)(uint8_t *, uint8_t *),
|
||||
void (*xor_block)(uint8_t *, uint8_t *))
|
||||
{
|
||||
(void) copy_block;
|
||||
#ifdef CAN_USE_GCM_ASM
|
||||
if (ctx->gcm_use_avx == B_TRUE)
|
||||
return (gcm_encrypt_final_avx(ctx, out, block_size));
|
||||
|
@ -324,7 +324,6 @@ gcm_decrypt_incomplete_block(gcm_ctx_t *ctx, size_t block_size, size_t index,
|
|||
}
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
gcm_mode_decrypt_contiguous_blocks(gcm_ctx_t *ctx, char *data, size_t length,
|
||||
crypto_data_t *out, size_t block_size,
|
||||
|
@ -332,6 +331,8 @@ gcm_mode_decrypt_contiguous_blocks(gcm_ctx_t *ctx, char *data, size_t length,
|
|||
void (*copy_block)(uint8_t *, uint8_t *),
|
||||
void (*xor_block)(uint8_t *, uint8_t *))
|
||||
{
|
||||
(void) out, (void) block_size, (void) encrypt_block, (void) copy_block,
|
||||
(void) xor_block;
|
||||
size_t new_len;
|
||||
uint8_t *new;
|
||||
|
||||
|
|
|
@ -154,26 +154,26 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
aes_encrypt_intel(const uint32_t rk[], int Nr, const uint32_t pt[4],
|
||||
uint32_t ct[4]) {
|
||||
(void) rk, (void) Nr, (void) pt, (void) ct;
|
||||
}
|
||||
/* ARGSUSED */
|
||||
void
|
||||
aes_decrypt_intel(const uint32_t rk[], int Nr, const uint32_t ct[4],
|
||||
uint32_t pt[4]) {
|
||||
(void) rk, (void) Nr, (void) ct, (void) pt;
|
||||
}
|
||||
/* ARGSUSED */
|
||||
int
|
||||
rijndael_key_setup_enc_intel(uint32_t rk[], const uint32_t cipherKey[],
|
||||
uint64_t keyBits) {
|
||||
(void) rk, (void) cipherKey, (void) keyBits;
|
||||
return (0);
|
||||
}
|
||||
/* ARGSUSED */
|
||||
int
|
||||
rijndael_key_setup_dec_intel(uint32_t rk[], const uint32_t cipherKey[],
|
||||
uint64_t keyBits) {
|
||||
(void) rk, (void) cipherKey, (void) keyBits;
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
@ -186,15 +186,15 @@
|
|||
#if defined(lint) || defined(__lint)
|
||||
|
||||
#include <sys/types.h>
|
||||
/* ARGSUSED */
|
||||
void
|
||||
aes_encrypt_amd64(const uint32_t rk[], int Nr, const uint32_t pt[4],
|
||||
uint32_t ct[4]) {
|
||||
(void) rk, (void) Nr, (void) pt, (void) ct;
|
||||
}
|
||||
/* ARGSUSED */
|
||||
void
|
||||
aes_decrypt_amd64(const uint32_t rk[], int Nr, const uint32_t ct[4],
|
||||
uint32_t pt[4]) {
|
||||
(void) rk, (void) Nr, (void) pt, (void) ct;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -85,9 +85,9 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
gcm_mul_pclmulqdq(uint64_t *x_in, uint64_t *y, uint64_t *res) {
|
||||
(void) x_in, (void) y, (void) res;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_PCLMULQDQ) /* guard by instruction set */
|
||||
|
|
|
@ -59,10 +59,10 @@
|
|||
#include <sys/sha1.h>
|
||||
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
sha1_block_data_order(SHA1_CTX *ctx, const void *inpp, size_t blocks)
|
||||
{
|
||||
(void) ctx, (void) inpp, (void) blocks;
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
@ -71,10 +71,10 @@
|
|||
#include <sys/stdint.h>
|
||||
#include <sha2/sha2.h>
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
SHA256TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num)
|
||||
{
|
||||
(void) ctx, (void) in, (void) num;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -72,10 +72,10 @@
|
|||
#include <sys/stdint.h>
|
||||
#include <sha2/sha2.h>
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
SHA512TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num)
|
||||
{
|
||||
(void) ctx, (void) in, (void) num;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -786,6 +786,6 @@ kcf_get_mech_entry(crypto_mech_type_t mech_type, kcf_mech_entry_t **mep)
|
|||
crypto_mech_type_t
|
||||
crypto_mech2id_common(char *mechname, boolean_t load_module)
|
||||
{
|
||||
crypto_mech_type_t mt = kcf_mech_hash_find(mechname);
|
||||
return (mt);
|
||||
(void) load_module;
|
||||
return (kcf_mech_hash_find(mechname));
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ int
|
|||
crypto_uio_data(crypto_data_t *data, uchar_t *buf, int len, cmd_type_t cmd,
|
||||
void *digest_ctx, void (*update)(void))
|
||||
{
|
||||
(void) digest_ctx, (void) update;
|
||||
zfs_uio_t *uiop = data->cd_uio;
|
||||
off_t offset = data->cd_offset;
|
||||
size_t length = len;
|
||||
|
|
|
@ -970,10 +970,10 @@ kcf_enqueue(kcf_areq_node_t *node)
|
|||
/*
|
||||
* kmem_cache_alloc constructor for sync request structure.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
kcf_sreq_cache_constructor(void *buf, void *cdrarg, int kmflags)
|
||||
{
|
||||
(void) cdrarg, (void) kmflags;
|
||||
kcf_sreq_node_t *sreq = (kcf_sreq_node_t *)buf;
|
||||
|
||||
sreq->sn_type = CRYPTO_SYNCH;
|
||||
|
@ -983,10 +983,10 @@ kcf_sreq_cache_constructor(void *buf, void *cdrarg, int kmflags)
|
|||
return (0);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
kcf_sreq_cache_destructor(void *buf, void *cdrarg)
|
||||
{
|
||||
(void) cdrarg;
|
||||
kcf_sreq_node_t *sreq = (kcf_sreq_node_t *)buf;
|
||||
|
||||
mutex_destroy(&sreq->sn_lock);
|
||||
|
@ -996,10 +996,10 @@ kcf_sreq_cache_destructor(void *buf, void *cdrarg)
|
|||
/*
|
||||
* kmem_cache_alloc constructor for async request structure.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
kcf_areq_cache_constructor(void *buf, void *cdrarg, int kmflags)
|
||||
{
|
||||
(void) cdrarg, (void) kmflags;
|
||||
kcf_areq_node_t *areq = (kcf_areq_node_t *)buf;
|
||||
|
||||
areq->an_type = CRYPTO_ASYNCH;
|
||||
|
@ -1011,10 +1011,10 @@ kcf_areq_cache_constructor(void *buf, void *cdrarg, int kmflags)
|
|||
return (0);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
kcf_areq_cache_destructor(void *buf, void *cdrarg)
|
||||
{
|
||||
(void) cdrarg;
|
||||
kcf_areq_node_t *areq = (kcf_areq_node_t *)buf;
|
||||
|
||||
ASSERT(areq->an_refcnt == 0);
|
||||
|
@ -1026,10 +1026,10 @@ kcf_areq_cache_destructor(void *buf, void *cdrarg)
|
|||
/*
|
||||
* kmem_cache_alloc constructor for kcf_context structure.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
kcf_context_cache_constructor(void *buf, void *cdrarg, int kmflags)
|
||||
{
|
||||
(void) cdrarg, (void) kmflags;
|
||||
kcf_context_t *kctx = (kcf_context_t *)buf;
|
||||
|
||||
kctx->kc_refcnt = 0;
|
||||
|
@ -1038,10 +1038,10 @@ kcf_context_cache_constructor(void *buf, void *cdrarg, int kmflags)
|
|||
return (0);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
kcf_context_cache_destructor(void *buf, void *cdrarg)
|
||||
{
|
||||
(void) cdrarg;
|
||||
kcf_context_t *kctx = (kcf_context_t *)buf;
|
||||
|
||||
ASSERT(kctx->kc_refcnt == 0);
|
||||
|
|
|
@ -311,10 +311,10 @@ init_keysched(crypto_key_t *key, void *newbie)
|
|||
/*
|
||||
* KCF software provider control entry points.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
aes_provider_status(crypto_provider_handle_t provider, uint_t *status)
|
||||
{
|
||||
(void) provider;
|
||||
*status = CRYPTO_PROVIDER_READY;
|
||||
}
|
||||
|
||||
|
@ -617,11 +617,11 @@ cleanup:
|
|||
}
|
||||
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
aes_encrypt_update(crypto_ctx_t *ctx, crypto_data_t *plaintext,
|
||||
crypto_data_t *ciphertext, crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
off_t saved_offset;
|
||||
size_t saved_length, out_len;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
|
@ -769,11 +769,11 @@ aes_decrypt_update(crypto_ctx_t *ctx, crypto_data_t *ciphertext,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
aes_encrypt_final(crypto_ctx_t *ctx, crypto_data_t *data,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
aes_ctx_t *aes_ctx;
|
||||
int ret;
|
||||
|
||||
|
@ -826,11 +826,11 @@ aes_encrypt_final(crypto_ctx_t *ctx, crypto_data_t *data,
|
|||
return (CRYPTO_SUCCESS);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
aes_decrypt_final(crypto_ctx_t *ctx, crypto_data_t *data,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
aes_ctx_t *aes_ctx;
|
||||
int ret;
|
||||
off_t saved_offset;
|
||||
|
@ -929,13 +929,13 @@ aes_decrypt_final(crypto_ctx_t *ctx, crypto_data_t *data,
|
|||
return (CRYPTO_SUCCESS);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
aes_encrypt_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *plaintext, crypto_data_t *ciphertext,
|
||||
crypto_spi_ctx_template_t template, crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider, (void) session_id;
|
||||
aes_ctx_t aes_ctx; /* on the stack */
|
||||
off_t saved_offset;
|
||||
size_t saved_length;
|
||||
|
@ -1065,13 +1065,13 @@ out:
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
aes_decrypt_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *ciphertext, crypto_data_t *plaintext,
|
||||
crypto_spi_ctx_template_t template, crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider, (void) session_id;
|
||||
aes_ctx_t aes_ctx; /* on the stack */
|
||||
off_t saved_offset;
|
||||
size_t saved_length;
|
||||
|
@ -1235,12 +1235,12 @@ out:
|
|||
/*
|
||||
* KCF software provider context template entry points.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
aes_create_ctx_template(crypto_provider_handle_t provider,
|
||||
crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
crypto_spi_ctx_template_t *tmpl, size_t *tmpl_size, crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider;
|
||||
void *keysched;
|
||||
size_t size;
|
||||
int rv;
|
||||
|
|
|
@ -227,10 +227,10 @@ sha1_mod_fini(void)
|
|||
/*
|
||||
* KCF software provider control entry points.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
sha1_provider_status(crypto_provider_handle_t provider, uint_t *status)
|
||||
{
|
||||
(void) provider, (void) status;
|
||||
*status = CRYPTO_PROVIDER_READY;
|
||||
}
|
||||
|
||||
|
@ -409,11 +409,11 @@ sha1_digest_final_uio(SHA1_CTX *sha1_ctx, crypto_data_t *digest,
|
|||
return (CRYPTO_SUCCESS);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
|
||||
ASSERT(ctx->cc_provider_private != NULL);
|
||||
|
@ -483,11 +483,11 @@ sha1_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_digest_update(crypto_ctx_t *ctx, crypto_data_t *data,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
|
||||
ASSERT(ctx->cc_provider_private != NULL);
|
||||
|
@ -512,11 +512,11 @@ sha1_digest_update(crypto_ctx_t *ctx, crypto_data_t *data,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
|
||||
ASSERT(ctx->cc_provider_private != NULL);
|
||||
|
@ -561,13 +561,13 @@ sha1_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_digest_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_data_t *data, crypto_data_t *digest,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider, (void) session_id, (void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
SHA1_CTX sha1_ctx;
|
||||
|
||||
|
@ -754,10 +754,10 @@ sha1_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_mac_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
|
||||
ASSERT(ctx->cc_provider_private != NULL);
|
||||
|
@ -783,10 +783,10 @@ sha1_mac_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req)
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac, crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uchar_t digest[SHA1_DIGEST_LENGTH];
|
||||
uint32_t digest_len = SHA1_DIGEST_LENGTH;
|
||||
|
@ -877,13 +877,13 @@ sha1_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac, crypto_req_handle_t req)
|
|||
} \
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_mac_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider, (void) session_id, (void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uchar_t digest[SHA1_DIGEST_LENGTH];
|
||||
sha1_hmac_ctx_t sha1_hmac_ctx;
|
||||
|
@ -993,13 +993,13 @@ bail:
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_mac_verify_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider, (void) session_id, (void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uchar_t digest[SHA1_DIGEST_LENGTH];
|
||||
sha1_hmac_ctx_t sha1_hmac_ctx;
|
||||
|
@ -1147,13 +1147,13 @@ bail:
|
|||
* KCF software provider context management entry points.
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha1_create_ctx_template(crypto_provider_handle_t provider,
|
||||
crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
crypto_spi_ctx_template_t *ctx_template, size_t *ctx_template_size,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider;
|
||||
sha1_hmac_ctx_t *sha1_hmac_ctx_tmpl;
|
||||
uint_t keylen_in_bytes = CRYPTO_BITS2BYTES(key->ck_length);
|
||||
|
||||
|
|
|
@ -254,10 +254,10 @@ sha2_mod_fini(void)
|
|||
/*
|
||||
* KCF software provider control entry points.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
sha2_provider_status(crypto_provider_handle_t provider, uint_t *status)
|
||||
{
|
||||
(void) provider;
|
||||
*status = CRYPTO_PROVIDER_READY;
|
||||
}
|
||||
|
||||
|
@ -438,11 +438,11 @@ sha2_digest_final_uio(SHA2_CTX *sha2_ctx, crypto_data_t *digest,
|
|||
return (CRYPTO_SUCCESS);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uint_t sha_digest_len;
|
||||
|
||||
|
@ -526,11 +526,11 @@ sha2_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_digest_update(crypto_ctx_t *ctx, crypto_data_t *data,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
|
||||
ASSERT(ctx->cc_provider_private != NULL);
|
||||
|
@ -555,11 +555,11 @@ sha2_digest_update(crypto_ctx_t *ctx, crypto_data_t *data,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uint_t sha_digest_len;
|
||||
|
||||
|
@ -618,13 +618,13 @@ sha2_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_digest_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_data_t *data, crypto_data_t *digest,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider, (void) session_id, (void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
SHA2_CTX sha2_ctx;
|
||||
uint32_t sha_digest_len;
|
||||
|
@ -840,11 +840,11 @@ sha2_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_mac_update(crypto_ctx_t *ctx, crypto_data_t *data,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
|
||||
ASSERT(ctx->cc_provider_private != NULL);
|
||||
|
@ -870,10 +870,10 @@ sha2_mac_update(crypto_ctx_t *ctx, crypto_data_t *data,
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac, crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uchar_t digest[SHA512_DIGEST_LENGTH];
|
||||
uint32_t digest_len, sha_digest_len;
|
||||
|
@ -983,13 +983,13 @@ sha2_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac, crypto_req_handle_t req)
|
|||
} \
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_mac_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider, (void) session_id, (void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uchar_t digest[SHA512_DIGEST_LENGTH];
|
||||
sha2_hmac_ctx_t sha2_hmac_ctx;
|
||||
|
@ -1121,13 +1121,13 @@ bail:
|
|||
return (ret);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_mac_verify_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider, (void) session_id, (void) req;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uchar_t digest[SHA512_DIGEST_LENGTH];
|
||||
sha2_hmac_ctx_t sha2_hmac_ctx;
|
||||
|
@ -1301,13 +1301,13 @@ bail:
|
|||
* KCF software provider context management entry points.
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
sha2_create_ctx_template(crypto_provider_handle_t provider,
|
||||
crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
crypto_spi_ctx_template_t *ctx_template, size_t *ctx_template_size,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
(void) provider;
|
||||
sha2_hmac_ctx_t *sha2_hmac_ctx_tmpl;
|
||||
uint_t keylen_in_bytes = CRYPTO_BITS2BYTES(key->ck_length);
|
||||
uint32_t sha_digest_len, sha_hmac_block_size;
|
||||
|
|
|
@ -250,10 +250,10 @@ skein_mod_fini(void)
|
|||
/*
|
||||
* KCF software provider control entry points.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
skein_provider_status(crypto_provider_handle_t provider, uint_t *status)
|
||||
{
|
||||
(void) provider;
|
||||
*status = CRYPTO_PROVIDER_READY;
|
||||
}
|
||||
|
||||
|
@ -462,10 +462,10 @@ skein_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest,
|
|||
* can push more data). This is used both for digest and MAC operation.
|
||||
* Supported input data formats are raw, uio and mblk.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
skein_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req)
|
||||
{
|
||||
(void) req;
|
||||
int error = CRYPTO_SUCCESS;
|
||||
|
||||
ASSERT(SKEIN_CTX(ctx) != NULL);
|
||||
|
@ -491,7 +491,6 @@ skein_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req)
|
|||
* for digest and MAC operation.
|
||||
* Supported output digest formats are raw, uio and mblk.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
skein_final(crypto_ctx_t *ctx, crypto_data_t *digest, crypto_req_handle_t req)
|
||||
{
|
||||
|
@ -537,15 +536,15 @@ skein_final(crypto_ctx_t *ctx, crypto_data_t *digest, crypto_req_handle_t req)
|
|||
* `data' and writing the output to `digest'.
|
||||
* Supported input/output formats are raw, uio and mblk.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
skein_digest_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_data_t *data, crypto_data_t *digest, crypto_req_handle_t req)
|
||||
{
|
||||
int error;
|
||||
skein_ctx_t skein_ctx;
|
||||
crypto_ctx_t ctx;
|
||||
(void) provider, (void) session_id, (void) req;
|
||||
int error;
|
||||
skein_ctx_t skein_ctx;
|
||||
crypto_ctx_t ctx;
|
||||
SKEIN_CTX_LVALUE(&ctx) = &skein_ctx;
|
||||
|
||||
/* Init */
|
||||
|
@ -640,7 +639,6 @@ errout:
|
|||
* The MAC update and final calls are reused from the regular digest code.
|
||||
*/
|
||||
|
||||
/*ARGSUSED*/
|
||||
/*
|
||||
* Same as skein_digest_atomic, performs an atomic Skein MAC operation in
|
||||
* one step. All the same properties apply to the arguments of this
|
||||
|
@ -653,9 +651,10 @@ skein_mac_atomic(crypto_provider_handle_t provider,
|
|||
crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req)
|
||||
{
|
||||
/* faux crypto context just for skein_digest_{update,final} */
|
||||
int error;
|
||||
crypto_ctx_t ctx;
|
||||
skein_ctx_t skein_ctx;
|
||||
(void) provider, (void) session_id;
|
||||
int error;
|
||||
crypto_ctx_t ctx;
|
||||
skein_ctx_t skein_ctx;
|
||||
SKEIN_CTX_LVALUE(&ctx) = &skein_ctx;
|
||||
|
||||
if (ctx_template != NULL) {
|
||||
|
@ -686,15 +685,15 @@ errout:
|
|||
* properties apply to the arguments of this function as to those of
|
||||
* skein_mac_init.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
skein_create_ctx_template(crypto_provider_handle_t provider,
|
||||
crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
crypto_spi_ctx_template_t *ctx_template, size_t *ctx_template_size,
|
||||
crypto_req_handle_t req)
|
||||
{
|
||||
int error;
|
||||
skein_ctx_t *ctx_tmpl;
|
||||
(void) provider;
|
||||
int error;
|
||||
skein_ctx_t *ctx_tmpl;
|
||||
|
||||
ctx_tmpl = kmem_alloc(sizeof (*ctx_tmpl), crypto_kmflag(req));
|
||||
if (ctx_tmpl == NULL)
|
||||
|
|
|
@ -47,6 +47,7 @@ struct mod_ops mod_cryptoops = {
|
|||
static int
|
||||
mod_null(struct modlmisc *modl, struct modlinkage *modlp)
|
||||
{
|
||||
(void) modl, (void) modlp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -56,6 +57,7 @@ mod_null(struct modlmisc *modl, struct modlinkage *modlp)
|
|||
static int
|
||||
mod_infonull(void *modl, struct modlinkage *modlp, int *p0)
|
||||
{
|
||||
(void) modl, (void) modlp;
|
||||
*p0 = -1; /* for modinfo display */
|
||||
return (0);
|
||||
}
|
||||
|
|
|
@ -172,16 +172,16 @@ kmutex_t mh_head_lock;
|
|||
* mod_hash_null_valdtor()
|
||||
* no-op key and value destructors.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mod_hash_null_keydtor(mod_hash_key_t key)
|
||||
{
|
||||
(void) key;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mod_hash_null_valdtor(mod_hash_val_t val)
|
||||
{
|
||||
(void) val;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -198,10 +198,10 @@ mod_hash_null_valdtor(mod_hash_val_t val)
|
|||
* "Compilers: Principles, Tools & Techniques", by Aho, Sethi, Ullman
|
||||
*/
|
||||
|
||||
/*ARGSUSED*/
|
||||
uint_t
|
||||
mod_hash_bystr(void *hash_data, mod_hash_key_t key)
|
||||
{
|
||||
(void) hash_data;
|
||||
uint_t hash = 0;
|
||||
uint_t g;
|
||||
char *p, *k = (char *)key;
|
||||
|
@ -672,10 +672,10 @@ mod_hash_reserve_nosleep(mod_hash_t *hash, mod_hash_hndl_t *handlep)
|
|||
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mod_hash_cancel(mod_hash_t *hash, mod_hash_hndl_t *handlep)
|
||||
{
|
||||
(void) hash;
|
||||
kmem_cache_free(mh_e_cache, *handlep);
|
||||
*handlep = (mod_hash_hndl_t)0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue