barun parichha
unread,Feb 6, 2012, 6:52:19 AM2/6/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Beagle Board
Hi,
I am trying to achieve AES encryption in one of my kernel module
(Linux version 2.6.34), but during insmod I got error :
"aestest: Unknown symbol crypto_alloc_base
insmod: error inserting 'aestest.ko': -1 Unknown symbol in module"
I am using beagleboard-XM RevC and AES encryption is enable in my
kernel. Giving below my test code for your confirmation and test.
>>>>>>>>>>>>>>>>>>>>>>>My kernel source file :aestest.c
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/crypto.h>
#define ALG_CCMP_KEY_LEN 16
int init_module(void)
{
struct crypto_cipher *tfm;
const u8 key[16]= "my key";
u8 in[20] ="I Love India";
u8 encrypted[200];
u8 decrypted[200];
printk(KERN_INFO ">>>>>>>>aesModule Insmoded>>>>>>>>\n");
printk(KERN_INFO ">>>>>>>>Plain:%s \n",in);
tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
//if (!IS_ERR(tfm))
crypto_cipher_setkey(tfm, key, ALG_CCMP_KEY_LEN);
crypto_cipher_encrypt_one(tfm, encrypted, in);
printk(KERN_INFO ">>>>Encrypted :%s \n",encrypted);
crypto_cipher_decrypt_one(tfm, decrypted, encrypted);
printk(KERN_INFO ">>>>Decrypted :%s \n ",decrypted);
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO ">>>>>>>>aesModule Removed>>>>>>>>\n");
}
>>>>>>>>>>>>>>My Makefile:
obj-m += aesTest.o
KDIR := /home/barun/try-kernel/
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
>>>>>>>>>>>>>>>>Compile as :
make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi-
>>>>>>>>>>>>>>>insmod the module
#insmod aestest.ko
aestest: Unknown symbol crypto_alloc_base
insmod: error inserting 'aestest.ko': -1 Unknown symbol in module
Any help will be appreciated.
Regards,
Barun Parichha