shared3p_aes.sc

shared3p_aes.sc

Module with AES128/192/256 functions.

Functions:

aesEncryptEcb

Function for encrypting with AES algorithm.

Detailed Description

returns a vector of type xor_uint32 with the encrypted values

Function Overloads

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

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))

None

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

the size of plainText has to be dividable by AES128_Nb

the size of expandedKey has to be (AES128_Nb * (AES128_Nr + 1))

None

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

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))

None

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

the size of plainText has to be dividable by AES192_Nb

the size of expandedKey has to be (AES192_Nb * (AES192_Nr + 1))

None

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

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))

None

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

the size of plainText has to be dividable by AES256_Nb

the size of expandedKey has to be (AES256_Nb * (AES256_Nr + 1))

None

aesExpandKey

Function for expanding a randomly generated AES key.

Detailed Description

Parameters

aeskey

- a 1-dimensional array of type xor_uint32. See also aesGenkey

returns a vector of type xor_uint32 with an expanded key

None

Function Overloads

D xor_uint32 aes128ExpandKey(D xor_uint32[[1]] aeskey)

the size of aeskey has to be dividable by AES128_Nk

D xor_uint32 aes192ExpandKey(D xor_uint32[[1]] aeskey)

the size of aeskey has to be dividable by AES192_Nk

D xor_uint32 aes256ExpandKey(D xor_uint32[[1]] aeskey)

the size of aeskey has to be dividable by AES256_Nk

aesGenkey

Function for generating a key for AES encryption.

Detailed Description

Parameters

blocks

- an uint type value

returns a vector of type xor_uint32 with a randomly generated key

Function Overloads

D xor_uint32 aes128Genkey(uint blocks)

( uint max value ) / AES128_Nk >= blocks

D xor_uint32 aes192Genkey(uint blocks)

( uint max value ) / AES192_Nk >= blocks

D xor_uint32 aes256Genkey(uint blocks)

( uint max value ) / AES256_Nk >= blocks