SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions
aesEncryptEcb

Functions

template<domain D :shared3p >
D xor_uint32 aes128EncryptEcb (D xor_uint32[[1]] expandedKey, D xor_uint32[[1]] plainText)
 
template<domain D :shared3p >
D xor_uint32 aes128SingleKeyEncryptEcb (D xor_uint32[[1]] expandedKey, D xor_uint32[[1]] plainText)
 
template<domain D :shared3p >
D xor_uint32 aes192EncryptEcb (D xor_uint32[[1]] expandedKey, D xor_uint32[[1]] plainText)
 
template<domain D :shared3p >
D xor_uint32 aes192SingleKeyEncryptEcb (D xor_uint32[[1]] expandedKey, D xor_uint32[[1]] plainText)
 
template<domain D :shared3p >
D xor_uint32 aes256EncryptEcb (D xor_uint32[[1]] expandedKey, D xor_uint32[[1]] plainText)
 
template<domain D :shared3p >
D xor_uint32 aes256SingleKeyEncryptEcb (D xor_uint32[[1]] expandedKey, D xor_uint32[[1]] plainText)
 

Detailed Description

Function for encrypting with AES algorithm.

Returns
returns a vector of type xor_uint32 with the encrypted values

Function Documentation

◆ aes128EncryptEcb()

D xor_uint32 aes128EncryptEcb ( D xor_uint32[[1]]  expandedKey,
D xor_uint32[[1]]  plainText 
)
Parameters
expandedKey- an aes128 expanded key of type xor_uint32. See also aesGenkey and aesExpandKey
plainText- a string converted to a xor_uint32 vector
Precondition
the size of expandedKey has to be dividable by (AES128_Nb * (AES128_Nr + 1))
the size of plainText has to be dividable by AES128_Nb
( plainText / AES128_Nb ) == ( size of expandedKey ) / (AES128_Nb * (AES128_Nr + 1))
Leakage
None

◆ aes128SingleKeyEncryptEcb()

D xor_uint32 aes128SingleKeyEncryptEcb ( D xor_uint32[[1]]  expandedKey,
D xor_uint32[[1]]  plainText 
)
Parameters
expandedKey- an aes128 expanded key of type xor_uint32. See also aesGenkey and aesExpandKey
plainText- a string converted to a xor_uint32 vector
Precondition
the size of plainText has to be dividable by AES128_Nb
the size of expandedKey has to be (AES128_Nb * (AES128_Nr + 1))
Leakage
None

◆ aes192EncryptEcb()

D xor_uint32 aes192EncryptEcb ( D xor_uint32[[1]]  expandedKey,
D xor_uint32[[1]]  plainText 
)
Parameters
expandedKey- an aes192 expanded key of type xor_uint32. See also aesGenkey and aesExpandKey
plainText- a string converted to a xor_uint32 vector
Precondition
the size of expandedKey has to be dividable by (AES192_Nb * (AES192_Nr + 1))
the size of plainText has to be dividable by AES192_Nb
( plainText / AES192_Nb ) == ( size of expandedKey ) / (AES192_Nb * (AES192_Nr + 1))
Leakage
None

◆ aes192SingleKeyEncryptEcb()

D xor_uint32 aes192SingleKeyEncryptEcb ( D xor_uint32[[1]]  expandedKey,
D xor_uint32[[1]]  plainText 
)
Parameters
expandedKey- an aes192 expanded key of type xor_uint32. See also aesGenkey and aesExpandKey
plainText- a string converted to a xor_uint32 vector
Precondition
the size of plainText has to be dividable by AES192_Nb
the size of expandedKey has to be (AES192_Nb * (AES192_Nr + 1))
Leakage
None

◆ aes256EncryptEcb()

D xor_uint32 aes256EncryptEcb ( D xor_uint32[[1]]  expandedKey,
D xor_uint32[[1]]  plainText 
)
Parameters
expandedKey- an aes256 expanded key of type xor_uint32. See also aesGenkey and aesExpandKey
plainText- a string converted to a xor_uint32 vector
Precondition
the size of expandedKey has to be dividable by (AES256_Nb * (AES256_Nr + 1))
the size of plainText has to be dividable by AES256_Nb
( plainText / AES256_Nb ) == ( size of expandedKey ) / (AES256_Nb * (AES256_Nr + 1))
Leakage
None

◆ aes256SingleKeyEncryptEcb()

D xor_uint32 aes256SingleKeyEncryptEcb ( D xor_uint32[[1]]  expandedKey,
D xor_uint32[[1]]  plainText 
)
Parameters
expandedKey- an aes256 expanded key of type xor_uint32. See also aesGenkey and aesExpandKey
plainText- a string converted to a xor_uint32 vector
Precondition
the size of plainText has to be dividable by AES256_Nb
the size of expandedKey has to be (AES256_Nb * (AES256_Nr + 1))
Leakage
None