ac5200c
diff --git a/Makefile b/Makefile
ac5200c
index e42c791..cc0b9cc 100644
ac5200c
--- a/Makefile
ac5200c
+++ b/Makefile
ac5200c
@@ -9,7 +9,7 @@ HDRS = $(SRCDIR)/config.h $(SRCDIR)/endianness.h $(SRCDIR)/version.h
ac5200c
 HDRS += $(SRCDIR)/pixiewps.h $(SRCDIR)/utils.h $(SRCDIR)/wps.h
ac5200c
 
ac5200c
 # Internal flags so one can safely override CFLAGS, CPPFLAGS and LDFLAGS
ac5200c
-INTFLAGS = -std=c99 -I $(SRCDIR)/crypto/tc
ac5200c
+INTFLAGS = -std=c99
ac5200c
 LIBS = -lpthread
ac5200c
 
ac5200c
 ifeq ($(OPENSSL),1)
ac5200c
@@ -17,12 +17,14 @@ LIBS += -lcrypto
ac5200c
 INTFLAGS += -DUSE_OPENSSL
ac5200c
 endif
ac5200c
 
ac5200c
+LIBS += -ltomcrypt
ac5200c
+
ac5200c
 TARGET = pixiewps
ac5200c
 
ac5200c
 include $(SRCDIR)/crypto/tfm/sources.mak
ac5200c
 TFMSRC = $(patsubst ./%,$(SRCDIR)/crypto/tfm/%,$(TFM_SRCS))
ac5200c
 TFMOBJS = $(TFMSRC:.c=.o)
ac5200c
-TC_SRCS = ./aes_cbc.c ./aes.c
ac5200c
+TC_SRCS = ./aes_cbc.c
ac5200c
 TCSRC = $(patsubst ./%,$(SRCDIR)/crypto/tc/%,$(TC_SRCS))
ac5200c
 TCOBJS = $(TCSRC:.c=.o)
ac5200c
 
ac5200c
diff --git a/src/crypto/hmac_sha256.c b/src/crypto/hmac_sha256.c
ac5200c
index defda43..435d801 100644
ac5200c
--- a/src/crypto/hmac_sha256.c
ac5200c
+++ b/src/crypto/hmac_sha256.c
ac5200c
@@ -5,7 +5,7 @@
ac5200c
 #ifdef USE_OPENSSL
ac5200c
 # include <openssl/sha.h>
ac5200c
 #else
ac5200c
-# include "tc/sha256.c"
ac5200c
+# include <tomcrypt.h>
ac5200c
 # define SHA256_CTX hash_state
ac5200c
 # define SHA256_Init(x) do { sha256_init(x); } while(0)
ac5200c
 # define SHA256_Update(x, y, z) sha256_process(x, y, z)
ac5200c
diff --git a/src/crypto/tc/aes_cbc.c b/src/crypto/tc/aes_cbc.c
ac5200c
index 5d023f0..63d9b49 100644
ac5200c
--- a/src/crypto/tc/aes_cbc.c
ac5200c
+++ b/src/crypto/tc/aes_cbc.c
ac5200c
@@ -6,7 +6,7 @@
ac5200c
  * The library is free for all purposes without any express
ac5200c
  * guarantee it works.
ac5200c
  */
ac5200c
-#include "tomcrypt.h"
ac5200c
+#include <tomcrypt.h>
ac5200c
 
ac5200c
 /**
ac5200c
    @file cbc_start.c
ac5200c
diff --git a/src/pixiewps.c b/src/pixiewps.c
ac5200c
index f733f36..cf0858d 100644
ac5200c
--- a/src/pixiewps.c
ac5200c
+++ b/src/pixiewps.c
ac5200c
@@ -44,7 +44,6 @@
ac5200c
 #include "pixiewps.h"
ac5200c
 #include "crypto/crypto_internal-modexp.c"
ac5200c
 #include "crypto/hmac_sha256.c"
ac5200c
-#include "crypto/tc/aes_cbc.h"
ac5200c
 #include "random/glibc_random_yura.c"
ac5200c
 #include "utils.h"
ac5200c
 #include "wps.h"
ac5200c
diff --git a/src/pixiewps.h b/src/pixiewps.h
ac5200c
index 2ff110b..2e2bc0f 100644
ac5200c
--- a/src/pixiewps.h
ac5200c
+++ b/src/pixiewps.h
ac5200c
@@ -293,4 +293,10 @@ static inline uint_fast8_t is_mode_selected(const uint_fast8_t mode)
ac5200c
 	return 0;
ac5200c
 }
ac5200c
 
ac5200c
+int aes_128_cbc_decrypt(
ac5200c
+        const unsigned char *key,
ac5200c
+        const unsigned char *iv,
ac5200c
+        unsigned char *data,
ac5200c
+        size_t data_len);
ac5200c
+
ac5200c
 #endif /* PIXIEWPS_H */