libavutil/aes.c File Reference
#include "common.h"
#include "aes.h"
Go to the source code of this file.
 | 
 Data Structures | 
| union   | av_aes_block | 
| struct   | AVAES | 
 Functions | 
| static void  | addkey (av_aes_block *dst, const av_aes_block *src, const av_aes_block *round_key) | 
| static void  | subshift (av_aes_block s0[2], int s, const uint8_t *box) | 
| static int  | mix_core (uint32_t multbl[][256], int a, int b, int c, int d) | 
| static void  | mix (av_aes_block state[2], uint32_t multbl[][256], int s1, int s3) | 
| static void  | crypt (AVAES *a, int s, const uint8_t *sbox, uint32_t multbl[][256]) | 
| void  | av_aes_crypt (AVAES *a, uint8_t *dst_, const uint8_t *src_, int count, uint8_t *iv_, int decrypt) | 
|   | Encrypt or decrypt a buffer using a previously initialized context.  
  | 
| static void  | init_multbl2 (uint8_t tbl[1024], const int c[4], const uint8_t *log8, const uint8_t *alog8, const uint8_t *sbox) | 
| int  | av_aes_init (AVAES *a, const uint8_t *key, int key_bits, int decrypt) | 
|   | Initialize an AVAES context.  
  | 
 Variables | 
| const int  | av_aes_size = sizeof(AVAES) | 
| static const uint8_t  | rcon [10] | 
| static uint8_t  | sbox [256] | 
| static uint8_t  | inv_sbox [256] | 
| static uint32_t  | enc_multbl [4][256] | 
| static uint32_t  | dec_multbl [4][256] | 
Function Documentation
      
        
          | void av_aes_crypt            | 
          ( | 
          struct AVAES *  | 
           a,  | 
        
        
           | 
           | 
          uint8_t *  | 
           dst,  | 
        
        
           | 
           | 
          const uint8_t *  | 
           src,  | 
        
        
           | 
           | 
          int  | 
           count,  | 
        
        
           | 
           | 
          uint8_t *  | 
           iv,  | 
        
        
           | 
           | 
          int  | 
           decrypt |   | 
        
        
           | 
          ) | 
           |  |  | 
        
      
 
Encrypt or decrypt a buffer using a previously initialized context. 
- Parameters:
 - 
  
     | count  | number of 16 byte blocks  | 
     | dst  | destination array, can be equal to src  | 
     | src  | source array, can be equal to dst  | 
     | iv  | initialization vector for CBC mode, if NULL then ECB will be used  | 
     | decrypt  | 0 for encryption, 1 for decryption  | 
  
 
Definition at line 98 of file aes.c.
Referenced by crypto_read(), and mxf_decrypt_triplet().
 
 
      
        
          | int av_aes_init            | 
          ( | 
          struct AVAES *  | 
           a,  | 
        
        
           | 
           | 
          const uint8_t *  | 
           key,  | 
        
        
           | 
           | 
          int  | 
           key_bits,  | 
        
        
           | 
           | 
          int  | 
           decrypt |   | 
        
        
           | 
          ) | 
           |  |  | 
        
      
 
 
      
        
          | static void crypt            | 
          ( | 
          AVAES *  | 
           a,  | 
        
        
           | 
           | 
          int  | 
           s,  | 
        
        
           | 
           | 
          const uint8_t *  | 
           sbox,  | 
        
        
           | 
           | 
          uint32_t  | 
           multbl[][256] |   | 
        
        
           | 
          ) | 
           |  |  [inline, static] | 
        
      
 
 
      
        
          | static void init_multbl2            | 
          ( | 
          uint8_t  | 
           tbl[1024],  | 
        
        
           | 
           | 
          const int  | 
           c[4],  | 
        
        
           | 
           | 
          const uint8_t *  | 
           log8,  | 
        
        
           | 
           | 
          const uint8_t *  | 
           alog8,  | 
        
        
           | 
           | 
          const uint8_t *  | 
           sbox |   | 
        
        
           | 
          ) | 
           |  |  [static] | 
        
      
 
 
      
        
          | static void mix            | 
          ( | 
          av_aes_block  | 
           state[2],  | 
        
        
           | 
           | 
          uint32_t  | 
           multbl[][256],  | 
        
        
           | 
           | 
          int  | 
           s1,  | 
        
        
           | 
           | 
          int  | 
           s3 |   | 
        
        
           | 
          ) | 
           |  |  [inline, static] | 
        
      
 
Definition at line 80 of file aes.c.
 
 
      
        
          | static int mix_core            | 
          ( | 
          uint32_t  | 
           multbl[][256],  | 
        
        
           | 
           | 
          int  | 
           a,  | 
        
        
           | 
           | 
          int  | 
           b,  | 
        
        
           | 
           | 
          int  | 
           c,  | 
        
        
           | 
           | 
          int  | 
           d |   | 
        
        
           | 
          ) | 
           |  |  [inline, static] | 
        
      
 
 
      
        
          | static void subshift            | 
          ( | 
          av_aes_block  | 
           s0[2],  | 
        
        
           | 
           | 
          int  | 
           s,  | 
        
        
           | 
           | 
          const uint8_t *  | 
           box |   | 
        
        
           | 
          ) | 
           |  |  [static] | 
        
      
 
 
Variable Documentation
      
        
          const uint8_t rcon[10] [static]           | 
        
      
 
Initial value:
 {
  0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36
}
 
Definition at line 43 of file aes.c.
Referenced by av_aes_init().
 
 
      
        
          uint8_t sbox[256] [static]           |