From f8a927984a56e75718bfc273b61693442c9ce649 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Mon, 28 Nov 2016 13:07:37 +0100 Subject: Removed the Bignum abstraction library, as it was not needed. --- libcmix-bignum/bignum.h | 72 ------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 libcmix-bignum/bignum.h (limited to 'libcmix-bignum/bignum.h') diff --git a/libcmix-bignum/bignum.h b/libcmix-bignum/bignum.h deleted file mode 100644 index fe690cc..0000000 --- a/libcmix-bignum/bignum.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * \file - */ - -/*! - * \brief The bignum_error enum - */ -enum bignum_error { - NoError = 0, - error = -1 -}; - -/*! - * \brief cMix internal bignum representation. - */ -struct Bignum { - unsigned char* data; ///< Pointer to the start of the bignum. - size_t len; ///< The length of the data array. -}; - -/*! - * \brief allocate_bignum. Reserves space for a len size Bignum. - * \param len The length of the bignum data array. - * \return The Bignum array just allocated. - */ -inline struct Bignum allocate_bignum(size_t len) { - return (struct Bignum){ - (unsigned char*) malloc(len), - len - }; -} - -/*! - * \brief free_bignum. Counterpart to allocate_bignum. - * \param b The bignum to free - */ -inline void free_bignum(struct Bignum* b) { - free(b->data); - b->data = 0; - b->len = 0; -} - -/*! - * \brief get_curve25519_mod. Conveniance for now, but this returns the mod of curve25519 algorith (2^255-19) - * \param result The bignum to store the modulus in, has to be preallocated. - * \return Error status code based on backend errors. - */ -extern enum bignum_error get_curve25519_mod(struct Bignum* result); - -/*! - * \brief multiply_mod Multiplies 2 bignums module mod and stores the result in result. - * \param result Preallocated Bignum where the result will be stored. - * \param lh Lefthand of Multiplication. - * \param rh Righthand of Multiplaction. - * \param mod The modulus. - * \return Error status code based on backend errors. - */ -extern enum bignum_error multiply_mod(struct Bignum* result, struct Bignum const lh, struct Bignum const rh, struct Bignum const mod); - - -#ifdef __cplusplus -} -#endif \ No newline at end of file -- cgit v1.2.3-70-g09d2