]> git.tdb.fi Git - libs/crypto.git/log
libs/crypto.git
2 years agoMove explicit template instantiations to the .cpp file master
Mikko Rasa [Wed, 4 Jan 2023 11:26:38 +0000 (13:26 +0200)]
Move explicit template instantiations to the .cpp file

MSVC isn't happy if it can't see the function definitions.

2 years agoUpdate .gitignore to include build products on Windows
Mikko Rasa [Wed, 4 Jan 2023 11:26:25 +0000 (13:26 +0200)]
Update .gitignore to include build products on Windows

2 years agoInclude the matching header first in .cpp files
Mikko Rasa [Tue, 3 Jan 2023 09:48:42 +0000 (11:48 +0200)]
Include the matching header first in .cpp files

This ensures the headers are self-contained

2 years agoUse defaulted special functions
Mikko Rasa [Tue, 3 Jan 2023 09:37:38 +0000 (11:37 +0200)]
Use defaulted special functions

2 years agoUse the override specifier for overridden virtual functions
Mikko Rasa [Tue, 3 Jan 2023 09:36:38 +0000 (11:36 +0200)]
Use the override specifier for overridden virtual functions

2 years agoConvert typedef to using
Mikko Rasa [Tue, 3 Jan 2023 09:33:53 +0000 (11:33 +0200)]
Convert typedef to using

2 years agoUse standard fixed-size integer types
Mikko Rasa [Tue, 3 Jan 2023 09:30:52 +0000 (11:30 +0200)]
Use standard fixed-size integer types

2 years agoUse default member initializers and constructor delegation
Mikko Rasa [Tue, 3 Jan 2023 09:24:36 +0000 (11:24 +0200)]
Use default member initializers and constructor delegation

2 years agoUse C++11 for compiling
Mikko Rasa [Tue, 3 Jan 2023 09:21:56 +0000 (11:21 +0200)]
Use C++11 for compiling

2 years agoAdd decorations to things which form the public API of the library
Mikko Rasa [Tue, 3 Jan 2023 09:19:42 +0000 (11:19 +0200)]
Add decorations to things which form the public API of the library

2 years agoExplicitly instantiate the entire SHA2 class at once
Mikko Rasa [Tue, 3 Jan 2023 09:17:27 +0000 (11:17 +0200)]
Explicitly instantiate the entire SHA2 class at once

I'm not sure why I thought each member function had to be instantiated
separately.  Perhaps there was a bug in some old compiler.

2 years agoRearrange a comparison to silence a compiler warning
Mikko Rasa [Wed, 21 Dec 2022 10:39:53 +0000 (12:39 +0200)]
Rearrange a comparison to silence a compiler warning

With optimizations enabled, gcc gave a warning about reading past the end
of the source buffer on blockhash.h:44 when called from sha2.cpp:131.
This rearrangement lets the compiler see that the value of needed will
never exceed that of len, and thus no reading past the end can occur.

6 years agoAdd a function for getting high-quality random bytes
Mikko Rasa [Thu, 26 Sep 2019 13:19:45 +0000 (16:19 +0300)]
Add a function for getting high-quality random bytes

6 years agoAdd an overload of get_digest that returns an std::string
Mikko Rasa [Thu, 26 Sep 2019 13:19:19 +0000 (16:19 +0300)]
Add an overload of get_digest that returns an std::string

9 years agoUse BlockHash as base class of MD5 as well
Mikko Rasa [Sat, 16 Apr 2016 13:54:15 +0000 (16:54 +0300)]
Use BlockHash as base class of MD5 as well

9 years agoAdd an example program demonstrating hash API
Mikko Rasa [Sat, 16 Apr 2016 13:51:46 +0000 (16:51 +0300)]
Add an example program demonstrating hash API

Also useful for verifying the implementations.

9 years agoAvoid shuffling the data around in memory so much
Mikko Rasa [Sat, 16 Apr 2016 12:49:56 +0000 (15:49 +0300)]
Avoid shuffling the data around in memory so much

9 years agoSlightly shorten the names of the constant structs
Mikko Rasa [Sat, 16 Apr 2016 12:46:37 +0000 (15:46 +0300)]
Slightly shorten the names of the constant structs

9 years agoAccount for SHA-512 asking for a 128-bit message length
Mikko Rasa [Sat, 16 Apr 2016 12:44:30 +0000 (15:44 +0300)]
Account for SHA-512 asking for a 128-bit message length

The upper 64 bits are filled with zeroes because 128-bit integers are not
available everywhere and it will be a while before lengths overflowing 64
bits are realistically possible.

9 years agoImplement the SHA2 hash family
Mikko Rasa [Sat, 16 Apr 2016 10:59:38 +0000 (13:59 +0300)]
Implement the SHA2 hash family

9 years agoFix some inline qualifiers
Mikko Rasa [Sat, 16 Apr 2016 10:59:20 +0000 (13:59 +0300)]
Fix some inline qualifiers

9 years agoRemove useless programmatical filling of MD5::rotate_table
Mikko Rasa [Sat, 16 Apr 2016 10:57:29 +0000 (13:57 +0300)]
Remove useless programmatical filling of MD5::rotate_table

The table is so small that static initialization is easier, and in fact
the initializer is already there so the code wasn't even run.

10 years agoInitial version, with MD5
Mikko Rasa [Sun, 14 Dec 2014 08:57:28 +0000 (10:57 +0200)]
Initial version, with MD5