/* Prior to allowing load, try to load the arc4 and sha1 crypto libraries. The actual use will be allocated later, but this way the module will fail to insmod if they aren't available.  */
static int __init ppp_mppe_init(void)
/* Prior to allowing load, try to load the arc4 and sha1 crypto libraries. The actual use will be allocated later, but this way the module will fail to insmod if they aren't available.  */
static int __init ppp_mppe_init(void)
{
	int answer;
	if (!(crypto_has_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC) &&
	      crypto_has_hash("sha1", 0, CRYPTO_ALG_ASYNC)))
		return -ENODEV;
	sha_pad = kmalloc(sizeof(struct sha_pad), GFP_KERNEL);
	if (!sha_pad)
		return -ENOMEM;
	sha_pad_init(sha_pad);
	answer = ppp_register_compressor(&ppp_mppe);
	if (answer == 0)
		printk(KERN_INFO "PPP MPPE Compression module registered\n");
	else
		kfree(sha_pad);
	return answer;
}