PR: 1937
[oweals/openssl.git] / crypto / rc5 / rc5_skey.c
index 2f36531ffa30a5cce91112c749f65404cc3fe4ff..247fa6500ce8bcb7a723309d6014d99c72525834 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#include "rc5.h"
+#include <openssl/crypto.h>
+#include <openssl/rc5.h>
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#endif
+
 #include "rc5_locl.h"
 
-void RC5_32_set_key(RC5_32_KEY *key, int len, unsigned char *data,
-            int rounds)
+#ifdef OPENSSL_FIPS
+void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
+                   int rounds)
+       {
+       if (FIPS_mode())
+               FIPS_BAD_ABORT(RC5)
+       private_RC5_32_set_key(key, len, data, rounds);
+       }
+void private_RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
+                   int rounds)
+#else
+void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
+                   int rounds)
+#endif
        {
        RC5_32_INT L[64],l,ll,A,B,*S,k;
        int i,j,m,c,t,ii,jj;