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:
Linus Groh 2021-12-21 23:08:23 +01:00
parent 9c209b8079
commit 0c424c4dab
Notes: sideshowbarker 2024-07-17 22:22:30 +09:00

View 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>;
}