Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Encryption Standard (DES)

See Quick start guide for XMEGA DES driver.

This is a driver for the AVR XMEGA DES core instruction. It provides functions for des, 3des and CBC des encryption and decryption operations.

DES Start Setting

DES is supported by a DES instruction in the AVR XMEGA core. The 8-byte key and 8-byte data blocks must be loaded into the Register file, and then DES must be executed 16 times to encrypt/decrypt the data block.

Note
The functions for loading configurations/data/key are not protected against interrupts.

start guide

See Quick start guide for XMEGA DES driver

Modules

 
 Quick Start Guide(s)
 In this section you can find a list of all Quick Start guides related to the Data Encryption Standard (DES).
 

Functions

void des_3des_decrypt (uint8_t *ciphertext, uint8_t *plaintext, uint8_t *keys)
 Function that does a 3DES decryption on one 64-bit data block. More...
 
void des_3des_encrypt (uint8_t *plaintext, uint8_t *ciphertext, uint8_t *keys)
 Function that does a 3DES encryption on one 64-bit data block. More...
 
void des_cbc_decrypt (uint8_t *ciphertext, uint8_t *plaintext, uint8_t *keys, uint8_t *init, bool triple_DES, uint16_t block_length)
 Function that does DES Cipher Block Chaining decryption on a given number of 64-bit data block. More...
 
void des_cbc_encrypt (uint8_t *plaintext, uint8_t *ciphertext, uint8_t *keys, uint8_t *init, bool triple_DES, uint16_t block_length)
 Function that does DES Cipher Block Chaining encryption on a given number of 64-bit data block. More...
 
void des_decrypt (uint8_t *ciphertext, uint8_t *plaintext, uint8_t *key)
 Function that does a DES decryption on one 64-bit data block. More...
 
void des_encrypt (uint8_t *plaintext, uint8_t *ciphertext, uint8_t *key)
 Function that does a DES encryption on one 64-bit data block. More...
 

void des_3des_decrypt ( uint8_t *  ciphertext,
uint8_t *  plaintext,
uint8_t *  keys 
)

Function that does a 3DES decryption on one 64-bit data block.

Parameters
ciphertextPointer to the ciphertext that shall be decrypted.
plaintextPointer to where in memory the plaintext (answer) shall be stored.
keysPointer to the array of the 3 DES keys.

Referenced by main(), run_3des_decryption(), and run_3des_encryption_and_decryption_test().

void des_3des_encrypt ( uint8_t *  plaintext,
uint8_t *  ciphertext,
uint8_t *  keys 
)

Function that does a 3DES encryption on one 64-bit data block.

Parameters
plaintextPointer to the plaintext that shall be encrypted.
ciphertextPointer to where in memory the ciphertext (answer) shall be stored.
keysPointer to the array of the 3 DES keys.

Referenced by main(), run_3des_encryption(), and run_3des_encryption_and_decryption_test().

void des_cbc_decrypt ( uint8_t *  ciphertext,
uint8_t *  plaintext,
uint8_t *  keys,
uint8_t *  init,
bool  triple_DES,
uint16_t  block_length 
)

Function that does DES Cipher Block Chaining decryption on a given number of 64-bit data block.

Parameters
ciphertextPointer to the ciphertext that shall be decrypted.
plaintextPointer to where in memory the plaintext (answer) shall be stored.
keysPointer to the array of the one or three DES keys needed.
initPointer to initial vector used in in CBC.
triple_DESBool that indicate if 3DES or DES shall be used.
block_lengthValue that tells how many blocks to encrypt.
Note
The pointer to the ciphertext and plaintext must not be the same because the CBC algorithm uses previous values of the ciphertext to calculate the plaintext.

Referenced by main(), run_3des_cbc_decryption_test(), and run_des_cbc_decryption_test().

void des_cbc_encrypt ( uint8_t *  plaintext,
uint8_t *  ciphertext,
uint8_t *  keys,
uint8_t *  init,
bool  triple_DES,
uint16_t  block_length 
)

Function that does DES Cipher Block Chaining encryption on a given number of 64-bit data block.

Parameters
plaintextPointer to the plaintext that shall be encrypted.
ciphertextPointer to where in memory the ciphertext(answer) shall be stored.
keysPointer to the array of the one or three DES keys needed.
initPointer to initial vector used in in CBC.
triple_DESBool that indicate if 3DES or DES shall be used.
block_lengthValue that tells how many blocks to encrypt.

Referenced by main(), run_3des_cbc_encryption_test(), and run_des_cbc_encryption_test().

void des_decrypt ( uint8_t *  ciphertext,
uint8_t *  plaintext,
uint8_t *  key 
)

Function that does a DES decryption on one 64-bit data block.

Parameters
ciphertextPointer to the ciphertext that shall be decrypted.
plaintextPointer to where in memory the plaintext (answer) shall be stored.
keyPointer to the DES key.

Referenced by main(), run_des_decryption(), and run_des_encryption_and_decryption_test().

void des_encrypt ( uint8_t *  plaintext,
uint8_t *  ciphertext,
uint8_t *  key 
)

Function that does a DES encryption on one 64-bit data block.

Parameters
plaintextPointer to the plaintext that shall be encrypted.
ciphertextPointer to where in memory the ciphertext (answer) shall be stored.
keyPointer to the DES key.

Referenced by main(), run_des_encryption(), and run_des_encryption_and_decryption_test().