QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
cpuidex.h
Go to the documentation of this file.
1/*
2 * 2025 Quantum Resistant Cryptographic Solutions Corporation
3 * All Rights Reserved.
4 *
5 * NOTICE: This software and all accompanying materials are the exclusive
6 * property of Quantum Resistant Cryptographic Solutions Corporation (QRCS).
7 * The intellectual and technical concepts contained within this implementation
8 * are proprietary to QRCS and its authorized licensors and are protected under
9 * applicable U.S. and international copyright, patent, and trade secret laws.
10 *
11 * CRYPTOGRAPHIC STANDARDS:
12 * - This software includes implementations of cryptographic algorithms such as
13 * SHA3, AES, and others. These algorithms are public domain or standardized
14 * by organizations such as NIST and are NOT the property of QRCS.
15 * - However, all source code, optimizations, and implementations in this library
16 * are original works of QRCS and are protected under this license.
17 *
18 * RESTRICTIONS:
19 * - Redistribution, modification, or unauthorized distribution of this software,
20 * in whole or in part, is strictly prohibited.
21 * - This software is provided for non-commercial, educational, and research
22 * purposes only. Commercial use in any form is expressly forbidden.
23 * - Licensing and authorized distribution are solely at the discretion of QRCS.
24 * - Any use of this software implies acceptance of these restrictions.
25 *
26 * DISCLAIMER:
27 * This software is provided "as is," without warranty of any kind, express or
28 * implied, including but not limited to warranties of merchantability or fitness
29 * for a particular purpose. QRCS disclaims all liability for any direct, indirect,
30 * incidental, or consequential damages resulting from the use or misuse of this software.
31 *
32 * FULL LICENSE:
33 * This software is subject to the **Quantum Resistant Cryptographic Solutions
34 * Proprietary License (QRCS-PL)**. The complete license terms are included
35 * in the LICENSE.txt file distributed with this software.
36 *
37 * Written by: John G. Underhill
38 * Contact: john.underhill@protonmail.com
39 */
40
41#ifndef QSC_CPUIDEX_H
42#define QSC_CPUIDEX_H
43
44#include "common.h"
45
46QSC_CPLUSPLUS_ENABLED_START
47
76
81#define QSC_CPUIDEX_SERIAL_SIZE 12ULL
82
83#if defined(QSC_SYSTEM_OS_APPLE) && defined(QSC_SYSTEM_COMPILER_GCC)
88 #define QSC_CPUIDEX_VENDOR_SIZE 32
89#else
94 #define QSC_CPUIDEX_VENDOR_SIZE 12ULL
95#endif
96
109
148
157
165
166QSC_CPLUSPLUS_ENABLED_END
167
168#endif
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition common.h:520
QSC_EXPORT_API void qsc_cpuidex_print_stats(void)
Print the detected CPU features to the console.
Definition cpuidex.c:930
QSC_EXPORT_API bool qsc_cpuidex_features_set(qsc_cpuidex_cpu_features *const features)
Populate the CPU features structure with detected CPU capabilities.
Definition cpuidex.c:873
#define QSC_CPUIDEX_SERIAL_SIZE
The CPU serial number length (in bytes).
Definition cpuidex.h:81
#define QSC_CPUIDEX_VENDOR_SIZE
The CPU vendor name length.
Definition cpuidex.h:94
qsc_cpuidex_cpu_type
The detectable CPU architectures.
Definition cpuidex.h:102
@ qsc_cpuid_unknown
Definition cpuidex.h:103
@ qsc_cpuid_amd
Definition cpuidex.h:104
@ qsc_cpuid_intel
Definition cpuidex.h:105
@ qsc_cpuid_via
Definition cpuidex.h:106
@ qsc_cpuid_hygion
Definition cpuidex.h:107
Contains the CPU feature availability.
Definition cpuidex.h:119
bool avx512f
Definition cpuidex.h:130
uint32_t cpus
Definition cpuidex.h:136
uint32_t freqref
Definition cpuidex.h:139
uint32_t freqbase
Definition cpuidex.h:137
bool adx
Definition cpuidex.h:120
char serial[QSC_CPUIDEX_SERIAL_SIZE]
Definition cpuidex.h:144
uint32_t l2associative
Definition cpuidex.h:142
uint32_t cores
Definition cpuidex.h:135
bool hyperthread
Definition cpuidex.h:131
uint32_t l1cache
Definition cpuidex.h:140
char vendor[QSC_CPUIDEX_VENDOR_SIZE]
Definition cpuidex.h:145
bool sha256
Definition cpuidex.h:125
bool sha3
Definition cpuidex.h:127
uint32_t l2cache
Definition cpuidex.h:143
bool avx
Definition cpuidex.h:128
uint32_t freqmax
Definition cpuidex.h:138
bool aesni
Definition cpuidex.h:121
bool avx2
Definition cpuidex.h:129
bool rdrand
Definition cpuidex.h:132
bool armv7
Definition cpuidex.h:123
bool sha512
Definition cpuidex.h:126
uint32_t l1cacheline
Definition cpuidex.h:141
uint32_t cacheline
Definition cpuidex.h:134
bool rdtcsp
Definition cpuidex.h:133
qsc_cpuidex_cpu_type cputype
Definition cpuidex.h:146
bool pcmul
Definition cpuidex.h:122
bool neon
Definition cpuidex.h:124