summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/MAC_PHY/include/rfEncrypt.h
blob: fa760078e5f78870e71ff5357abb7a67f09bff1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**************************************************************************//**
  \file rfEncrypt.h
  
  \brief Prototypes of ecnryption functions and corresponding types.
    Powered by RF chip.

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).
  
  \internal
    History:     
      18/01/08 A. Mandychev - Created.
      24/03/08 A. Mandychev - Renamed to rfEncrypt.h
******************************************************************************/

#ifndef _RFECNRYPT_H
#define _RFECNRYPT_H

/******************************************************************************
                    Includes section
******************************************************************************/
#include <types.h>
#include <macCommon.h>

/******************************************************************************
                    Define(s) section
******************************************************************************/
 
/******************************************************************************
                    Types section
******************************************************************************/
//! Set of AES command.
typedef enum
{
  RF_SET_KEY_AES_CMD = 0,
  RF_SET_INIT_VECT_AES_CMD,
  RF_ECB_ENCRYPT_AES_CMD,
  RF_CBC_ENCRYPT_AES_CMD,
} RF_AesCmd_t;

//! Encryption request structure.
typedef struct
{
  //! Service field - for internal needs.
  MAC_Service_t  service;
  //! AES command.
  RF_AesCmd_t aesCmd;
  //! Pointer to input data for AES command. 
  uint8_t *text;
  //! Size of input data in blocks.
  uint8_t blockCount; // Block is 128-bit data.
  void (*RF_EncryptConf)(void);
} RF_EncryptReq_t;

/******************************************************************************
                    Prototypes section
******************************************************************************/
/**************************************************************************//**
  \brief Executes AES command. Valid for RF231 and RF212.
  \param reqParams - request parameters structure pointer. 
  \return none.
******************************************************************************/
void RF_EncryptReq(RF_EncryptReq_t *reqParams);

#endif /*_RFECNRYPT_H*/

// eof rfEncrypt.h