12345678910111213141516171819 |
- #ifndef SPECK_HEADER
- #define SPECK_HEADER
- #define ER64(x,y,k) (x=ROTR64(x,8), x+=y, x^=k, y=ROTL64(y,3), y^=x)
- #define DR64(x,y,k) (y^=x, y=ROTR64(y,3), x^=k, x-=y, x=ROTL64(x,8))
- #define ROTL64(x,r) (((x)<<(r)) | (x>>(64-(r))))
- #define ROTR64(x,r) (((x)>>(r)) | ((x)<<(64-(r))))
- #define u8 uint8_t
- #define u32 uint32_t
- #define u64 uint64_t
- void Words64ToBytes(u64 words[],u8 bytes[],int numwords)
- void BytesToWords64(u8 bytes[],u64 words[],int numbytes)
- void Speck128256KeySchedule(u64 K[],u64 rk[])
- void Speck128256Encrypt(u64 Pt[],u64 Ct[],u64 rk[])
- void Speck128256Decrypt(u64 Pt[],u64 Ct[],u64 rk[])
- void EncryptBlock(u8 pt[], u8 k[], u8 ct[])
- #endif
|