一, 安装MYSYS2
1. 去https://www.msys2.org下载 msys2-x86_64-xxxxx.exe;
2. 按照msys2.org主页提示的步骤安装;
3.安装完默认起来的是 UCRT的, 可以根据环境的需要选择, 我选择的 MSYS2 MINGW64
4. 搭建编译环境, 安装对应的软件包
4.1 更新包数据和核心数据包
pacman -Syu
4.2 安装工具链
pacman -S mingw-w64-x86_64-gcc
4.3 安装其他软件和工具
pacman -S base-devel
pacman -S git
4.4 测试是否征程
gcc -v
4.5 安装cmake
pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-extra-cmake-modules
5. 编译TR31 with the code in github
#Windows
rm -Rf build &&
cmake -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DFETCH_MBEDTLS=YES -DFETCH_ARGP=YES &&
cmake --build build
6. 验证结果
结果OK!
$ ./tr31-tool --import B0128B1TX00N0300KS18FFFF00A0200001E00000KC0C000169E3KP0C00ECAD626F9F1A826814AA066D86C8C18BD0E14033E1EBEC75BEDF586E6E325F3AA8C0E5 --kbpk AB2E09DB3EF0BA71E0CE6CD755C23A3B
Key block format version: B
Key block length: 128 bytes
Key usage: [B1] Initial DUKPT Key (IK/IPEK)
Key algorithm: [T] TDES
Key mode of use: [X] Key Derivation
Key version: Unused
Key exportability: [N] Not exportable
Optional blocks [3]:
[KS] Initial Key Serial Number (KSN): FFFF00A0200001E00000
[KC] Key Check Value (KCV) of wrapped key: 0169E3 (Legacy KCV algorithm)
[KP] Key Check Value (KCV) of KBPK: ECAD62 (Legacy KCV algorithm)
Key length: 16
Key value: BF82DAC6A33DF92CE66E15B70E5DCEB6 (KCV: 0169E3)
二:补充:
Get submodule with git command from some project with submoudles
git -clone --recursive <project URL >
三:Reference:
1.https://www.msys2.org/