diff --git a/bignum-random-prime.c b/bignum-random-prime.c
index 14249e2df48e149db340d72e549e0537485664e5..48d9c0acbabf3644175cbb16cceca550ce593f51 100644
--- a/bignum-random-prime.c
+++ b/bignum-random-prime.c
@@ -50,7 +50,7 @@
 #endif
 
 #include "bignum.h"
-
+#include "hogweed-internal.h"
 #include "macros.h"
 
 /* Use a table of p_2 = 3 to p_{172} = 1021, used for sieving numbers
diff --git a/ripemd160-compress.c b/ripemd160-compress.c
index 443b255ca26e7021d91781f990ae929e5fd69e7a..f8eed7df985a776ac71240c943f18e62997981e1 100644
--- a/ripemd160-compress.c
+++ b/ripemd160-compress.c
@@ -40,6 +40,7 @@
 #include <string.h>
 
 #include "ripemd160.h"
+#include "ripemd160-internal.h"
 
 #include "macros.h"