-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
325 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef _SHA224_HASHING_ | ||
#define _SHA224_HASHING_ | ||
|
||
#include "SHA256224.hpp" | ||
|
||
namespace crypto { | ||
|
||
#define SHA224_HASH_SIZE 28 // (in bytes) | ||
|
||
using SHA224hash = CryptoHash<SHA224_HASH_SIZE>; | ||
|
||
class SHA224hashing final : public SHA256224hashing<SHA224_HASH_SIZE> | ||
{ | ||
public: | ||
|
||
SHA224hashing(void); | ||
virtual ~SHA224hashing() = default; | ||
|
||
SHA224hashing(const SHA224hashing& other) = delete; | ||
SHA224hashing& operator=(const SHA224hashing& other) = delete; | ||
|
||
SHA224hashing(SHA224hashing&& other) = default; | ||
SHA224hashing& operator=(SHA224hashing&& other) = default; | ||
|
||
private: | ||
|
||
class SHA224BlockCipherLike final : public SHA256224BlockCipherLike | ||
{ | ||
public: | ||
SHA224BlockCipherLike(void); | ||
virtual ~SHA224BlockCipherLike() = default; | ||
|
||
SHA224BlockCipherLike(const SHA224BlockCipherLike& other) = delete; | ||
SHA224BlockCipherLike& operator=(const SHA224BlockCipherLike& other) = delete; | ||
|
||
SHA224BlockCipherLike(SHA224BlockCipherLike&& other) = default; | ||
SHA224BlockCipherLike& operator=(SHA224BlockCipherLike&& other) = default; | ||
|
||
virtual void reset(void) final override; | ||
}; | ||
}; | ||
|
||
} /* namespace crypto */ | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#ifndef _SHA256224_HASHING_ | ||
#define _SHA256224_HASHING_ | ||
|
||
#include "HashingStrategy.hpp" | ||
|
||
namespace crypto { | ||
|
||
#define SHA256224_TMPHASH_SIZE 32 // (in bytes) | ||
#define SHA256224_MSGBLOCK_SIZE 64 // (in bytes) | ||
|
||
template <size_t N> | ||
using SHA256224hash = CryptoHash<N>; | ||
|
||
|
||
template <size_t N> | ||
using HS = HashingStrategy<SHA256224_TMPHASH_SIZE, SHA256224_MSGBLOCK_SIZE, N>; | ||
|
||
template <size_t N_digest> | ||
class SHA256224hashing : public HS<N_digest> | ||
{ | ||
protected: | ||
|
||
class SHA256224BlockCipherLike; | ||
|
||
|
||
SHA256224hashing(std::unique_ptr< typename HS<N_digest>::StrategyBlockCipherLike >&& p); | ||
SHA256224hashing(void) = delete; | ||
virtual ~SHA256224hashing() = default; | ||
|
||
SHA256224hashing(const SHA256224hashing& other) = delete; | ||
SHA256224hashing& operator=(const SHA256224hashing& other) = delete; | ||
|
||
SHA256224hashing(SHA256224hashing&& other) = default; | ||
SHA256224hashing& operator=(SHA256224hashing&& other) = default; | ||
|
||
class SHA256224BlockCipherLike : public HS<N_digest>::StrategyBlockCipherLike | ||
{ | ||
private: | ||
virtual void process(void) final override; | ||
virtual SHA256224hash<N_digest> getDigest(void) final override; | ||
virtual void setMsgSize(size_t size) final override; | ||
|
||
public: | ||
SHA256224BlockCipherLike(void) = default; | ||
virtual ~SHA256224BlockCipherLike() = default; | ||
|
||
SHA256224BlockCipherLike(const SHA256224BlockCipherLike& other) = delete; | ||
SHA256224BlockCipherLike& operator=(const SHA256224BlockCipherLike& other) = delete; | ||
|
||
SHA256224BlockCipherLike(SHA256224BlockCipherLike&& other) = default; | ||
SHA256224BlockCipherLike& operator=(SHA256224BlockCipherLike&& other) = default; | ||
|
||
virtual void reset(void) = 0; | ||
}; | ||
|
||
}; | ||
|
||
} /* namespace crypto */ | ||
|
||
#include "SHA256224.ipp" | ||
|
||
#endif | ||
|
Oops, something went wrong.