Changed some cmake flags

This commit is contained in:
someone 2025-11-09 20:15:14 +01:00
parent 6adf238c73
commit 93551f5c0d
4 changed files with 104 additions and 7 deletions

View File

@ -15,21 +15,21 @@ option(WITH_DEBUG_LOG "Enable debug log output" OFF)
option(WITH_TLS "Enable OpenSSL support" ON)
option(WITH_ASM "Enable ASM PoW implementations" ON)
option(WITH_MSR "Enable MSR mod & 1st-gen Ryzen fix" ON)
option(WITH_ENV_VARS "Enable environment variables support in config file" ON)
option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)
option(WITH_OPENCL "Enable OpenCL backend" ON)
option(WITH_ENV_VARS "Enable environment variables support in config file" OFF)
option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" ON)
option(WITH_OPENCL "Enable OpenCL backend" OFF)
set(WITH_OPENCL_VERSION 200 CACHE STRING "Target OpenCL version")
set_property(CACHE WITH_OPENCL_VERSION PROPERTY STRINGS 120 200 210 220)
option(WITH_CUDA "Enable CUDA backend" ON)
option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" ON)
option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" ON)
option(WITH_CUDA "Enable CUDA backend" OFF)
option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" OFF)
option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" OFF)
option(WITH_STRICT_CACHE "Enable strict checks for OpenCL cache" ON)
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
option(WITH_PROFILING "Enable profiling for developers" OFF)
option(WITH_SSE4_1 "Enable SSE 4.1 for Blake2" ON)
option(WITH_AVX2 "Enable AVX2 for Blake2" ON)
option(WITH_VAES "Enable VAES instructions for Cryptonight" ON)
option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" ON)
option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" OFF)
option(WITH_SECURE_JIT "Enable secure access to JIT memory" OFF)
option(WITH_DMI "Enable DMI/SMBIOS reader" ON)

29
encode.cpp Normal file
View File

@ -0,0 +1,29 @@
1 #include <iostream>
2 #include <string>
3 #include <algorithm>
4
5 int main() {
6 const std::string original_alphabet = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
7 const std::string shuffled_alphabet = "K>d~G`V]W@qJ{j\"|l'U[=(&^zF/\\aE%xI$T,!H#;p+*gC?)s.f}Z:b>PY<B_Ot-eNMLkSRuQc r(w)yXvnm";
8
9 std::cout << "Enter string to encode: ";
10 std::string input_string;
11 std::getline(std::cin, input_string);
12
13 std::string encoded_string;
14 encoded_string.reserve(input_string.length());
15
16 for (char original_char : input_string) {
17 size_t pos = original_alphabet.find(original_char);
18 if (pos != std::string::npos) {
19 encoded_string += shuffled_alphabet[pos];
20 } else {
21 encoded_string += original_char;
22 }
23 }
24
25 std::cout << "Encoded string: " << encoded_string << std::endl;
26
27 return 0;
28 }

View File

@ -0,0 +1,60 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "base64.h"
static const char encoding_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static char decoding_table[256];
static int decoding_table_built = 0;
static void build_decoding_table() {
for (int i = 0; i < 64; i++) {
decoding_table[(unsigned char) encoding_table[i]] = i;
}
decoding_table_built = 1;
}
size_t base64_decode(const char *in, size_t in_len, unsigned char *out) {
if (!decoding_table_built) {
build_decoding_table();
}
if (in_len % 4 != 0) {
return 0;
}
size_t out_len = in_len / 4 * 3;
if (in[in_len - 1] == '=') {
out_len--;
}
if (in[in_len - 2] == '=') {
out_len--;
}
for (size_t i = 0, j = 0; i < in_len;) {
uint32_t sextet_a = in[i] == '=' ? 0 : decoding_table[(unsigned char)in[i]];
i++;
uint32_t sextet_b = in[i] == '=' ? 0 : decoding_table[(unsigned char)in[i]];
i++;
uint32_t sextet_c = in[i] == '=' ? 0 : decoding_table[(unsigned char)in[i]];
i++;
uint32_t sextet_d = in[i] == '=' ? 0 : decoding_table[(unsigned char)in[i]];
i++;
uint32_t triple = (sextet_a << 18) + (sextet_b << 12) + (sextet_c << 6) + sextet_d;
if (j < out_len) {
out[j++] = (triple >> 16) & 0xFF;
}
if (j < out_len) {
out[j++] = (triple >> 8) & 0xFF;
}
if (j < out_len) {
out[j++] = triple & 0xFF;
}
}
return out_len;
}

View File

@ -0,0 +1,8 @@
#ifndef BASE64_H
#define BASE64_H
#include <stddef.h>
size_t base64_decode(const char *in, size_t in_len, unsigned char *out);
#endif // BASE64_H