QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
donna128.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_DONNA128_H
41#define QSC_DONNA128_H
42
43#include "common.h"
44
45QSC_CPLUSPLUS_ENABLED_START
46
87
92QSC_EXPORT_API typedef struct
93{
94 uint64_t high;
95 uint64_t low;
96} uint128;
97
107
117
126QSC_EXPORT_API uint64_t qsc_donna128_andl(const uint128* x, uint64_t mask);
127
136QSC_EXPORT_API uint64_t qsc_donna128_andh(const uint128* x, uint64_t mask);
137
147
157
167
168QSC_CPLUSPLUS_ENABLED_END
169
170#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 uint128 qsc_donna128_add(const uint128 *x, const uint128 *y)
Add two 128-bit integers.
Definition donna128.c:72
QSC_EXPORT_API uint128 qsc_donna128_multiply(const uint128 *x, uint64_t y)
Multiply a 128-bit integer by a 64-bit integer.
Definition donna128.c:85
QSC_EXPORT_API uint64_t qsc_donna128_andh(const uint128 *x, uint64_t mask)
Bitwise AND the high part of a 128-bit integer.
Definition donna128.c:67
QSC_EXPORT_API uint128 qsc_donna128_or(const uint128 *x, const uint128 *y)
Bitwise OR of two 128-bit integers.
Definition donna128.c:101
QSC_EXPORT_API uint128 qsc_donna128_shift_left(const uint128 *x, size_t shift)
Left shift a 128-bit integer.
Definition donna128.c:51
QSC_EXPORT_API uint64_t qsc_donna128_andl(const uint128 *x, uint64_t mask)
Bitwise AND the low part of a 128-bit integer.
Definition donna128.c:62
QSC_EXPORT_API uint128 qsc_donna128_shift_right(const uint128 *x, size_t shift)
Right shift a 128-bit integer.
Definition donna128.c:40
128-bit integer structure.
Definition donna128.h:93
uint64_t low
Definition donna128.h:95
uint64_t high
Definition donna128.h:94