mirror of
https://codeberg.org/madmo/speck.git
synced 2025-01-18 14:52:41 +00:00
use define as key length for expand function
This commit is contained in:
parent
6e1ae6d9bd
commit
df3b1d654f
2
speck.c
2
speck.c
|
@ -26,7 +26,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#define RR(x, y, k) (y ^= x, y = ROR(y, 3), x ^= k, x -= y, x = ROL(x, 8))
|
#define RR(x, y, k) (y ^= x, y = ROR(y, 3), x ^= k, x -= y, x = ROL(x, 8))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void speck_expand(SPECK_TYPE const K[static 4], SPECK_TYPE S[static SPECK_ROUNDS])
|
void speck_expand(SPECK_TYPE const K[static SPECK_KEY_LEN], SPECK_TYPE S[static SPECK_ROUNDS])
|
||||||
{
|
{
|
||||||
SPECK_TYPE i, b = K[0];
|
SPECK_TYPE i, b = K[0];
|
||||||
SPECK_TYPE a[SPECK_KEY_LEN - 1];
|
SPECK_TYPE a[SPECK_KEY_LEN - 1];
|
||||||
|
|
2
speck.h
2
speck.h
|
@ -45,7 +45,7 @@ extern "C" {
|
||||||
#define SPECK_KEY_LEN 4
|
#define SPECK_KEY_LEN 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void speck_expand(SPECK_TYPE const K[static 4], SPECK_TYPE S[static SPECK_ROUNDS]);
|
void speck_expand(SPECK_TYPE const K[static SPECK_KEY_LEN], SPECK_TYPE S[static SPECK_ROUNDS]);
|
||||||
void speck_encrypt(SPECK_TYPE const pt[static 2], SPECK_TYPE ct[static 2], SPECK_TYPE const K[static SPECK_ROUNDS]);
|
void speck_encrypt(SPECK_TYPE const pt[static 2], SPECK_TYPE ct[static 2], SPECK_TYPE const K[static SPECK_ROUNDS]);
|
||||||
void speck_decrypt(SPECK_TYPE const ct[static 2], SPECK_TYPE pt[static 2], SPECK_TYPE const K[static SPECK_ROUNDS]);
|
void speck_decrypt(SPECK_TYPE const ct[static 2], SPECK_TYPE pt[static 2], SPECK_TYPE const K[static SPECK_ROUNDS]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue