[U-Boot] Compiling polarssl lib in uboot

Hello,
i want to use the crypto functions from polarssl in uboot. My crypto lib choice is polarssl [http://polarssl.org/] and my target is an omap4 panda board.
My first attempt was to extract the needed source files and headers from polarssl and copy them to uboot directories and modify the uboot makefiles to compile them together with uboot. This works but is not optimal. I also have had to modify some includes and replace them by compiler.h for example.
So now i want to compile polarssl as a whole lib and link it in uboot. But i don't know the "right" way to do this.
First problem: I can't cross compile the polarssl lib with the same toolchain i use for uboot. For compiling uboot i use an arm-linux-androideabi toolchain. For polarssl compilation i can't use this lib because it contains no std headers like string.h for example. So i thought that i can compile this lib inside the uboot directory. As they are already some projects in the lib directory i hope to be successfull with this approach.
But i don't know how. My understanding of the uboot makefiles is not 100%.
My imagination tells me it has to be something like: - copy polarssl into uboot/lib - modify some uboot makefiles (tell uboot to compile the lib) - modify some polarssl makefiles (tell polarssl which compiler is used and where std headers of uboot are) - modify uboot sources to use polarssl headers for crypto (#include "polarssl/sha3.h") - compile like always - finished - everything works fine
Does someone have any guidelines for me how to achieve this? Which uboot makefiles do i have to edit? Is my plan even feasible?
Greetings and thx in advance Peter

On Thu, Oct 18, 2012 at 01:50:18PM +0200, Peter Czypek wrote:
Hello,
i want to use the crypto functions from polarssl in uboot. My crypto lib choice is polarssl [http://polarssl.org/] and my target is an omap4 panda board.
What are you trying to accomplish exactly?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I want to verify signed data in a "nice" and "proper" way. Which would be using a lib, in my opinion.
Am 18.10.2012 19:45, schrieb Tom Rini:
On Thu, Oct 18, 2012 at 01:50:18PM +0200, Peter Czypek wrote:
Hello,
i want to use the crypto functions from polarssl in uboot. My crypto lib choice is polarssl [http://polarssl.org/] and my target is an omap4 panda board.
What are you trying to accomplish exactly?
- -- Dipl.-Ing. Peter Czypek Security Engineer ESCRYPT GmbH - Embedded Security
Email: peter.czypek@escrypt.com PGP key: www.escrypt.com/keyserver/peter.czypek PGP Fingerprint: ED4B 1129 31F0 A93A 2307 9C90 5D14 02C6 1D41 DE63 Phone: +49 234 43870-222 Mobil: +49 151 402390-22 Address: Lise-Meitner-Allee 4, 44801 Bochum, Germany Internet: www.escrypt.com
Managing directors: Dr.-Ing. Jan Pelzl, Dr.-Ing. André Weimerskirch, Dr.-Ing. Thomas Wollinger Registered office and court of registry: Bochum, Germany, HRB 7877

On Fri, Oct 19, 2012 at 09:41:22AM +0200, Peter Czypek wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I want to verify signed data in a "nice" and "proper" way. Which would be using a lib, in my opinion.
So you want to add a command that uses it, OK. I would see lib/zlib or lib/lzma for examples of how other libraries have been imported.
participants (2)
-
Peter Czypek
-
Tom Rini