- Main Page
- Classes
- Files

# Ap4AesBlockCipher.h

Go to the documentation of this file.

    00001 /*
    00002  * AES Block cipher
    00003  * (c) 2005 Gilles Boccon-Gibod
    00004  * Portions (c) 2001, Dr Brian Gladman (see below)
    00005  */
    00006
    00007 /*
    00008  -------------------------------------------------------------------------
    00009  Copyright (c) 2001, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
    00010  All rights reserved.
    00011
    00012  LICENSE TERMS
    00013
    00014  The free distribution and use of this software in both source and binary
    00015  form is allowed (with or without changes) provided that:
    00016
    00017    1. distributions of this source code include the above copyright
    00018       notice, this list of conditions and the following disclaimer;
    00019
    00020    2. distributions in binary form include the above copyright
    00021       notice, this list of conditions and the following disclaimer
    00022       in the documentation and/or other associated materials;
    00023
    00024    3. the copyright holder's name is not used to endorse products
    00025       built using this software without specific written permission.
    00026
    00027  DISCLAIMER
    00028
    00029  This software is provided 'as is' with no explicit or implied warranties
    00030  in respect of its properties, including, but not limited to, correctness
    00031  and fitness for purpose.
    00032  -------------------------------------------------------------------------
    00033  Issue Date: 29/07/2002
    00034 */
    00035
    00036 #ifndef _AP4_AES_BLOCK_CIPHER_H_
    00037 #define _AP4_AES_BLOCK_CIPHER_H_
    00038
    00039 /*----------------------------------------------------------------------
    00040 |   includes
    00041 +---------------------------------------------------------------------*/
    00042 #include "Ap4Types.h"
    00043 #include "Ap4Config.h"
    00044 #include "Ap4Protection.h"
    00045
    00046 /*----------------------------------------------------------------------
    00047 |   class references
    00048 +---------------------------------------------------------------------*/
    00049 struct aes_ctx;
    00050
    00051 /*----------------------------------------------------------------------
    00052 |   AES constants
    00053 +---------------------------------------------------------------------*/
    00054 #define AP4_AES_BLOCK_SIZE  16
    00055 #define AP4_AES_KEY_LENGTH  16
    00056
    00057 /*----------------------------------------------------------------------
    00058 |   AP4_AesBlockCipher class
    00059 +---------------------------------------------------------------------*/
    00060 class AP4_AesBlockCipher : public AP4_BlockCipher
    00061 {
    00062 public:
    00063     // constructor and destructor
    00064     AP4_AesBlockCipher(const AP4_UI08*                  key,
    00065                        AP4_BlockCipher::CipherDirection direction);
    00066    ~AP4_AesBlockCipher();
    00067
    00068    // AP4_AesBlockCipher methods
    00069    virtual AP4_Result ProcessBlock(const AP4_UI08* input,
    00070                                    AP4_UI08*       output);
    00071
    00072 private:
    00073     // members
    00074     CipherDirection m_Direction;
    00075     aes_ctx*        m_Context;
    00076 };
    00077
    00078 #endif // _AP4_AES_BLOCK_CIPHER_H_