LCOV - code coverage report
Current view: top level - src/crypto - aes-encblock.c (source / functions) Hit Total Coverage
Test: wpa_supplicant/hostapd combined for hwsim test run 1393793999 Lines: 6 7 85.7 %
Date: 2014-03-02 Functions: 1 1 100.0 %
Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * AES encrypt_block
       3                 :            :  *
       4                 :            :  * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
       5                 :            :  *
       6                 :            :  * This software may be distributed under the terms of the BSD license.
       7                 :            :  * See README for more details.
       8                 :            :  */
       9                 :            : 
      10                 :            : #include "includes.h"
      11                 :            : 
      12                 :            : #include "common.h"
      13                 :            : #include "aes.h"
      14                 :            : #include "aes_wrap.h"
      15                 :            : 
      16                 :            : /**
      17                 :            :  * aes_128_encrypt_block - Perform one AES 128-bit block operation
      18                 :            :  * @key: Key for AES
      19                 :            :  * @in: Input data (16 bytes)
      20                 :            :  * @out: Output of the AES block operation (16 bytes)
      21                 :            :  * Returns: 0 on success, -1 on failure
      22                 :            :  */
      23                 :        656 : int aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out)
      24                 :            : {
      25                 :            :         void *ctx;
      26                 :        656 :         ctx = aes_encrypt_init(key, 16);
      27         [ -  + ]:        656 :         if (ctx == NULL)
      28                 :          0 :                 return -1;
      29                 :        656 :         aes_encrypt(ctx, in, out);
      30                 :        656 :         aes_encrypt_deinit(ctx);
      31                 :        656 :         return 0;
      32                 :            : }

Generated by: LCOV version 1.9