mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibCrypto: Add the BigInteger concept
This makes it much easier to write (template) functions that accept either a signed or unsigned bigint parameter.
This commit is contained in:
parent
9c209b8079
commit
0c424c4dab
1 changed files with 19 additions and 0 deletions
19
Userland/Libraries/LibCrypto/Forward.h
Normal file
19
Userland/Libraries/LibCrypto/Forward.h
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2021, the SerenityOS developers.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Concepts.h>
|
||||||
|
|
||||||
|
namespace Crypto {
|
||||||
|
|
||||||
|
class SignedBigInteger;
|
||||||
|
class UnsignedBigInteger;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
concept BigInteger = IsSame<T, SignedBigInteger> || IsSame<T, UnsignedBigInteger>;
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue