QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
scb.h
Go to the documentation of this file.
1/* 2025 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE: This software and all accompanying materials are the exclusive
5 * property of Quantum Resistant Cryptographic Solutions Corporation (QRCS).
6 * The intellectual and technical concepts contained within this implementation
7 * are proprietary to QRCS and its authorized licensors and are protected under
8 * applicable U.S. and international copyright, patent, and trade secret laws.
9 *
10 * CRYPTOGRAPHIC STANDARDS:
11 * - This software includes implementations of cryptographic algorithms such as
12 * SHA3, AES, and others. These algorithms are public domain or standardized
13 * by organizations such as NIST and are NOT the property of QRCS.
14 * - However, all source code, optimizations, and implementations in this library
15 * are original works of QRCS and are protected under this license.
16 *
17 * RESTRICTIONS:
18 * - Redistribution, modification, or unauthorized distribution of this software,
19 * in whole or in part, is strictly prohibited.
20 * - This software is provided for non-commercial, educational, and research
21 * purposes only. Commercial use in any form is expressly forbidden.
22 * - Licensing and authorized distribution are solely at the discretion of QRCS.
23 * - Any use of this software implies acceptance of these restrictions.
24 *
25 * DISCLAIMER:
26 * This software is provided "as is," without warranty of any kind, express or
27 * implied, including but not limited to warranties of merchantability or fitness
28 * for a particular purpose. QRCS disclaims all liability for any direct, indirect,
29 * incidental, or consequential damages resulting from the use or misuse of this software.
30 *
31 * FULL LICENSE:
32 * This software is subject to the **Quantum Resistant Cryptographic Solutions
33 * Proprietary License (QRCS-PL)**. The complete license terms are included
34 * in the LICENSE.txt file distributed with this software.
35 *
36 * Written by: John G. Underhill
37 * Contact: john.underhill@protonmail.com
38 */
39
40#ifndef QSC_SCB_H
41#define QSC_SCB_H
42
43#include "common.h"
44#include "sha3.h"
45
46QSC_CPLUSPLUS_ENABLED_START
47
78
83#define QSC_SCB_256_SEED_SIZE 32ULL
84
89#define QSC_SCB_512_SEED_SIZE 64ULL
90
95#define QSC_SCB_L2CACHE_DEFAULT_SIZE (1024ULL * 256ULL)
96
101#define QSC_SCB_MEMORY_COST_SIZE (1024ULL * 1024ULL)
102
107#define QSC_SCB_MEMORY_MAXIMUM 128ULL
108
113#define QSC_SCB_MEMORY_MINIMUM 1ULL
114
119#define QSC_SCB_CPU_MINIMUM 1ULL
120
125#define QSC_SCB_CPU_MAXIMUM 1000ULL
126
141
148
160QSC_EXPORT_API void qsc_scb_initialize(qsc_scb_state* ctx, const uint8_t* seed, size_t seedlen, const uint8_t* info, size_t infolen, size_t cpucost, size_t memcost);
161
169QSC_EXPORT_API void qsc_scb_generate(qsc_scb_state* ctx, uint8_t* output, size_t otplen);
170
178QSC_EXPORT_API void qsc_scb_update(qsc_scb_state* ctx, const uint8_t* seed, size_t seedlen);
179
180QSC_CPLUSPLUS_ENABLED_END
181
182#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_scb_initialize(qsc_scb_state *ctx, const uint8_t *seed, size_t seedlen, const uint8_t *info, size_t infolen, size_t cpucost, size_t memcost)
[void] Initialize the pseudo-random provider state with a seed and optional personalization string.
Definition scb.c:107
QSC_EXPORT_API void qsc_scb_dispose(qsc_scb_state *ctx)
[void] Dispose of the DRBG state.
Definition scb.c:93
QSC_EXPORT_API void qsc_scb_generate(qsc_scb_state *ctx, uint8_t *output, size_t otplen)
[void] Generate pseudo-random bytes using the random provider.
Definition scb.c:149
QSC_EXPORT_API void qsc_scb_update(qsc_scb_state *ctx, const uint8_t *seed, size_t seedlen)
[void] Update the random provider with new keying material.
Definition scb.c:204
#define QSC_SCB_512_SEED_SIZE
The SCB-512 seed size.
Definition scb.h:89
SHA3 family of hash functions.
qsc_keccak_rate
The Keccak rate; determines which security strength is used by the function, 128, 256,...
Definition sha3.h:251
The SCB state structure.
Definition scb.h:134
size_t memc
Definition scb.h:137
uint8_t ckey[QSC_SCB_512_SEED_SIZE]
Definition scb.h:135
size_t klen
Definition scb.h:138
qsc_keccak_rate rate
Definition scb.h:139
size_t cpuc
Definition scb.h:136