summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/Security/ServiceProvider/include/sspCommon.h
blob: 5fd2bea3f64d5a2311bd103c33ec3149398af7de (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
73
74
/**************************************************************************//**
  \file sspCommon.h

  \brief Declarations of common Security Service Provider's fields and types.

  \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:
      06/12/07 ALuzhetsky - Created.
******************************************************************************/

#ifndef _SSPCOMMON_H
#define _SSPCOMMON_H

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

/******************************************************************************
                        Definitions section.
******************************************************************************/
#define SECURITY_KEY_SIZE   16U
#define SECURITY_BLOCK_SIZE 16U
#define SSP_SECURITY_CONTROL_FIELD_LENGTH 1U
#define SSP_FRAME_COUNTER_FIELD_LENGTH    4U
#define SSP_KEY_SEQ_NUMBER_FIELD_LENGTH   1U

/******************************************************************************
                        Types section.
******************************************************************************/
/**************************************************************************//**
  \brief Possible status values of different SSP primitives.
******************************************************************************/
typedef enum
{
  SSP_SUCCESS_STATUS,
  SSP_NOT_PERMITED_STATUS,
  SSP_MAX_FRM_COUNTER_STATUS,
  SSP_BAD_CCM_OUTPUT_STATUS,
} SSP_Status_t;

/**************************************************************************//**
  \brief Internal service fields which give an opportunity to compose requests' queue.
******************************************************************************/
typedef struct
{
  void    *next;
  uint8_t requestId;
} SSP_Service_t;


/******************************************************************************
                      Prototypes section
 ******************************************************************************/
/*******************************************************************************
  Checks a security key.
  Parameters:
    key - valid pointer to a security key.
  Return:
    true - if key is not zero otherwise return false.
********************************************************************************/
bool SSP_IsKeyValid(const uint8_t *key);


#endif //_SSPCOMMON_H

// eof sspCommon.h