block/speck: add word_t typedef
This commit is contained in:
parent
90238ae5e1
commit
98aef351db
@ -81,8 +81,8 @@ speck::speck (std::array<u64,2> _key)
|
|||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
std::array<u64,2>
|
speck::block_t
|
||||||
speck::encrypt (std::array<u64,2> plaintext) const
|
speck::encrypt (block_t plaintext) const
|
||||||
{
|
{
|
||||||
u64 &x = plaintext[0];
|
u64 &x = plaintext[0];
|
||||||
u64 &y = plaintext[1];
|
u64 &y = plaintext[1];
|
||||||
@ -96,7 +96,7 @@ speck::encrypt (std::array<u64,2> plaintext) const
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
std::array<u64,2>
|
std::array<u64,2>
|
||||||
speck::decrypt (std::array<u64,2> plaintext) const
|
speck::decrypt (block_t plaintext) const
|
||||||
{
|
{
|
||||||
u64 &x = plaintext[0];
|
u64 &x = plaintext[0];
|
||||||
u64 &y = plaintext[1];
|
u64 &y = plaintext[1];
|
||||||
|
@ -28,12 +28,12 @@ namespace cruft::crypto::block {
|
|||||||
public:
|
public:
|
||||||
using key_t = std::array<u64,2>;
|
using key_t = std::array<u64,2>;
|
||||||
using word_t = u64;
|
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);
|
explicit speck (key_t);
|
||||||
|
|
||||||
std::array<word_t,2> encrypt (std::array<word_t,2> src) const;
|
block_t encrypt (block_t src) const;
|
||||||
std::array<word_t,2> decrypt (std::array<word_t,2> src) const;
|
block_t decrypt (block_t src) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<u64,32> m_key;
|
std::array<u64,32> m_key;
|
||||||
|
Loading…
Reference in New Issue
Block a user