⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utils.h

📁 AES implementation in C++. Input: key file and the file for encryption Output: the crypted file.
💻 H
字号:
#pragma once

#ifndef UTILS
#define UTILS

unsigned char gmul(unsigned char a, unsigned char b) {
        unsigned char p = 0;
        unsigned char counter;
        unsigned char hi_bit_set;
        for(counter = 0; counter < 8; counter++) {
                if((b & 1) == 1) 
                        p ^= a;
                hi_bit_set = (a & 0x80);
                a <<= 1;
                if(hi_bit_set == 0x80) 
                        a ^= 0x1b; /* x^8 + x^4 + x^3 + x + 1 */
                b >>= 1;
        }
        return p;
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -