示例#1
0
int __init crypto_ccm_module_init(void)
{
	int err;

	err = crypto_register_template(&crypto_ccm_base_tmpl);
	if (err)
		goto out;

	err = crypto_register_template(&crypto_ccm_tmpl);
	if (err)
		goto out_undo_base;

	err = crypto_register_template(&crypto_rfc4309_tmpl);
	if (err)
		goto out_undo_ccm;

out:
	return err;

out_undo_ccm:
	crypto_unregister_template(&crypto_ccm_tmpl);
out_undo_base:
	crypto_unregister_template(&crypto_ccm_base_tmpl);
	goto out;
}
示例#2
0
static int __init crypto_gcm_module_init(void)
{
	int err;

	gcm_zeroes = kzalloc(16, GFP_KERNEL);
	if (!gcm_zeroes)
		return -ENOMEM;

	err = crypto_register_template(&crypto_gcm_base_tmpl);
	if (err)
		goto out;

	err = crypto_register_template(&crypto_gcm_tmpl);
	if (err)
		goto out_undo_base;

	err = crypto_register_template(&crypto_rfc4106_tmpl);
	if (err)
		goto out_undo_gcm;

	return 0;

out_undo_gcm:
	crypto_unregister_template(&crypto_gcm_tmpl);
out_undo_base:
	crypto_unregister_template(&crypto_gcm_base_tmpl);
out:
	kfree(gcm_zeroes);
	return err;
}
示例#3
0
文件: ctr.c 项目: 03199618/linux
static int __init crypto_ctr_module_init(void)
{
	int err;

	err = crypto_register_template(&crypto_ctr_tmpl);
	if (err)
		goto out;

	err = crypto_register_template(&crypto_rfc3686_tmpl);
	if (err)
		goto out_drop_ctr;

out:
	return err;

out_drop_ctr:
	crypto_unregister_template(&crypto_ctr_tmpl);
	goto out;
}
示例#4
0
文件: cryptd.c 项目: 274914765/C
static int __init cryptd_init(void)
{
    int err;

    err = cryptd_create_thread(&state, cryptd_thread, "cryptd");
    if (err)
        return err;

    err = crypto_register_template(&cryptd_tmpl);
    if (err)
        kthread_stop(state.task);

    return err;
}
示例#5
0
文件: ofb.c 项目: avagin/linux
static int __init crypto_ofb_module_init(void)
{
	return crypto_register_template(&crypto_ofb_tmpl);
}
示例#6
0
static int __init echainiv_module_init(void)
{
    return crypto_register_template(&echainiv_tmpl);
}
int __init eseqiv_module_init(void)
{
	return crypto_register_template(&eseqiv_tmpl);
}
示例#8
0
文件: fpu.c 项目: CSCLOG/beaglebone
int __init crypto_fpu_init(void)
{
	return crypto_register_template(&crypto_fpu_tmpl);
}
示例#9
-1
static int __init pcrypt_init(void)
{
	int err = -ENOMEM;

	pcrypt_kset = kset_create_and_add("pcrypt", NULL, kernel_kobj);
	if (!pcrypt_kset)
		goto err;

	err = pcrypt_init_padata(&pencrypt, "pencrypt");
	if (err)
		goto err_unreg_kset;

	err = pcrypt_init_padata(&pdecrypt, "pdecrypt");
	if (err)
		goto err_deinit_pencrypt;

	padata_start(pencrypt.pinst);
	padata_start(pdecrypt.pinst);

	return crypto_register_template(&pcrypt_tmpl);

err_deinit_pencrypt:
	pcrypt_fini_padata(&pencrypt);
err_unreg_kset:
	kset_unregister(pcrypt_kset);
err:
	return err;
}