Initial commit to seed TPM2.0 source code directory
LICENSE file text copied from TCG library specification. README
describes the procedure used to extract source code from parts 3 and 4
of the specification.
The python scripts and part{34}.txt files will be removed in the
following commits.
Change-Id: Ie281e6e988481831f33483053455e8aff8f3f75f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
diff --git a/SetAlgorithmSet.c b/SetAlgorithmSet.c
new file mode 100644
index 0000000..d167a6b
--- /dev/null
+++ b/SetAlgorithmSet.c
@@ -0,0 +1,30 @@
+// This file was extracted from the TCG Published
+// Trusted Platform Module Library
+// Part 3: Commands
+// Family "2.0"
+// Level 00 Revision 01.16
+// October 30, 2014
+
+#include "InternalRoutines.h"
+#include "SetAlgorithmSet_fp.h"
+TPM_RC
+TPM2_SetAlgorithmSet(
+ SetAlgorithmSet_In *in // IN: input parameter list
+ )
+{
+ TPM_RC result;
+
+ // The command needs NV update. Check if NV is available.
+ // A TPM_RC_NV_UNAVAILABLE or TPM_RC_NV_RATE error may be returned at
+ // this point
+ result = NvIsAvailable();
+ if(result != TPM_RC_SUCCESS) return result;
+
+// Internal Data Update
+ gp.algorithmSet = in->algorithmSet;
+
+ // Write the algorithm set changes to NV
+ NvWriteReserved(NV_ALGORITHM_SET, &gp.algorithmSet);
+
+ return TPM_RC_SUCCESS;
+}