LCOV - code coverage report
Current view: top level - src/crypto/x11 - aes.cpp (source / functions) Hit Total Coverage
Test: test_dash_coverage.info Lines: 9 9 100.0 %
Date: 2026-06-25 07:23:51 Functions: 2 2 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2025 The Dash Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #include <crypto/x11/dispatch.h>
       6             : #include <crypto/x11/util/consts_aes.hpp>
       7             : 
       8             : #include <cstdint>
       9             : 
      10             : namespace sapphire {
      11             : namespace soft_aes {
      12      552904 : void Round(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3,
      13             :            uint32_t k0, uint32_t k1, uint32_t k2, uint32_t k3,
      14             :            uint32_t& y0, uint32_t& y1, uint32_t& y2, uint32_t& y3)
      15             : {
      16             :     using namespace consts;
      17      552904 :     y0 = aes_tbox_le[0][(x0) & 0xff] ^ aes_tbox_le[1][((x1) >> 8) & 0xff] ^ aes_tbox_le[2][((x2) >> 16) & 0xff] ^ aes_tbox_le[3][((x3) >> 24) & 0xff] ^ (k0);
      18      552904 :     y1 = aes_tbox_le[0][(x1) & 0xff] ^ aes_tbox_le[1][((x2) >> 8) & 0xff] ^ aes_tbox_le[2][((x3) >> 16) & 0xff] ^ aes_tbox_le[3][((x0) >> 24) & 0xff] ^ (k1);
      19      552904 :     y2 = aes_tbox_le[0][(x2) & 0xff] ^ aes_tbox_le[1][((x3) >> 8) & 0xff] ^ aes_tbox_le[2][((x0) >> 16) & 0xff] ^ aes_tbox_le[3][((x1) >> 24) & 0xff] ^ (k2);
      20      552904 :     y3 = aes_tbox_le[0][(x3) & 0xff] ^ aes_tbox_le[1][((x0) >> 8) & 0xff] ^ aes_tbox_le[2][((x1) >> 16) & 0xff] ^ aes_tbox_le[3][((x2) >> 24) & 0xff] ^ (k3);
      21      552904 : }
      22             : 
      23      371624 : void RoundKeyless(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3,
      24             :                   uint32_t& y0, uint32_t& y1, uint32_t& y2, uint32_t& y3)
      25             : {
      26      371624 :     Round(x0, x1, x2, x3, /*k0=*/0, /*k1=*/0, /*k2=*/0, /*k3=*/0, y0, y1, y2, y3);
      27      371624 : }
      28             : } // namespace soft_aes
      29             : } // namespace sapphire

Generated by: LCOV version 1.16