Skip to Content
oxcrypto

GIFT-128

GIFT-128 block cipher selector.

from oxcrypto.cipher.gift import GIFT
from oxcrypto.cipher.hazmat import decrypt_block, encrypt_block

cipher = GIFT.GIFT128
key = cipher.generate_key()
block = bytes(cipher.block_size)
assert decrypt_block(key, encrypt_block(key, block, cipher=cipher), cipher=cipher) == block

Variants: GIFT.GIFT128.

Standard: GIFT (CHES 2017), the block cipher of the NIST lightweight finalist GIFT-COFB; not standardized on its own.

Pass the selector as cipher= to any mode. Raw single-block functions live in oxcrypto.cipher.hazmat.

The RustCrypto block-ciphers README states that this crate is not implemented in constant time and has no published audit. oxcrypto has not verified its timing behavior.