#include "gost_grasshopper_defines.h"
static GRASSHOPPER_INLINE void grasshopper_l(grasshopper_w128_t* w) {
#include "gost_grasshopper_defines.h"
static GRASSHOPPER_INLINE void grasshopper_l(grasshopper_w128_t* w) {
for (i = 0; i < 15; i++) {
w->b[i] = w->b[i + 1];
x ^= grasshopper_galois_mul(w->b[i], grasshopper_lvec[i]);
for (i = 0; i < 15; i++) {
w->b[i] = w->b[i + 1];
x ^= grasshopper_galois_mul(w->b[i], grasshopper_lvec[i]);
void grasshopper_set_encrypt_key(grasshopper_round_keys_t* subkeys, const grasshopper_key_t* key) {
grasshopper_w128_t c, x, y, z;
void grasshopper_set_encrypt_key(grasshopper_round_keys_t* subkeys, const grasshopper_key_t* key) {
grasshopper_w128_t c, x, y, z;
void grasshopper_encrypt_block(grasshopper_round_keys_t* subkeys, grasshopper_w128_t* source,
grasshopper_w128_t* target, grasshopper_w128_t* buffer) {
void grasshopper_encrypt_block(grasshopper_round_keys_t* subkeys, grasshopper_w128_t* source,
grasshopper_w128_t* target, grasshopper_w128_t* buffer) {
grasshopper_copy128(target, source);
for (i = 0; i < 9; i++) {
grasshopper_copy128(target, source);
for (i = 0; i < 9; i++) {
void grasshopper_decrypt_block(grasshopper_round_keys_t* subkeys, grasshopper_w128_t* source,
grasshopper_w128_t* target, grasshopper_w128_t* buffer) {
void grasshopper_decrypt_block(grasshopper_round_keys_t* subkeys, grasshopper_w128_t* source,
grasshopper_w128_t* target, grasshopper_w128_t* buffer) {
grasshopper_copy128(target, source);
grasshopper_append128multi(buffer, target, grasshopper_l_dec128);
grasshopper_copy128(target, source);
grasshopper_append128multi(buffer, target, grasshopper_l_dec128);