Merge pull request #4786 from OlegHahm/crypto_doc_fix

doc crypto: fixed typo and improved example
This commit is contained in:
Martine Lenders 2016-02-12 00:11:04 +01:00
commit e52f16bbe0

View File

@ -29,14 +29,19 @@
* @code * @code
* #include "crypto/ciphers.h" * #include "crypto/ciphers.h"
* *
* ciphter_t cipher; * cipher_t cipher;
* uint8_t key[16] = {0}, plain_text[16] = {0}, cipher_text[16] = {0}; * uint8_t key[AES_KEY_SIZE] = {0},
* plain_text[AES_BLOCK_SIZE] = {0},
* cipher_text[AES_BLOCK_SIZE] = {0};
* *
* if (cipher_init(&cipher, CIPHER_AES_128, key, key_len) < 0) * if (cipher_init(&cipher, CIPHER_AES_128, key, AES_KEY_SIZE) < 0)
* printf("Cipher init failed!\n"); * printf("Cipher init failed!\n");
* *
* if (cipher_encrypt(&cipher, plain_text, cipher_text) < 0) * if (cipher_encrypt(&cipher, plain_text, cipher_text) < 0)
* printf("Cipher encryption!\n"); * printf("Cipher encryption failed!\n");
* else
* od_hex_dump(cipher_text, AES_BLOCK_SIZE, 0);
*
* @endcode * @endcode
* *
* If you need to encrypt data of arbitrary size take a look at the different * If you need to encrypt data of arbitrary size take a look at the different