Re-enable non-platform dependent crypto code.
This change re-enables _math__Comp and _math__uComp,
which are platform independent implementations.
BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
CQ-DEPEND=CL:330951
TEST=compilation succeeds
Change-Id: Id28c5c084535ebfcf38d3e28c71c57c8a4804b6f
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/330855
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
diff --git a/Makefile b/Makefile
index 63e720f..6eb8b61 100644
--- a/Makefile
+++ b/Makefile
@@ -193,7 +193,7 @@
SOURCES += Marshal_VerifySignature.c
SOURCES += Marshal_ZGen_2Phase.c
SOURCES += Manufacture.c
-HOST_SOURCES += MathFunctions.c
+SOURCES += MathFunctions.c
SOURCES += MemoryLib.c
SOURCES += NV.c
HOST_SOURCES += NVMem.c
diff --git a/MathFunctions.c b/MathFunctions.c
index 5b52617..0b08aad 100644
--- a/MathFunctions.c
+++ b/MathFunctions.c
@@ -7,6 +7,9 @@
#include <string.h>
+#include "CryptoEngine.h"
+
+#ifndef EMBEDDED_MODE
#include "OsslCryptoEngine.h"
//
//
@@ -325,6 +328,7 @@
BN_CTX_free(context);
return retVal;
}
+#endif // ! EMBEDDED_MODE
//
//
// _math__uComp()
@@ -432,6 +436,7 @@
// CRYPT_PARAMETER number to exponentiate is larger than the modulus
// CRYPT_UNDERFLOW result will not fit into the provided buffer
//
+#ifndef EMBEDDED_MODE
LIB_EXPORT CRYPT_RESULT
_math__ModExp(
UINT32 cSize, // IN: size of the result
@@ -528,3 +533,4 @@
BN_clear_free(p);
return (isPrime == 1);
}
+#endif // ! EMBEDDED_MODE