Remove default hash algorithm from the new hash functions
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Fri, 28 Sep 2018 12:43:45 +0000 (14:43 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 2 Oct 2018 12:15:55 +0000 (14:15 +0200)
Rationale: SHA1 is outdated, we would need to switch
to something like SHA256 nowadays. If the algorithm
is given explicitly, we can grep for the identifier.

When we do the migration from the libgcrypt-intranator API,
it's better to explicitly adapt the call sites.

src/crypto.hxx

index 8d1e26e..1e830af 100644 (file)
@@ -40,13 +40,13 @@ namespace I2n {
 enum algorithm { NONE=0, MD5=1, SHA1=2, SHA256=8, SHA384=9, SHA512=10 };
 
 // output: hex encoded hash
-string hash_data(string data, algorithm algo=SHA1);
+string hash_data(string data, algorithm algo);
 
 // output: raw binary hash
-string hash_data_raw(string data, algorithm algo=SHA1);
+string hash_data_raw(string data, algorithm algo);
 
 // hash data in 64kB blocks
-string hash_file(string filename, algorithm algo=SHA1);
+string hash_file(string filename, algorithm algo);
 
 string encode_hex(string data);