From 425decdf7e9284d15aa726e3ae96b9942fb0e3ea Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Sun, 16 Feb 2020 03:40:06 +0000 Subject: create tremded branch --- src/qcommon/crypto.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/qcommon/crypto.h (limited to 'src/qcommon/crypto.h') diff --git a/src/qcommon/crypto.h b/src/qcommon/crypto.h new file mode 100644 index 0000000..9b21943 --- /dev/null +++ b/src/qcommon/crypto.h @@ -0,0 +1,45 @@ +/* +=========================================================================== +Copyright (C) 2007-2008 Amanieu d'Antras (amanieu@gmail.com) +Copyright (C) 2015-2016 Jeff Kent (jeff@jkent.net) +Copyright (C) 2015-2019 GrangerHub + +This file is part of Tremulous. + +Tremulous is free software; you can redistribute it +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 3 of the License, +or (at your option) any later version. + +Tremulous is distributed in the hope that it will be +useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Tremulous; if not, see + +=========================================================================== +*/ + +#ifndef __CRYPTO_H__ +#define __CRYPTO_H__ + +#include "nettle/bignum.h" +#include "nettle/buffer.h" +#include "nettle/rsa.h" +#include "nettle/sha2.h" + + +#define RSA_PRIVATE_KEY_FILE "rsa_private_key" +#define RSA_PUBLIC_KEY_FILE "rsa_public_key" + +#define RSA_PUBLIC_EXPONENT 65537 + +#define RSA_KEY_LENGTH 4096 +#define RSA_STRING_LENGTH (RSA_KEY_LENGTH / 4 + 1) + +void Crypto_Init( void ); +void qnettle_random( void *ctx, size_t length, uint8_t *dst ); + +#endif /* __CRYPTO_H__ */ -- cgit