Cipher Fayadh
Block cipher Feistel 128-bit dengan fungsi putaran sigma-delta
Loading...
Searching...
No Matches
bits.hpp File Reference

Helper operasi bit (rotasi) yang dipakai key schedule dan fungsi F. More...

#include <cstdint>

Go to the source code of this file.

Functions

uint64_t rotl64 (uint64_t x, unsigned n)
 Rotasi kiri 64 bit.
uint32_t rotl32 (uint32_t x, unsigned n)
 Rotasi kiri 32 bit.

Detailed Description

Helper operasi bit (rotasi) yang dipakai key schedule dan fungsi F.

Function Documentation

◆ rotl32()

uint32_t rotl32 ( uint32_t x,
unsigned n )
inline

Rotasi kiri 32 bit.

Parameters
[in]xNilai 32 bit yang diputar.
[in]nJumlah posisi (harus 1..31).
Returns
x yang sudah diputar kiri sebanyak n bit.
Warning
n = 0 atau n = 32 menghasilkan undefined behavior.

◆ rotl64()

uint64_t rotl64 ( uint64_t x,
unsigned n )
inline

Rotasi kiri 64 bit.

Parameters
[in]xNilai 64 bit yang diputar.
[in]nJumlah posisi (harus 1..63).
Returns
x yang sudah diputar kiri sebanyak n bit.
Warning
n = 0 atau n = 64 menghasilkan undefined behavior.