PolarSSL is now part of ARM Official announcement and rebranded as mbed TLS.

PBKDF2 source code

Password-Based Key Derivation Function 2

The source code for PBFDK2 in C, also called the Password-Based Key Derivation Function 2, is part of PKCS#5 v2.0 and defined in RFC2898. This source code is part of the mbed TLS library and represents the most current version in the trunk of the library.
Download mbed TLS

The full standard for PBKDF2 is described in the RFC2898.

The code has a dependency on config.h in the pbkdf2.c source code file and on md.h in the pbkdf2.h header file. You can remove the inclusion of config.h or just create a simple header file to define one or more of the configuration options that the PBKDF2 source code has. In addition md.h depends on the hashing functions you intend to use within PBKDF2.

Full documentation on the PBKDF2 source code can be found in the API documentation for the PBKDF2.

You can also download it as part of the latest release of mbed TLS.

Header - pbkdf2.h

The pbkdf2.h header can also be found in the trunk on: pbkdf2.h.

Source - pbkdf2.c

The pbkdf2.c source code can also be found in the trunk on: pbkdf2.c.