block/speck: add word_t typedef

This commit is contained in:
Danny Robson 2018-12-08 22:25:12 +11:00
parent 90238ae5e1
commit 98aef351db
2 changed files with 6 additions and 6 deletions

View File

@ -81,8 +81,8 @@ speck::speck (std::array<u64,2> _key)
///////////////////////////////////////////////////////////////////////////////
std::array<u64,2>
speck::encrypt (std::array<u64,2> plaintext) const
speck::block_t
speck::encrypt (block_t plaintext) const
{
u64 &x = plaintext[0];
u64 &y = plaintext[1];
@ -96,7 +96,7 @@ speck::encrypt (std::array<u64,2> plaintext) const
//-----------------------------------------------------------------------------
std::array<u64,2>
speck::decrypt (std::array<u64,2> plaintext) const
speck::decrypt (block_t plaintext) const
{
u64 &x = plaintext[0];
u64 &y = plaintext[1];

View File

@ -28,12 +28,12 @@ namespace cruft::crypto::block {
public:
using key_t = std::array<u64,2>;
using word_t = u64;
static constexpr auto block_size = sizeof (word_t) * 2;
using block_t = std::array<word_t,2>;
explicit speck (key_t);
std::array<word_t,2> encrypt (std::array<word_t,2> src) const;
std::array<word_t,2> decrypt (std::array<word_t,2> src) const;
block_t encrypt (block_t src) const;
block_t decrypt (block_t src) const;
private:
std::array<u64,32> m_key;