Merge branch 'refs/heads/t/sha3' into master This code was written long ago and was sitting in a development branch for some years. As such it was part of the pu branch and so has seen some testing. There's an easy conflict in fsck.c where one side added a function parameter and the other renamed some variables. * refs/heads/t/sha3: Version 3 tables. Add sha3 implementation, introduce version-2 tables. Prepare hash_function() for multiple hash algorithms. Store table version in struct osl_table. Initialize column name hash *after* table version is known. osl_open_table(): Remove pointless directory check. Remove sha1.h. Remove COMPAT_TABLE_VERSION.
build: Tell make(1) that the compiler creates .d files. The best way to convey the information that two files are created by the same command involves rules with grouped targets (indicated by the &: separator between targets and prerequisites). However, since grouped targets is a relatively new feature of make(1) and we would like to keep supporting older versions, we use ordinary rules with multiple targets. This should not be worse because the compiler is still run only once for each source file. The patch also introduces the pre_deps make variable to make sure the files listed in this variable are present before we run the compiler.
web: Simplify main page. This combines and streamlines the "Download", "License" and "Contact" sections of the home page and moves them to the README file. This reduces the tabs of the main page navigation from 8 to 5 and makes the various URLs more prominent, and part of README.
web: Get rid of doxygen. Doxygen is an additional dependency, and it's total overkill for a small project like osl. The self-contained gendoc.m4 script does everything we need, and is much faster. This patch converts osl.h.in to gendoc syntax and removes all traces of doxygen. Since gendoc.m4 relies on features of gnu-m4 we run it with -g to enable gnu extensions. This has been tested on FreeBSD and NetBSD which ship different m4 implementations, both of which understand -g.
web: Convert QUICK_START to markdown syntax. This file is rather simple and we don't need doxygen to convert it to html. After this, the quick start document becomes part of the main page. Although this patch modifies almost every line of QUICK_START, the changes to the actual contents have been kept to a minimum.
Version 3 tables. This adds support for yet another hash function: sha256. We keep the Keccak Hash as version #2, because it works well and has been around for years in an experimental branch of this repo. As for Keccak, we only use 20 bytes of the sha256 hash, which is safe enough and helps to keep the patch as small as possible. The sha256 implementation was taken from git v2.25.1.
Add sha3 implementation, introduce version-2 tables. This adds support for version-2 tables which use a variant of the Keccec hash family rather than sha1. The only difference between the two table versions is the different hash function. Both hash functions create 20-byte output. Version-1 tables are still supported, but new tables are always created in v2 format.
Prepare hash_function() for multiple hash algorithms. In order to transparently support more than one hash function in the future, we now pass the table version to hash_function(). The version is always one at the moment, and only the sha1 hash is implemented so far.
Store table version in struct osl_table. This modifies read_table_desc() to return the table version read from the index header. The returned version number is stored in the newly added field of struct osl_table. This will allow us to choose a hash function based on the version.
Initialize column name hash *after* table version is known. We use hash_function() to determine the path of the file/directory which corresponds to columns of type MAPPED_STORAGE or DISK_STORAGE. Currently this happens before the index has been mapped, so we don't know the table version at this point. Future versions of osl will support multiple hash functions, and the hash function to use will be determined from the table version. At this point the modifications of this patch become necessary. At the moment the patch has no visible effect.