Make it backwards compatible with 4.4

Change-Id: I668604cddc8e8afbf78709f3f872bea4e9f4aa06
diff --git a/fuse_sideload.cpp b/fuse_sideload.cpp
index 66dc4be..f57d479 100644
--- a/fuse_sideload.cpp
+++ b/fuse_sideload.cpp
@@ -61,7 +61,12 @@
 #include <sys/uio.h>
 #include <unistd.h>
 
+#ifdef USE_MINCRYPT
+#include "mincrypt/sha256.h"
+#define  SHA256_DIGEST_LENGTH SHA256_DIGEST_SIZE
+#else
 #include <openssl/sha.h>
+#endif
 
 #include "fuse_sideload.h"
 
@@ -275,7 +280,11 @@
     // - Otherwise, return -EINVAL for the read.
 
     uint8_t hash[SHA256_DIGEST_LENGTH];
+#ifdef USE_MINCRYPT
+    SHA256_hash(fd->block_data, fd->block_size, hash);
+#else
     SHA256(fd->block_data, fd->block_size, hash);
+#endif
     uint8_t* blockhash = fd->hashes + block * SHA256_DIGEST_LENGTH;
     if (memcmp(hash, blockhash, SHA256_DIGEST_LENGTH) == 0) {
         return 0;
@@ -527,3 +536,9 @@
 
     return result;
 }
+
+extern "C" int run_old_fuse_sideload(struct provider_vtab* vtab, void* cookie,
+                      uint64_t file_size, uint32_t block_size)
+{
+    return run_fuse_sideload(vtab, cookie, file_size, block_size);
+}