Index: uspace/lib/ext4/Makefile
===================================================================
--- uspace/lib/ext4/Makefile	(revision c1fd281454459feab4756bc576e6f4e4e370bc92)
+++ uspace/lib/ext4/Makefile	(revision 2b5d9668b59972cbe16189c39d66821f9d605af4)
@@ -29,6 +29,6 @@
 USPACE_PREFIX = ../..
 LIBRARY = libext4
-EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX)
-LIBS = $(LIBBLOCK_PREFIX)/libblock.a
+EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBCRYPTO_PREFIX)
+LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBCRYPTO_PREFIX)/libcrypto.a
 
 SOURCES = \
@@ -36,5 +36,4 @@
 	libext4_bitmap.c \
 	libext4_block_group.c \
-	libext4_crc.c \
 	libext4_directory.c \
 	libext4_directory_index.c \
Index: uspace/lib/ext4/libext4.h
===================================================================
--- uspace/lib/ext4/libext4.h	(revision c1fd281454459feab4756bc576e6f4e4e370bc92)
+++ uspace/lib/ext4/libext4.h	(revision 2b5d9668b59972cbe16189c39d66821f9d605af4)
@@ -37,5 +37,4 @@
 #include "libext4_bitmap.h"
 #include "libext4_block_group.h"
-#include "libext4_crc.h"
 #include "libext4_directory.h"
 #include "libext4_directory_index.h"
Index: uspace/lib/ext4/libext4_crc.c
===================================================================
--- uspace/lib/ext4/libext4_crc.c	(revision c1fd281454459feab4756bc576e6f4e4e370bc92)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2012 Frantisek Princ
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libext4
- * @{
- */
-
-/**
- * @file  libext4_crc.c
- */
-
-#include "libext4.h"
-
-uint16_t crc16(uint16_t crc, const uint8_t *buffer, size_t len)
-{
-	/* TODO */
-        return 0;
-}
-
-/**
- * @}
- */
Index: uspace/lib/ext4/libext4_crc.h
===================================================================
--- uspace/lib/ext4/libext4_crc.h	(revision c1fd281454459feab4756bc576e6f4e4e370bc92)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * Copyright (c) 2012 Frantisek Princ
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libext4
- * @{
- */
-
-#ifndef LIBEXT4_LIBEXT4_CRC_H_
-#define LIBEXT4_LIBEXT4_CRC_H_
-
-extern uint16_t crc16(uint16_t, const uint8_t *, size_t);
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/ext4/libext4_filesystem.c
===================================================================
--- uspace/lib/ext4/libext4_filesystem.c	(revision c1fd281454459feab4756bc576e6f4e4e370bc92)
+++ uspace/lib/ext4/libext4_filesystem.c	(revision 2b5d9668b59972cbe16189c39d66821f9d605af4)
@@ -41,4 +41,5 @@
 #include <ipc/vfs.h>
 #include <align.h>
+#include <crypto.h>
 #include "libext4.h"
 
@@ -54,4 +55,5 @@
     enum cache_mode cmode)
 {
+	int rc;
 	ext4_superblock_t *temp_superblock = NULL;
 
@@ -59,5 +61,5 @@
 
 	/* Initialize block library (4096 is size of communication channel) */
-	int rc = block_init(EXCHANGE_SERIALIZE, fs->device, 4096);
+	rc = block_init(EXCHANGE_SERIALIZE, fs->device, 4096);
 	if (rc != EOK)
 		goto err;
@@ -140,5 +142,5 @@
 	/* Release memory space for superblock */
 	free(fs->superblock);
-	
+
 	/* Finish work with block library */
 	block_cache_fini(fs->device);
@@ -532,5 +534,5 @@
 	/* If checksum not supported, 0 will be returned */
 	uint16_t crc = 0;
-	
+
 	/* Compute the checksum only if the filesystem supports it */
 	if (ext4_superblock_has_feature_read_only(sb,
@@ -545,11 +547,11 @@
 		
 		/* Initialization */
-		crc = crc16(~0, sb->uuid, sizeof(sb->uuid));
+		crc = crc16_ibm(~0, sb->uuid, sizeof(sb->uuid));
 		
 		/* Include index of block group */
-		crc = crc16(crc, (uint8_t *) &le_group, sizeof(le_group));
+		crc = crc16_ibm(crc, (uint8_t *) &le_group, sizeof(le_group));
 		
 		/* Compute crc from the first part (stop before checksum field) */
-		crc = crc16(crc, (uint8_t *) bg, offset);
+		crc = crc16_ibm(crc, (uint8_t *) bg, offset);
 		
 		/* Skip checksum */
@@ -560,5 +562,5 @@
 		    EXT4_FEATURE_INCOMPAT_64BIT)) &&
 		    (offset < ext4_superblock_get_desc_size(sb)))
-			crc = crc16(crc, ((uint8_t *) bg) + offset,
+			crc = crc16_ibm(crc, ((uint8_t *) bg) + offset,
 			    ext4_superblock_get_desc_size(sb) - offset);
 	}
