2013-11-28 18:12:40 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Freie Universität Berlin
|
|
|
|
*
|
2014-08-23 15:43:13 +02:00
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
2013-11-28 18:12:40 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup sys_crypto Crypto
|
2015-08-26 10:42:50 +02:00
|
|
|
* @ingroup sys
|
|
|
|
*
|
2015-04-02 08:56:18 +02:00
|
|
|
* @brief RIOT provides a collection of block cipher ciphers, different
|
|
|
|
operation modes and cryptographic hash algorithms.
|
|
|
|
*
|
2015-08-26 10:42:50 +02:00
|
|
|
* @section ciphers Ciphers
|
2015-04-02 08:56:18 +02:00
|
|
|
*
|
|
|
|
* Riot supports the following block ciphers:
|
|
|
|
* * AES-128
|
|
|
|
* * 3DES
|
|
|
|
* * Twofish
|
|
|
|
* * NULL
|
|
|
|
*
|
|
|
|
* You can use them directly by adding "crypto" to your USEMODULE-List.
|
|
|
|
* While you can use the ciphers functions directly, you should resort to
|
|
|
|
* the generic API for block ciphers whenever possible.
|
|
|
|
*
|
|
|
|
* Example:
|
2015-08-26 10:42:50 +02:00
|
|
|
* @code
|
2015-04-02 08:56:18 +02:00
|
|
|
* #include "crypto/ciphers.h"
|
|
|
|
*
|
|
|
|
* ciphter_t cipher;
|
|
|
|
* uint8_t key[16] = {0}, plain_text[16] = {0}, cipher_text[16] = {0};
|
|
|
|
*
|
|
|
|
* if (cipher_init(&cipher, CIPHER_AES_128, key, key_len) < 0)
|
|
|
|
* printf("Cipher init failed!\n");
|
|
|
|
*
|
|
|
|
* if (cipher_encrypt(&cipher, plain_text, cipher_text) < 0)
|
|
|
|
* printf("Cipher encryption!\n");
|
2015-08-26 10:42:50 +02:00
|
|
|
* @endcode
|
2015-04-02 08:56:18 +02:00
|
|
|
*
|
|
|
|
* If you need to encrypt data of arbitrary size take a look at the different
|
|
|
|
* operation modes like: CBC, CTR or CCM.
|
|
|
|
*
|
|
|
|
* Additional examples can be found in the test suite.
|
|
|
|
*
|
2015-08-26 10:42:50 +02:00
|
|
|
* @section hashes Hashes
|
2015-04-02 08:56:18 +02:00
|
|
|
*
|
|
|
|
* RIOT currently supports sha256 as a cryptographic hash implementation.
|
2013-11-28 18:12:40 +01:00
|
|
|
*/
|