diff options
author | Linus Groh <mail@linusgroh.de> | 2021-12-21 23:08:23 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-12-22 11:27:31 +0100 |
commit | 0c424c4dabfaaa7a1ccd52cae58375ebb6f2fb2e (patch) | |
tree | e03be93709f458b9696e264d247eda6e07b7a573 /Userland/Libraries/LibCrypto/Forward.h | |
parent | 9c209b80793b7717ba5a3973722e0b5941696cfd (diff) | |
download | serenity-0c424c4dabfaaa7a1ccd52cae58375ebb6f2fb2e.zip |
LibCrypto: Add the BigInteger concept
This makes it much easier to write (template) functions that accept
either a signed or unsigned bigint parameter.
Diffstat (limited to 'Userland/Libraries/LibCrypto/Forward.h')
-rw-r--r-- | Userland/Libraries/LibCrypto/Forward.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCrypto/Forward.h b/Userland/Libraries/LibCrypto/Forward.h new file mode 100644 index 0000000000..27d5bfbbfc --- /dev/null +++ b/Userland/Libraries/LibCrypto/Forward.h @@ -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>; + +} |