Yoshihiro TSUBOI / BLE_API_Native_IRC

Dependents:   BLE_Health_Thermometer_IRC BLE_RCBController_micono_test BLE_konashi_PIO_test BLE_ADT7410_TMP102_Sample ... more

Fork of BLE_API_Native_blog by Donal Morrissey

Committer:
ytsuboi
Date:
Wed Jun 11 15:15:30 2014 +0000
Revision:
19:d84e7516652b
Parent:
17:d5600677d532
Changed Low freq. clock source from XTAL to IRC

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 17:d5600677d532 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
ktownsend 17:d5600677d532 2 *
ktownsend 17:d5600677d532 3 * The information contained herein is confidential property of Nordic
ktownsend 17:d5600677d532 4 * Semiconductor ASA.Terms and conditions of usage are described in detail
ktownsend 17:d5600677d532 5 * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
ktownsend 17:d5600677d532 6 *
ktownsend 17:d5600677d532 7 * Licensees are granted free, non-transferable use of the information. NO
ktownsend 17:d5600677d532 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
ktownsend 17:d5600677d532 9 * the file.
ktownsend 17:d5600677d532 10 *
ktownsend 17:d5600677d532 11 * $LastChangedRevision: 13999 $
ktownsend 17:d5600677d532 12 */
ktownsend 17:d5600677d532 13
ktownsend 17:d5600677d532 14 /**
ktownsend 17:d5600677d532 15 * @file
ktownsend 17:d5600677d532 16 * @brief ECB driver API.
ktownsend 17:d5600677d532 17 */
ktownsend 17:d5600677d532 18
ktownsend 17:d5600677d532 19 #ifndef NRF_ECB_H__
ktownsend 17:d5600677d532 20 #define NRF_ECB_H__
ktownsend 17:d5600677d532 21
ktownsend 17:d5600677d532 22 /**
ktownsend 17:d5600677d532 23 * @defgroup nrf_ecb AES ECB encryption
ktownsend 17:d5600677d532 24 * @{
ktownsend 17:d5600677d532 25 * @ingroup nrf_drivers
ktownsend 17:d5600677d532 26 * @brief Driver for the nRF51 AES Electronic Code Book (ECB) peripheral.
ktownsend 17:d5600677d532 27 *
ktownsend 17:d5600677d532 28 * In order to encrypt and decrypt data the peripheral must be powered on
ktownsend 17:d5600677d532 29 * using nrf_ecb_init() and then the key set using nrf_ecb_set_key.
ktownsend 17:d5600677d532 30 */
ktownsend 17:d5600677d532 31
ktownsend 17:d5600677d532 32 #include <stdint.h>
ktownsend 17:d5600677d532 33 #include "nordic_global.h"
ktownsend 17:d5600677d532 34
ktownsend 17:d5600677d532 35 /**
ktownsend 17:d5600677d532 36 * Initialize and power on the ECB peripheral.
ktownsend 17:d5600677d532 37 *
ktownsend 17:d5600677d532 38 * Allocates memory for the ECBDATAPTR.
ktownsend 17:d5600677d532 39 * @retval true Initialization was successful.
ktownsend 17:d5600677d532 40 * @retval false Powering up failed.
ktownsend 17:d5600677d532 41 */
ktownsend 17:d5600677d532 42 bool nrf_ecb_init(void);
ktownsend 17:d5600677d532 43
ktownsend 17:d5600677d532 44 /**
ktownsend 17:d5600677d532 45 * Encrypt/decrypt 16-byte data using current key.
ktownsend 17:d5600677d532 46 *
ktownsend 17:d5600677d532 47 * The function avoids unnecessary copying of data if the point to the
ktownsend 17:d5600677d532 48 * correct locations in the ECB data structure.
ktownsend 17:d5600677d532 49 *
ktownsend 17:d5600677d532 50 * @param dst Result of encryption/decryption. 16 bytes will be written.
ktownsend 17:d5600677d532 51 * @param src Source with 16-byte data to be encrypted/decrypted.
ktownsend 17:d5600677d532 52 *
ktownsend 17:d5600677d532 53 * @retval true If the encryption operation completed.
ktownsend 17:d5600677d532 54 * @retval false If the encryption operation did not complete.
ktownsend 17:d5600677d532 55 */
ktownsend 17:d5600677d532 56 bool nrf_ecb_crypt(uint8_t * dst, const uint8_t * src);
ktownsend 17:d5600677d532 57
ktownsend 17:d5600677d532 58 /**
ktownsend 17:d5600677d532 59 * Set the key to be used for encryption/decryption.
ktownsend 17:d5600677d532 60 *
ktownsend 17:d5600677d532 61 * @param key Pointer to key. 16 bytes will be read.
ktownsend 17:d5600677d532 62 */
ktownsend 17:d5600677d532 63 void nrf_ecb_set_key(const uint8_t * key);
ktownsend 17:d5600677d532 64
ktownsend 17:d5600677d532 65 #endif // NRF_ECB_H__
ktownsend 17:d5600677d532 66
ktownsend 17:d5600677d532 67 /** @} */