protocol
block_cipher_protocol
Protocol for one-shot encryption and decryption using a block cipher.
Availability:
logtalk_load(block_ciphers(loader))Author: Paulo Moura
Version: 1:0:0
Date: 2026-08-03
Compilation flags:
staticDependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)
Public predicates
encrypt_block/3
Encrypts a plaintext block using the given key.
Compilation flags:
staticTemplate:
encrypt_block(Key,PlaintextBlock,CiphertextBlock)Mode and number of proofs:
encrypt_block(+list(byte),+list(byte),--list(byte)) - one_or_errorExceptions:
Key or PlaintextBlock is a variable or a partial list:instantiation_errorKey is neither a variable nor a list of the required number of bytes:type_error(list(byte,KeySize),Key)PlaintextBlock is neither a variable nor a list of the required number of bytes:type_error(list(byte,BlockSize),PlaintextBlock)Key or PlaintextBlock contains a non-integer byte:type_error(integer,Byte)Key or PlaintextBlock contains an integer outside the byte range:domain_error(byte,Byte)decrypt_block/3
Decrypts a ciphertext block using the given key.
Compilation flags:
staticTemplate:
decrypt_block(Key,CiphertextBlock,PlaintextBlock)Mode and number of proofs:
decrypt_block(+list(byte),+list(byte),--list(byte)) - one_or_errorExceptions:
Key or CiphertextBlock is a variable or a partial list:instantiation_errorKey is neither a variable nor a list of the required number of bytes:type_error(list(byte,KeySize),Key)CiphertextBlock is neither a variable nor a list of the required number of bytes:type_error(list(byte,BlockSize),CiphertextBlock)Key or CiphertextBlock contains a non-integer byte:type_error(integer,Byte)Key or CiphertextBlock contains an integer outside the byte range:domain_error(byte,Byte)block_size/1
Returns the cipher block size in bytes.
Compilation flags:
staticTemplate:
block_size(BlockSize)Mode and number of proofs:
block_size(--integer) - onekey_size/1
Returns the cipher key size in bytes.
Compilation flags:
staticTemplate:
key_size(KeySize)Mode and number of proofs:
key_size(--integer) - oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)