3434/*
3535 * Makes a cryptographically secure key by stretching a user entered key
3636 */
37- int GenerateKey (RNG * rng , byte * key , int size , byte * salt , int pad )
37+ int GenerateKey (WC_RNG * rng , byte * key , int size , byte * salt , int pad )
3838{
3939 int ret ;
4040
@@ -47,7 +47,7 @@ int GenerateKey(RNG* rng, byte* key, int size, byte* salt, int pad)
4747
4848 /* stretches key */
4949 ret = wc_PBKDF2 (key , key , strlen ((const char * )key ), salt , SALT_SIZE , 4096 ,
50- size , SHA256 );
50+ size , WC_SHA256 );
5151 if (ret != 0 )
5252 return -1030 ;
5353
@@ -59,7 +59,7 @@ int GenerateKey(RNG* rng, byte* key, int size, byte* salt, int pad)
5959 */
6060int Des3Encrypt (Des3 * des3 , byte * key , int size , FILE * inFile , FILE * outFile )
6161{
62- RNG rng ;
62+ WC_RNG rng ;
6363 byte iv [DES3_BLOCK_SIZE ];
6464 byte * input ;
6565 byte * output ;
@@ -145,7 +145,7 @@ int Des3Encrypt(Des3* des3, byte* key, int size, FILE* inFile, FILE* outFile)
145145 */
146146int Des3Decrypt (Des3 * des3 , byte * key , int size , FILE * inFile , FILE * outFile )
147147{
148- RNG rng ;
148+ WC_RNG rng ;
149149 byte iv [DES3_BLOCK_SIZE ];
150150 byte * input ;
151151 byte * output ;
@@ -183,7 +183,7 @@ int Des3Decrypt(Des3* des3, byte* key, int size, FILE* inFile, FILE* outFile)
183183
184184 /* replicates old key if keys match */
185185 ret = wc_PBKDF2 (key , key , strlen ((const char * )key ), salt , SALT_SIZE , 4096 ,
186- size , SHA256 );
186+ size , WC_SHA256 );
187187 if (ret != 0 )
188188 return -1050 ;
189189
0 commit comments