From 16d685305f1d5c326997a73fcb1028ab34b176e8 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Wed, 27 May 2015 15:25:30 +0900 Subject: [PATCH] add fp.cpp --- src/fp.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/fp.cpp diff --git a/src/fp.cpp b/src/fp.cpp new file mode 100644 index 0000000..6cee526 --- /dev/null +++ b/src/fp.cpp @@ -0,0 +1,50 @@ +#include + +namespace mcl { namespace fp { +//void setOp(mcl::fp::Op& op, const Unit* p, size_t pBitLen) +void setOp(mcl::fp::Op&, const Unit*, size_t) +{ +#if 0 +#ifdef USE_MONT_FP + if (pBitLen <= 128) { op = fp::MontFp::init(p); } +#if CYBOZU_OS_BIT == 32 + else if (pBitLen <= 160) { static fp::MontFp f; op = f.init(p); } +#endif + else if (pBitLen <= 192) { static fp::MontFp f; op = f.init(p); } +#if CYBOZU_OS_BIT == 32 + else if (pBitLen <= 224) { static fp::MontFp f; op = f.init(p); } +#endif + else if (pBitLen <= 256) { static fp::MontFp f; op = f.init(p); } + else if (pBitLen <= 384) { static fp::MontFp f; op = f.init(p); } + else if (pBitLen <= 448) { static fp::MontFp f; op = f.init(p); } +#if CYBOZU_OS_BIT == 32 + else if (pBitLen <= 544) { static fp::MontFp f; op = f.init(p); } +#else + else if (pBitLen <= 576) { static fp::MontFp f; op = f.init(p); } +#endif + else { static fp::MontFp f; op = f.init(p); } +#else + if (pBitLen <= 128) { op = fp::FixedFp::init(p); } +#if CYBOZU_OS_BIT == 32 + else if (pBitLen <= 160) { static fp::FixedFp f; op = f.init(p); } +#endif + else if (pBitLen <= 192) { static fp::FixedFp f; op = f.init(p); } +#if CYBOZU_OS_BIT == 32 + else if (pBitLen <= 224) { static fp::FixedFp f; op = f.init(p); } +#endif + else if (pBitLen <= 256) { static fp::FixedFp f; op = f.init(p); } + else if (pBitLen <= 384) { static fp::FixedFp f; op = f.init(p); } + else if (pBitLen <= 448) { static fp::FixedFp f; op = f.init(p); } +#if CYBOZU_OS_BIT == 32 + else if (pBitLen <= 544) { static fp::FixedFp f; op = f.init(p); } +#else + else if (pBitLen <= 576) { static fp::FixedFp f; op = f.init(p); } +#endif + else { static fp::FixedFp f; op = f.init(p); } +#endif + assert(op.N <= maxUnitN); +#endif +} + +} } // mcl::fp +