# how to add new crypto algorithm inside the kernel



## solomonml (Oct 21, 2010)

Hi all,

I am using FreeBSD 7.2. I am trying to add one new encryption algorithm to the crypto library of IPsec. I added the .h and .c files of my new algorithm to opencrypto directory. I also modified the xform.h and xform.c of opencrypto to suite my needs. Finally I buildt the kernel. 

My .c file is not compiled. I thought every .c file inside opencrypto will be compiled by default. But, this is not the case and there are undefined reference errors. I tried to see the makefile in /sys/ directory but I cant figure it out. 

Please tell me where can I add some lines so that my .c file will be compiled and linked properly.

Thanx in advance
Solomon


----------



## richardpl (Oct 21, 2010)

Hmm, if I'm not wrong crypto stuff is built as module so you will need to modify /sys/modules/* stuff.

For building inside kernel, look into /sys/conf/files.*


----------



## solomonml (Oct 24, 2010)

Thanks richardpl.

I modified the /sys/conf/ files and the build and installation process completed successfully. But, when I try to add some IPsec security associations manually, there is "invalid argument" error. May be it's the reason since I didn't modify /sys/modules/*. I will try to modify and I will post my findings soon.


----------

