AES Encryption Error: Unknown symbol crypto_alloc_base

126 views
Skip to first unread message

barun parichha

unread,
Feb 6, 2012, 6:52:19 AM2/6/12
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

Vladimir Pantelic

unread,
Feb 6, 2012, 10:30:19 AM2/6/12
to beagl...@googlegroups.com
barun parichha wrote:
> 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"

http://docs.blackfin.uclinux.org/kernel/generated/kernel-hacking/ch09s02.html

barun parichha

unread,
Feb 7, 2012, 12:40:21 AM2/7/12
to beagl...@googlegroups.com
Thanks to Vladimir Pantelic for his quickest response.
After adding below lines to the end of my module, it started working.

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Barun code for aes encryption test");
MODULE_AUTHOR("Barun Parichha<barun.p...@gmail.com>");
MODULE_ALIAS("test");


Regards,
Barun Parichha

Reply all
Reply to author
Forward
0 new messages