To summarize, since @Raj Lalwani's answer is not fully complete - some details were left out!!!
Three files:
- CommonKeyDerivation.c
- CommonKeyDerivation.h
- CommonKeyDerivationPriv.h
In the source for CommonKeyDerivation.c, at the below of the standard Apple license comment, insert this:
#define KERNEL
This will shut off the compiler error.
In the source for CommonKeyDerivation.h, there's two prototypes as shown:
int
CCKeyDerivationPBKDF( CCPBKDFAlgorithm algorithm, const char *password, size_t passwordLen,
const uint8_t *salt, size_t saltLen,
CCPseudoRandomAlgorithm prf, uint rounds,
uint8_t *derivedKey, size_t derivedKeyLen)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
And
uint
CCCalibratePBKDF(CCPBKDFAlgorithm algorithm, size_t passwordLen, size_t saltLen,
CCPseudoRandomAlgorithm prf, size_t derivedKeyLen, uint32_t msec)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
Change the __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA)
to this __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_4_2)
if on Snow Leopard targetting iOS 4.2.
You may have to specify a include path in the build options.