src.dualinventive.com/mtinfo/tcpserver/legacy/common/include/cp3000-secure.h

60 lines
1.5 KiB
C

/*
************************************************************************
**
** Copyright (c) 2008..2011 by
** Core|Vision B.V.
** Cereslaan 10b
** 5384 VT Heesch
** The Netherlands
**
** All Rights Reserved
**
************************************************************************
*/
/*
************************************************************************
**
** Project name: Dual Inventive: Communication Protocol 3000
** Filename: cp3000-secure.h
** Author: Jack Weeland
** Date: December 2, 2011
** File version: 1.00 of December 2, 2011
**
************************************************************************
*/
/*
************************************************************************
**
** CP3000 security definitions
**
** Server to client data
** bytes
** -----
** 0..3 server identifier
** 4 command
** 8.. payload
** all other bytes are filled with random data
**
************************************************************************
*/
#ifndef _CP3000_SECURE_H_COMMON
#define _CP3000_SECURE_H_COMMON
/*
** Definitions for various sizes
*/
// Size in bytes of the user key for AES encryption/decryption
#define AES_USERKEY_SIZE (256 / 8)
/*
** Commands from server to device
*/
// One-byte commands
#define CP3000_SECURE_VERIFY 0x00 // verify the server address and sequence number in the payload
#define CP3000_SECURE_NEW_KEY 0x10 // payload contains a new server key
#endif /* _CP3000_SECURE_H_COMMON */