tfm = crypto_alloc_tfm("sha1", 0); 
tfm = crypto_alloc_tfm("sha1", CRYPTO_TFM_REQ_MAY_SLEEP); 
plaintext_to_sha1(unsigned char *hash, const char *plaintext, int len){	char *pgVirtAddr;	struct crypto_tfm *tfm;	struct scatterlist sg[1];	if (len > PAGE_SIZE) {		seclvl_printk(0, KERN_ERR, "Plaintext password too large (%d "			      "characters).  Largest possible is %lu "			      "bytes.\n", len, PAGE_SIZE);		return -ENOMEM;	}	tfm = crypto_alloc_tfm("sha1", 0);	if (tfm == NULL) {		seclvl_printk(0, KERN_ERR,			      "Failed to load transform for SHA1\n");		return -ENOSYS;	}	// Just get a new page; don't play around with page boundaries	// and scatterlists.	pgVirtAddr = (char *)__get_free_page(GFP_KERNEL);	sg[0].page = virt_to_page(pgVirtAddr);	sg[0].offset = 0;	sg[0].length = len;	strncpy(pgVirtAddr, plaintext, len);	crypto_digest_init(tfm);	crypto_digest_update(tfm, sg, 1);	crypto_digest_final(tfm, hash);	crypto_free_tfm(tfm);	free_page((unsigned long)pgVirtAddr);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/eb6f1160ddb2fdadf50f350da79d0796c37f17e2/seclvl.c/clean/security/seclvl.c