Tests added
Signed-off-by: Pascal Brand <pascal.brand@st.com>
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..96d418c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+cscope.*
+GPATH
+GRTAGS
+GSYMS
+GTAGS
+out/*
+ta/GP_*
+host/xtest/global_platform/
+host/xtest/xtest_7500.c
+host/xtest/xtest_8000.c
+host/xtest/xtest_8500.c
+host/xtest/xtest_9000.c
+package/testsuite/global_platform/api_1.0/TEE*
+scripts/.conf
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f27ced7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+ifneq ($O,)
+ out-dir := $O
+else
+ # If no build folder has been specified, then create all build files in
+ # the current directory under a folder named out.
+ out-dir := $(CURDIR)/out
+endif
+
+ifneq ($V,1)
+ q := @
+else
+ q :=
+endif
+
+.PHONY: all
+all: xtest ta
+
+.PHONY: xtest
+xtest:
+ $(q)$(MAKE) -C host/xtest CROSS_COMPILE="$(CROSS_COMPILE_HOST)" \
+ q=$(q) \
+ O=$(out-dir)/xtest \
+ $@
+
+.PHONY: ta
+ta:
+ $(q)$(MAKE) -C ta CROSS_COMPILE="$(CROSS_COMPILE_TA)" \
+ q=$(q) \
+ O=$(out-dir)/ta \
+ $@
+
+.PHONY: clean
+clean:
+ $(q)$(MAKE) -C host/xtest O=$(out-dir)/xtest q=$(q) $@
+ $(q)$(MAKE) -C ta O=$(out-dir)/ta q=$(q) $@
+
+.PHONY: patch
+patch:
+ifeq ($(CFG_GP_TESTSUITE_ENABLE),y)
+CFG_GP_API?=1.0
+CFG_GP_XSL_PACKAGE_PATH?=$(CFG_DEV_PATH)/optee_test/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM
+patch:
+ $(q) CFG_GP_API=$(CFG_GP_API) CFG_GP_XSL_PACKAGE_PATH=$(CFG_GP_XSL_PACKAGE_PATH) $(CURDIR)/scripts/patch_gp_testsuite.sh
+endif
diff --git a/Notice.md b/Notice.md
new file mode 100755
index 0000000..3f6db72
--- /dev/null
+++ b/Notice.md
@@ -0,0 +1,8 @@
+OP-TEE sanity testsuite
+=======================
+
+This is the OP-TEE (Open Portable Trusted Execution Environment) sanity
+testsuite with initial contributions from STMicroelectronics.
+
+Note this is an early version of the test suite. Further update will
+allow to install all OP-TEE components for a given platform.
diff --git a/host/LICENSE b/host/LICENSE
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/host/LICENSE
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program 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 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/host/lib/armv7/libcrypto.a b/host/lib/armv7/libcrypto.a
new file mode 100644
index 0000000..bfbea7f
--- /dev/null
+++ b/host/lib/armv7/libcrypto.a
Binary files differ
diff --git a/host/lib/armv8/libcrypto.a b/host/lib/armv8/libcrypto.a
new file mode 100644
index 0000000..c9f5236
--- /dev/null
+++ b/host/lib/armv8/libcrypto.a
Binary files differ
diff --git a/host/xtest/.gitignore b/host/xtest/.gitignore
new file mode 100644
index 0000000..2cccfcc
--- /dev/null
+++ b/host/xtest/.gitignore
@@ -0,0 +1,2 @@
+for_gp
+*.orig
diff --git a/host/xtest/Makefile b/host/xtest/Makefile
new file mode 100644
index 0000000..1f6960c
--- /dev/null
+++ b/host/xtest/Makefile
@@ -0,0 +1,130 @@
+# Normally this makefile shouldn't be called directly and we expect the output
+# path to be on a certain location to fit together with the other OP-TEE
+# gits and helper scripts.
+ifeq ($O,)
+$(error output path should be specified when calling this makefile)
+endif
+
+# By default we expect optee_client exported folder to be on a certain relative
+# path, but if the client specifies the OPTEE_CLIENT_EXPORT then that path will
+# be used instead.
+OPTEE_CLIENT_EXPORT ?= ../../../optee_client/out/export
+
+CC := $(CROSS_COMPILE)gcc
+CPP := $(CROSS_COMPILE)cpp
+LD := $(CROSS_COMPILE)ld
+AR := $(CROSS_COMPILE)ar
+NM := $(CROSS_COMPILE)nm
+OBJCOPY := $(CROSS_COMPILE)objcopy
+OBJDUMP := $(CROSS_COMPILE)objdump
+READELF := $(CROSS_COMPILE)readelf
+
+srcs := xtest_1000.c \
+ xtest_4000.c \
+ xtest_5000.c \
+ xtest_6000.c \
+ xtest_7000.c \
+ xtest_10000.c \
+ xtest_helpers.c \
+ xtest_main.c \
+ xtest_test.c \
+ adbg/src/adbg_case.c \
+ adbg/src/adbg_enum.c \
+ adbg/src/adbg_expect.c \
+ adbg/src/adbg_log.c \
+ adbg/src/adbg_mts.c \
+ adbg/src/adbg_run.c \
+ adbg/src/adbg_util.c \
+ adbg/src/r_list_genutil.c \
+ adbg/src/security_utils_hex.c \
+ adbg/src/security_utils_mem.c
+
+ifeq ($(CFG_GP_TESTSUITE_ENABLE), y)
+srcs += xtest_7500.c \
+ xtest_8000.c \
+ xtest_8500.c \
+ xtest_9000.c
+endif
+
+objs := $(patsubst %.c,$(O)/%.o, $(srcs))
+
+CFLAGS += -I./
+CFLAGS += -I./adbg/include
+CFLAGS += -I./xml/include
+
+CFLAGS += -I$(OPTEE_CLIENT_EXPORT)/include
+CFLAGS += -I$(TA_DEV_KIT_DIR)/host_include
+
+CFLAGS += -I../../ta/create_fail_test/include
+CFLAGS += -I../../ta/crypt/include
+CFLAGS += -I../../ta/enc_fs/include
+CFLAGS += -I../../ta/os_test/include
+CFLAGS += -I../../ta/rpc_test/include
+CFLAGS += -I../../ta/sims/include
+CFLAGS += -I../../ta/storage/include
+ifeq ($(CFG_GP_TESTSUITE_ENABLE),y)
+CFLAGS += -I../../ta/GP_TTA_Arithmetical
+CFLAGS += -I../../ta/GP_TTA_Crypto
+CFLAGS += -I../../ta/GP_TTA_DS
+CFLAGS += -I../../ta/GP_TTA_TCF
+CFLAGS += -I../../ta/GP_TTA_TCF_ICA
+CFLAGS += -I../../ta/GP_TTA_TCF_ICA2
+CFLAGS += -I../../ta/GP_TTA_TCF_MultipleInstanceTA
+CFLAGS += -I../../ta/GP_TTA_TCF_SingleInstanceTA
+CFLAGS += -I../../ta/GP_TTA_Time
+CFLAGS += -I../../ta/GP_TTA_answerErrorTo_Invoke
+CFLAGS += -I../../ta/GP_TTA_answerErrorTo_OpenSession
+CFLAGS += -I../../ta/GP_TTA_answerSuccessTo_OpenSession_Invoke
+CFLAGS += -I../../ta/GP_TTA_check_OpenSession_with_4_parameters
+CFLAGS += -I../../ta/GP_TTA_testingClientAPI
+
+# need more include: openssl
+CFLAGS += -Ifor_gp/include
+
+# need more libraries: openssl
+ifneq ($(PLATFORM_FLAVOR),qemu_virt)
+LDFLAGS += for_gp/lib/libcrypto.a
+else
+LDFLAGS += -lcrypto
+endif
+
+# need more flags
+CFLAGS += -DXTEST_WITH_GP_TESTS
+
+endif
+
+# FIXME: Check if and why we need this flag?
+CFLAGS += -DUSER_SPACE
+
+ifneq ($(CFG_GP_TESTSUITE_ENABLE),y)
+CFLAGS += -Wall -Wcast-align -Werror \
+ -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
+ -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
+ -Wmissing-declarations -Wmissing-format-attribute \
+ -Wmissing-include-dirs -Wmissing-noreturn \
+ -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
+ -Wshadow -Wstrict-prototypes -Wswitch-default \
+ -Wwrite-strings \
+ -Wno-missing-field-initializers -Wno-format-zero-length
+endif
+
+LDFLAGS += -L$(OPTEE_CLIENT_EXPORT)/lib -lteec
+LDFLAGS += -lpthread
+
+.PHONY: all
+all: xtest
+
+xtest: $(objs)
+ @echo " LD $(O)/$@"
+ $(q)@$(CC) -o $(O)/$@ $+ $(LDFLAGS)
+
+$(O)/%.o: $(CURDIR)/%.c
+ $(q)mkdir -p $(O)/adbg/src
+ @echo ' CC $<'
+ $(q)$(CC) $(CFLAGS) -c $< -o $@
+
+.PHONY: clean
+clean:
+ @echo ' CLEAN $(O)'
+ $(q)rm -f $(O)/xtest
+ $(q)$(foreach obj,$(objs), rm -f $(obj))
diff --git a/host/xtest/adbg/include/adbg.h b/host/xtest/adbg/include/adbg.h
new file mode 100644
index 0000000..f3fa8ae
--- /dev/null
+++ b/host/xtest/adbg/include/adbg.h
@@ -0,0 +1,464 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef ADBG_H
+#define ADBG_H
+#include <stddef.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define ADBG_STRING_LENGTH_MAX (1024)
+
+typedef struct {
+ size_t ColumnWidth;
+ const char *Text_p;
+} ADBG_LogTable_t;
+
+typedef struct {
+ char Corner;
+ char Vertical;
+ char Horizontal;
+} ADBG_LogTableShapes_t;
+
+
+/* Typedef for function pointers used in the clients handle signal function. */
+typedef uint32_t (ADBG_SignalFunction_t)(uint8_t);
+
+/*
+ * Case definitions
+ */
+
+/**
+ * Defines a test case
+ *
+ * Used in the follwing way for readability:
+ */
+#if 0 /* #if 0 to avoid nested comments */
+ADBG_CASE_DEFINE(TEST_1001, TEST_Test_1001,
+ /* Title */
+ "My test case title",
+ /* Short description */
+ "Verifies that functionality X is working",
+ /* Requirement IDs */
+ "?",
+ /* How to implement */
+ "The function should return OK"
+ );
+#endif
+
+#define ADBG_CASE_DEFINE(TestID, Run, Title, ShortDescription, \
+ RequiredMentIDs, HowToImplement) \
+ const ADBG_Case_Definition_t TestID = {#TestID, Title, Run, \
+ ShortDescription, \
+ RequiredMentIDs, HowToImplement }
+
+#define ADBG_CASE_DECLARE(name) \
+ extern const ADBG_Case_Definition_t name
+
+
+typedef struct ADBG_Case ADBG_Case_t;
+
+
+typedef struct {
+ const char *TestID_p;
+ const char *Title_p;
+ void (*Run_fp)(ADBG_Case_t *ADBG_Case_pp);
+ const char *ShortDescription_p;
+ const char *RequirementIDs_p;
+ const char *HowToImplement_p;
+} ADBG_Case_Definition_t;
+
+typedef struct {
+ const ADBG_Case_Definition_t *CaseDefinition_p;
+ const char *WhyDisabled_p;
+} ADBG_Case_SuiteEntry_t;
+
+typedef struct {
+ void *Data_p;
+} ADBG_SuiteData_t;
+
+typedef struct {
+ const char *SuiteID_p;
+ void (*CleanupSuite_fp)(ADBG_SuiteData_t *SuiteData_p);
+ const ADBG_Case_SuiteEntry_t *SuiteEntries_p;
+} ADBG_Suite_Definition_t;
+
+/*
+ * Suite definitions
+ */
+
+/**
+ * Declares a suite defined in a C-file.
+ */
+#define ADBG_SUITE_DECLARE(Name) \
+ extern const ADBG_Suite_Definition_t ADBG_Suite_ ## Name;
+
+#define ADBG_SUITE_DEFINE_BEGIN(Name, CleanupSuite) \
+ extern const ADBG_Case_SuiteEntry_t ADBG_SuiteEntries_ ## Name[]; \
+ const ADBG_Suite_Definition_t ADBG_Suite_ ## Name = \
+ { #Name, CleanupSuite, ADBG_SuiteEntries_ ## Name }; \
+ const ADBG_Case_SuiteEntry_t ADBG_SuiteEntries_ ## Name[] = {
+/**
+ * Defines a suite entry, this is the name of a case.
+ */
+#define ADBG_SUITE_ENTRY(name, WhyDisabledOrNULL) \
+ { &name, WhyDisabledOrNULL },
+
+#define ADBG_SUITE_DEFINE_END() { NULL, NULL } };
+
+/*************************************************************************
+* 2.3 IDbg table definitions
+*************************************************************************/
+
+typedef struct {
+ const char *Command_p;
+ const char *Help_p;
+} ADBG_HelpTable_t;
+
+#define ADBG_IDBG_TBL_HELP(Command, Help) \
+ { Command, Help },
+
+/*
+ * Enum table definitions
+ */
+
+#define ADBG_ENUM_TABLE_DECLARE(Name) \
+ extern const ADBG_EnumTable_t ADBG_EnumTable_ ## Name[]
+
+#define ADBG_ENUM_TABLE_DEFINE_BEGIN(Name) \
+ const ADBG_EnumTable_t ADBG_EnumTable_ ## Name[] = {
+#define ADBG_ENUM_TABLE_ENTRY(Value) { Value, #Value }
+
+#define ADBG_ENUM_TABLE_DEFINE_END(Name) , { 0, NULL } }
+
+typedef struct {
+ int Value;
+ const char *const Name_p;
+} ADBG_EnumEntry_t;
+
+typedef ADBG_EnumEntry_t ADBG_EnumTable_t;
+
+ADBG_ENUM_TABLE_DECLARE(Boolean);
+
+#define ADBG_ASSERT_STRINGS_EQUAL(Case_p, Str1_p, Str2_p) \
+ Do_ADBG_Assert(Case_p, __FILE__, __LINE__, \
+ Str1_p != NULL && Str2_p != NULL && \
+ strcmp(Str1_p, Str2_p) == 0, \
+ "Assertion \"%s\" == \"%s\" failed", \
+ #Str1_p, #Str2_p)
+
+#define ADBG_ASSERT_EQUAL(Case_p, Buf1_p, Buf2_p, Length) \
+ Do_ADBG_Assert(Case_p, __FILE__, __LINE__, \
+ memcmp(Buf1_p, Buf2_p, Length) == 0, \
+ "Buffer equality of %s and %s Length %d failed", \
+ #Buf1_p, #Buf2_p, Length)
+
+#define ADBG_ASSERT(Case_p, Expression) \
+ Do_ADBG_Assert(Case_p, __FILE__, __LINE__, Expression, \
+ "Assertion %s failed", #Expression)
+
+/**
+ * Explicitly add an error to the test case
+ */
+#define ADBG_ERROR(Case_p) \
+ Do_ADBG_Assert(Case_p, __FILE__, __LINE__, False, \
+ "Excplicitly added error")
+
+
+void Do_ADBG_Assert(ADBG_Case_t *const Case_p, const char *const FileName_p,
+ const int LineNumber, const bool ExpressionOK,
+ const char *const Format_p,
+ ...) __attribute__((__format__(__printf__, 5, 6)));
+
+
+/*
+ * Expect functions/macros
+ */
+
+#define ADBG_EXPECT(Case_p, Expected, Got) \
+ ADBG_EXPECT_ENUM(Case_p, Expected, Got, NULL)
+
+#define ADBG_EXPECT_NOT(Case_p, Expected, Got) \
+ ADBG_EXPECT_NOT_ENUM(Case_p, Expected, Got, NULL)
+
+#define ADBG_EXPECT_ENUM(Case_p, Expected, Got, EnumTable_p) \
+ Do_ADBG_Expect(Case_p, __FILE__, __LINE__, Expected, Got, #Got, \
+ EnumTable_p)
+
+#define ADBG_EXPECT_NOT_ENUM(Case_p, NotExpected, Got, EnumTable_p) \
+ Do_ADBG_ExpectNot(Case_p, __FILE__, __LINE__, \
+ NotExpected, Got, #Got, EnumTable_p)
+
+#define ADBG_EXPECT_REQUEST_STATUS(Case_p, Expected, Got) \
+ ADBG_EXPECT_ENUM(Case_p, Expected, Got, ADBG_EnumTable_RequestStatus)
+
+#define ADBG_EXPECT_REQUEST_STATUS_OK(Case_p, Got) \
+ ADBG_EXPECT_REQUEST_STATUS(Case_p, REQUEST_OK, Got)
+
+#define ADBG_EXPECT_EVENT_STATUS(Case_p, Expected, Got) \
+ ADBG_EXPECT_ENUM(Case_p, Expected, Got, ADBG_EnumTable_EventStatus)
+
+#define ADBG_EXPECT_EVENT_STATUS_OK(Case_p, Got) \
+ ADBG_EXPECT_REQUEST_STATUS(Case_p, GS_EVENT_OK, Got)
+
+#define ADBG_EXPECT_BOOLEAN(Case_p, Expected, Got) \
+ ADBG_EXPECT_ENUM(Case_p, Expected, Got, ADBG_EnumTable_Boolean)
+
+#define ADBG_EXPECT_TRUE(Case_p, Got) \
+ ADBG_EXPECT_ENUM(Case_p, true, Got, ADBG_EnumTable_Boolean)
+
+#define ADBG_EXPECT_EQUAL(Case_p, Buf1_p, Buf2_p, Length) \
+ ADBG_EXPECT(Case_p, 0, memcmp(Buf1_p, Buf2_p, Length))
+
+#define ADBG_EXPECT_BUFFER(Case_p, ExpBuf_p, ExpBufLen, GotBuf_p, GotBufLen) \
+ Do_ADBG_ExpectBuffer(Case_p, __FILE__, __LINE__, \
+ ExpBuf_p, ExpBufLen, #GotBuf_p, GotBuf_p, \
+ #GotBufLen, GotBufLen)
+
+#define ADBG_EXPECT_POINTER(Case_p, Expected, Got) \
+ Do_ADBG_ExpectPointer(Case_p, __FILE__, __LINE__, Expected, Got, #Got)
+
+#define ADBG_EXPECT_NOT_NULL(Case_p, Got) \
+ Do_ADBG_ExpectPointerNotNULL(Case_p, __FILE__, __LINE__, Got, #Got)
+
+#define ADBG_EXPECT_COMPARE_SIGNED(Case_p, Val1, Compar, Val2) \
+ Do_ADBG_ExpectCompareSigned(Case_p, __FILE__, __LINE__, \
+ Val1, Val2, (Val1)Compar( \
+ Val2), #Val1, #Compar, #Val2)
+
+#define ADBG_EXPECT_COMPARE_UNSIGNED(Case_p, Val1, Compar, Val2) \
+ Do_ADBG_ExpectCompareUnsigned(Case_p, __FILE__, __LINE__, \
+ Val1, Val2, (Val1)Compar( \
+ Val2), #Val1, #Compar, #Val2)
+
+#define ADBG_EXPECT_COMPARE_POINTER(Case_p, Val1, Compar, Val2) \
+ Do_ADBG_ExpectComparePointer(Case_p, __FILE__, __LINE__, \
+ Val1, Val2, (Val1)Compar( \
+ Val2), #Val1, #Compar, #Val2)
+
+#define ADBG_REQUIRE(Case_p, Recovery, Expected, Got) {\
+ if (!ADBG_EXPECT(Case_p, Expected, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_ENUM(Case_p, Recovery, Expected, Got, EnumTable_p) {\
+ if (!ADBG_EXPECT_ENUM(Case_p, Expected, Got, EnumTable_p)) \
+ Recovery }
+
+#define ADBG_REQUIRE_REQUEST_STATUS(Case_p, Recovery, Expected, Got) {\
+ if (!ADBG_EXPECT_REQUEST_STATUS(Case_p, Expected, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_REQUEST_STATUS_OK(Case_p, Recovery, Got) {\
+ if (!ADBG_EXPECT_REQUEST_STATUS_OK(Case_p, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_EVENT_STATUS(Case_p, Recovery, Expected, Got) {\
+ if (!ADBG_EXPECT_EVENT_STATUS(Case_p, Expected, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_EVENT_STATUS_OK(Case_p, Recovery, Got) {\
+ if (!ADBG_EXPECT_EVENT_STATUS_OK(Case_p, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_BOOLEAN(Case_p, Recovery, Expected, Got) {\
+ if (!ADBG_EXPECT_BOOLEAN(Case_p, Expected, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_TRUE(Case_p, Recovery, Got) {\
+ if (!ADBG_EXPECT_TRUE(Case_p, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_EQUAL(Case_p, Recovery, Buf1_p, Buf2_p, Length) {\
+ if (!ADBG_EXPECT_EQUAL(Case_p, Buf1_p, Buf2_p, Length)) \
+ Recovery }
+
+#define ADBG_REQUIRE_BUFFER(Case_p, Recovery, ExpBuf_p, ExpBufLen, GotBuf_p, \
+ GotBufLen) {\
+ if (!ADBG_EXPECT_BUFFER(Case_p, ExpBuf_p, ExpBufLen, GotBuf_p, \
+ GotBufLen)) \
+ Recovery }
+
+#define ADBG_REQUIRE_POINTER(Case_p, Recovery, Expected, Got) {\
+ if (!ADBG_EXPECT_POINTER(Case_p, Expected, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_NOT_NULL(Case_p, Recovery, Got) {\
+ if (!ADBG_EXPECT_NOT_NULL(Case_p, Got)) \
+ Recovery }
+
+#define ADBG_REQUIRE_COMPARE_SIGNED(Case_p, Recovery, Val1, Compar, Val2) {\
+ if (!ADBG_EXPECT_COMPARE_SIGNED(Case_p, Val1, Compar, Val2)) \
+ Recovery }
+
+#define ADBG_REQUIRE_COMPARE_UNSIGNED(Case_p, Recovery, Val1, Compar, Val2) {\
+ if (!ADBG_EXPECT_COMPARE_UNSIGNED(Case_p, Val1, Compar, Val2)) \
+ Recovery }
+
+#define ADBG_REQUIRE_COMPARE_POINTER(Case_p, Recovery, Val1, Compar, Val2) {\
+ if (!ADBG_EXPECT_COMPARE_POINTER(Case_p, Val1, Compar, Val2)) \
+ Recovery }
+
+bool Do_ADBG_Expect(ADBG_Case_t *const Case_p, const char *const FileName_p,
+ const int LineNumber, const int Expected, const int Got,
+ const char *const GotVarName_p,
+ const ADBG_EnumTable_t *const EnumTable_p);
+
+bool Do_ADBG_ExpectNot(ADBG_Case_t *const Case_p, const char *const FileName_p,
+ const int LineNumber, const int NotExpected,
+ const int Got, const char *const GotVarName_p,
+ const ADBG_EnumTable_t *const EnumTable_p);
+
+bool Do_ADBG_ExpectBuffer(ADBG_Case_t *const Case_p,
+ const char *const FileName_p, const int LineNumber,
+ const void *const ExpectedBuffer_p,
+ const size_t ExpectedBufferLength,
+ const char *const GotBufferName_p,
+ const void *const GotBuffer_p,
+ const char *const GotBufferLengthName_p,
+ const size_t GotBufferLength);
+
+bool Do_ADBG_ExpectPointer(ADBG_Case_t *const Case_p,
+ const char *const FileName_p, const int LineNumber,
+ const void *Expected_p, const void *Got_p,
+ const char *const GotVarName_p);
+
+bool Do_ADBG_ExpectPointerNotNULL(ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber, const void *Got_p,
+ const char *const GotVarName_p);
+
+bool Do_ADBG_ExpectCompareSigned(ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber, const long Value1,
+ const long Value2, const bool Result,
+ const char *const Value1Str_p,
+ const char *const ComparStr_p,
+ const char *const Value2Str_p);
+
+bool Do_ADBG_ExpectCompareUnsigned(ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const unsigned long Value1,
+ const unsigned long Value2,
+ const bool Result,
+ const char *const Value1Str_p,
+ const char *const ComparStr_p,
+ const char *const Value2Str_p);
+
+bool Do_ADBG_ExpectComparePointer(ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const void *const Value1_p,
+ const void *const Value2_p, const bool Result,
+ const char *const Value1Str_p,
+ const char *const ComparStr_p,
+ const char *const Value2Str_p);
+
+const char *Do_ADBG_GetEnumName(const int Value,
+ const ADBG_EnumTable_t *const EnumTable_p);
+
+/**
+ * Returns the number of accumulated errors in the current
+ * subcase.
+ *
+ * @param Case_p Pointer to the running test case.
+ *
+ * @return The number of accumulated errors
+ */
+size_t Do_ADBG_GetNumberOfErrors(ADBG_Case_t *const Case_p);
+
+/*
+ * Log functions
+ */
+void Do_ADBG_FileSystemLog(const char *CmdBuf_p, const int *ArgIndex_p,
+ int ArgsFound);
+
+void Do_ADBG_StartLog(void);
+
+void Do_ADBG_PrintLog(bool UseNormalPrintf, uint32_t Delay);
+
+void Do_ADBG_DeleteLog(void);
+
+/**
+ * Writes a string to output.
+ * String length max is defined by ADBG_STRING_LENGTH_MAX
+ *
+ * @param Format_p The formatting string as in printf
+ */
+void Do_ADBG_Log(const char *const Format_p, ...)
+__attribute__((__format__(__printf__, 1, 2)));
+
+void Do_ADBG_LogHeading(unsigned Level, const char *const Format_p, ...)
+__attribute__((__format__(__printf__, 2, 3)));
+
+void Do_ADBG_LogText(const char *const Text_p);
+
+void Do_ADBG_LogHelp(const ADBG_HelpTable_t *const HelpTable_p,
+ const size_t HelpTableLength);
+
+void Do_ADBG_LogTable(const ADBG_LogTable_t *const TableRow_p,
+ const size_t NumColumns);
+void Do_ADBG_LogTableLine(const ADBG_LogTable_t *const TableRow_p,
+ const size_t NumColumns);
+
+void Do_ADBG_LogTableShapes(const ADBG_LogTableShapes_t *const Shapes,
+ const ADBG_LogTable_t *const TableRow_p,
+ const size_t NumColumns);
+void Do_ADBG_LogTableShapesLine(const ADBG_LogTableShapes_t *const Shapes,
+ const ADBG_LogTable_t *const TableRow_p,
+ const size_t NumColumns);
+
+/**
+ * Writes out the contents of buf_p formatted so that each line will
+ * have cols number of columns.
+ *
+ * @param[in] Buf_p Buffer to print
+ * @param[in] Size Size of buffer (in bytes)
+ * @param[in] Cols Number of columns.
+ */
+void Do_ADBG_HexLog(const void *const Buf_p, const size_t Size,
+ const size_t Cols);
+
+/*
+ * Suite functions
+ */
+
+/**
+ * Aborts the test suite after the current case has finished.
+ */
+void Do_ADBG_AbortSuite(ADBG_Case_t *const Case_p);
+
+#define ADBG_CASE_ABORT() (return)
+
+
+int Do_ADBG_RunSuite(const ADBG_Suite_Definition_t *Suite_p, int argc,
+ char *argv[]);
+
+void Do_ADBG_MTS_Suite(const ADBG_Suite_Definition_t *Suite_p, int argc,
+ char *argv[]);
+
+ADBG_SuiteData_t *Do_ADBG_GetSuiteData(const ADBG_Case_t *const Case_p);
+
+/*
+ * SubCase functions
+ */
+void Do_ADBG_BeginSubCase(ADBG_Case_t *const Case_p,
+ const char *const FormatTitle_p,
+ ...) __attribute__((__format__(__printf__, 2, 3)));
+
+void Do_ADBG_EndSubCase(ADBG_Case_t *const Case_p,
+ const char *const FormatTitle_p,
+ ...) __attribute__((__format__(__printf__, 2, 3)));
+
+#endif /* ADBG_H */
diff --git a/host/xtest/adbg/src/adbg_case.c b/host/xtest/adbg/src/adbg_case.c
new file mode 100644
index 0000000..3567d2e
--- /dev/null
+++ b/host/xtest/adbg/src/adbg_case.c
@@ -0,0 +1,406 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+* 1. Includes
+*************************************************************************/
+#include "adbg_int.h"
+
+/*************************************************************************
+* 2. Definition of external constants and variables
+*************************************************************************/
+
+/*************************************************************************
+* 3. File scope types, constants and variables
+*************************************************************************/
+
+/*************************************************************************
+* 4. Declaration of file local functions
+*************************************************************************/
+
+/*
+ * Deletes a subcase. Don't call this function before the
+ * subcase is removed from list.
+ */
+static void ADBG_SubCase_Delete(ADBG_SubCase_t *SubCase);
+
+static ADBG_SubCase_t *ADBG_Case_CreateSubCase(ADBG_Case_t *Case_p,
+ const char *const Title_p);
+
+static ADBG_SubCase_t *ADBG_Case_GetParentSubCase(ADBG_Case_t *Case_p,
+ ADBG_SubCase_t *SubCase_p);
+
+static const char *ADBG_Case_GetTestID(ADBG_Case_t *Case_p);
+
+/*************************************************************************
+* 5. Definition of external functions
+*************************************************************************/
+ADBG_Case_t *ADBG_Case_New(
+ const ADBG_Case_SuiteEntry_t *SuiteEntry_p,
+ ADBG_SuiteData_t *SuiteData_p
+ )
+{
+ ADBG_Case_t *Case_p;
+
+ Case_p = HEAP_ALLOC(ADBG_Case_t);
+ if (Case_p == NULL)
+ return NULL;
+
+ memset(Case_p, 0, sizeof(ADBG_Case_t));
+ Case_p->SuiteEntry_p = SuiteEntry_p;
+ Case_p->SuiteData_p = SuiteData_p;
+ return Case_p;
+}
+
+void ADBG_Case_Delete(
+ ADBG_Case_t *Case_p
+ )
+{
+ ADBG_SubCase_Delete(Case_p->FirstSubCase_p);
+ HEAP_FREE(&Case_p);
+}
+
+bool ADBG_Case_SubCaseIsMain(
+ const ADBG_Case_t *const Case_p,
+ const ADBG_SubCase_t *const SubCase_p
+ )
+{
+ IDENTIFIER_NOT_USED(Case_p)
+ return SubCase_p->Parent_p == NULL;
+}
+
+
+void ADBG_Case_IterateSubCase(
+ ADBG_Case_t *Case_p,
+ ADBG_SubCase_Iterator_t *Iterator_p
+ )
+{
+ Iterator_p->Case_p = Case_p;
+ Iterator_p->CurrentSubCase_p = NULL;
+}
+
+ADBG_SubCase_t *ADBG_Case_NextSubCase(
+ ADBG_SubCase_Iterator_t *Iterator_p
+ )
+{
+ ADBG_Case_t *Case_p = Iterator_p->Case_p;
+ ADBG_SubCase_t *SubCase_p = Iterator_p->CurrentSubCase_p;
+
+
+ /*
+ * Traverse the subcases depth first, that is:
+ * 1.1.1.1
+ * 1.1.1.2
+ * 1.1.1
+ * 1.1.2.1
+ * 1.1.2
+ * 1.1
+ * 1.2.1
+ * 1.2
+ * 1
+ */
+ if (SubCase_p == NULL) {
+ /* Find the first leaf */
+ SubCase_p = Case_p->FirstSubCase_p;
+ if (SubCase_p == NULL)
+ goto CleanupReturn;
+
+ while (!TAILQ_EMPTY(&SubCase_p->SubCasesList))
+ SubCase_p = TAILQ_FIRST(&SubCase_p->SubCasesList);
+ goto CleanupReturn;
+ }
+
+ /*
+ * Look for the next leaf belonging to the parent
+ */
+
+ if (SubCase_p->Parent_p == NULL) {
+ /* If parent is NULL this is the top
+ subcase and we're done */
+ SubCase_p = NULL;
+ goto CleanupReturn;
+ }
+
+ if (TAILQ_NEXT(SubCase_p, Link) == NULL) {
+ /* If this is the last subcase of the
+ parent move up to parent */
+ SubCase_p = SubCase_p->Parent_p;
+ goto CleanupReturn;
+ }
+
+ /*
+ * Find next leaf
+ */
+ SubCase_p = TAILQ_NEXT(SubCase_p, Link);
+ while (!TAILQ_EMPTY(&SubCase_p->SubCasesList))
+ SubCase_p = TAILQ_FIRST(&SubCase_p->SubCasesList);
+
+CleanupReturn:
+ Iterator_p->CurrentSubCase_p = SubCase_p;
+ return SubCase_p;
+}
+
+void Do_ADBG_BeginSubCase(
+ ADBG_Case_t *const Case_p,
+ const char *const FormatTitle_p, ...
+ )
+{
+ ADBG_SubCase_t *SubCase_p = NULL;
+
+ if (Case_p == NULL) {
+ Do_ADBG_Log("Do_ADBG_BeginSubCase: NULL Case_p!");
+ return;
+ }
+
+ if (FormatTitle_p == NULL) {
+ Do_ADBG_Log("Do_ADBG_BeginSubCase: NULL FormatTitle_p!");
+ return;
+ }
+
+ va_list ArgList;
+ char Title[80];
+
+ /*lint -save -e718 -e746 -e530 lint doesn't seem to know of va_start */
+ va_start(ArgList, FormatTitle_p);
+ /*lint -restore */
+ (void)ADBG_vsnprintf(Title, sizeof(Title), FormatTitle_p, ArgList);
+ va_end(ArgList);
+
+ SubCase_p = ADBG_Case_CreateSubCase(Case_p, Title);
+
+ if (SubCase_p == NULL) {
+ Do_ADBG_Log("Do_ADBG_BeginSubCase: HEAP_ALLOC failed");
+ return;
+ }
+
+
+ if (ADBG_Case_SubCaseIsMain(Case_p, SubCase_p)) {
+ /* Main SubCase */
+ Do_ADBG_Log(" ");
+ Do_ADBG_Log("* %s %s", SubCase_p->TestID_p, SubCase_p->Title_p);
+ } else {
+ Do_ADBG_Log("o %s %s", SubCase_p->TestID_p, SubCase_p->Title_p);
+ }
+}
+
+void Do_ADBG_EndSubCase(
+ ADBG_Case_t *const Case_p,
+ const char *const FormatTitle_p, ...
+ )
+{
+ va_list ArgList;
+ char Title[80];
+ ADBG_SubCase_t *SubCase_p = NULL;
+
+ if (Case_p == NULL) {
+ Do_ADBG_Log("Do_ADBG_EndSubCase: NULL Case_p!");
+ return;
+ }
+
+ if (FormatTitle_p == NULL) {
+ strcpy(Title, "NULL");
+ } else {
+ /*lint -save -e718 -e746 -e530 lint doesn't
+ seem to know of va_start */
+ va_start(ArgList, FormatTitle_p);
+ /*lint -restore */
+ (void)ADBG_vsnprintf(Title, sizeof(Title), FormatTitle_p,
+ ArgList);
+ va_end(ArgList);
+ }
+
+
+ SubCase_p = Case_p->CurrentSubCase_p;
+
+ if (SubCase_p == NULL) {
+ Do_ADBG_Log("Do_ADBG_EndSubCase: "
+ "Have no active SubCase, bailing out for title \"%s\"",
+ Title);
+ return;
+ }
+
+ if (FormatTitle_p != NULL && strcmp(SubCase_p->Title_p, Title) != 0) {
+ Do_ADBG_Log("Do_ADBG_EndSubCase: "
+ "Active SubCase \"%s\" doesn't match supplied title \"%s\"",
+ SubCase_p->Title_p, Title);
+ return;
+ }
+
+ if (ADBG_Case_SubCaseIsMain(Case_p, SubCase_p)) {
+ if (FormatTitle_p == NULL) {
+ /* To end the main subcase we require
+ a matching title */
+ Do_ADBG_Log("Do_ADBG_EndSubCase: "
+ "The main SubCase \"%s\" doesn't match supplied title \"%s\"",
+ SubCase_p->Title_p, Title);
+ return;
+ }
+ /*
+ * Ending the main subcase
+ * make a complete copy of the aggregated result.
+ */
+ Case_p->Result = SubCase_p->Result;
+ } else {
+ /*
+ * Ending a subcase,
+ * Aggregate results to parent.
+ */
+ ADBG_SubCase_t *Parent_p = SubCase_p->Parent_p;
+
+ Parent_p->Result.NumSubTests += SubCase_p->Result.NumTests +
+ SubCase_p->Result.NumSubTests;
+ Parent_p->Result.NumFailedSubTests +=
+ SubCase_p->Result.NumFailedTests +
+ SubCase_p->Result.
+ NumFailedSubTests;
+ Parent_p->Result.AbortTestSuite =
+ SubCase_p->Result.AbortTestSuite;
+ if (SubCase_p->Result.NumTests > 0 ||
+ SubCase_p->Result.NumSubTests > 0)
+ Parent_p->Result.NumFailedSubCases++;
+ }
+
+ /* Print a summary of the subcase result */
+ if (SubCase_p->Result.NumFailedTests > 0 ||
+ SubCase_p->Result.NumFailedSubTests > 0) {
+ Do_ADBG_Log(" %s FAILED", SubCase_p->TestID_p);
+ } else {
+ Do_ADBG_Log(" %s OK", SubCase_p->TestID_p);
+ }
+
+ /* Update current subcase to be the parent of this subcase */
+ Case_p->CurrentSubCase_p =
+ ADBG_Case_GetParentSubCase(Case_p, SubCase_p);
+}
+
+void Do_ADBG_AbortSuite(
+ ADBG_Case_t *const Case_p
+ )
+{
+ Case_p->Result.AbortTestSuite = true;
+}
+
+ADBG_SuiteData_t *Do_ADBG_GetSuiteData(const ADBG_Case_t *const Case_p)
+{
+ return Case_p->SuiteData_p;
+}
+
+
+
+/*************************************************************************
+* 6. Definition of internal functions
+*************************************************************************/
+static ADBG_SubCase_t *ADBG_Case_CreateSubCase(
+ ADBG_Case_t *Case_p,
+ const char *const Title_p
+ )
+{
+ ADBG_SubCase_t *SubCase_p;
+
+ SubCase_p = HEAP_ALLOC(ADBG_SubCase_t);
+ if (SubCase_p == NULL)
+ goto ErrorReturn;
+
+ memset(SubCase_p, 0, sizeof(ADBG_SubCase_t));
+ TAILQ_INIT(&SubCase_p->SubCasesList);
+
+ SubCase_p->Title_p = SECUTIL_HEAP_STRDUP(Title_p);
+ if (SubCase_p->Title_p == NULL)
+ goto ErrorReturn;
+
+ /* Set parent pointer needed "early" below. */
+ SubCase_p->Parent_p = Case_p->CurrentSubCase_p;
+
+ if (SubCase_p->Parent_p == NULL) {
+ /* Main SubCase */
+ SubCase_p->TestID_p =
+ SECUTIL_HEAP_STRDUP(ADBG_Case_GetTestID(Case_p));
+ if (SubCase_p->TestID_p == NULL)
+ goto ErrorReturn;
+
+ Case_p->FirstSubCase_p = SubCase_p;
+ } else {
+ ADBG_SubCase_t *Parent_p = SubCase_p->Parent_p;
+ char PrefixTitle[80];
+
+ /* Update parent SubCase */
+ Parent_p->Result.NumSubCases++;
+ /*
+ * XXX 081112 EJENWIK
+ * bug in snprintf when passing more
+ * than one argument to snprintf.
+ */
+ (void)ADBG_snprintf(PrefixTitle, sizeof(PrefixTitle),
+ "%s",
+ Parent_p->TestID_p);
+ (void)ADBG_snprintf(PrefixTitle + strlen(PrefixTitle),
+ sizeof(PrefixTitle) - strlen(PrefixTitle),
+ ".%d",
+ Parent_p->Result.NumSubCases);
+ SubCase_p->TestID_p = SECUTIL_HEAP_STRDUP(PrefixTitle);
+ if (SubCase_p->TestID_p == NULL)
+ goto ErrorReturn;
+
+ TAILQ_INSERT_TAIL(&Parent_p->SubCasesList, SubCase_p, Link);
+ }
+
+ Case_p->CurrentSubCase_p = SubCase_p;
+ return SubCase_p;
+
+ErrorReturn:
+ ADBG_SubCase_Delete(SubCase_p);
+ return NULL;
+}
+
+static void ADBG_SubCase_Delete(
+ ADBG_SubCase_t *SubCase_p
+ )
+{
+ if (SubCase_p != NULL) {
+ /*
+ * Note that Util_ListDestroy() checks
+ * if SubCase_p->SubCasesList_p
+ * is NULL.
+ */
+ while (true) {
+ ADBG_SubCase_t *s =
+ TAILQ_FIRST(&SubCase_p->SubCasesList);
+
+ if (s == NULL)
+ break;
+
+ TAILQ_REMOVE(&SubCase_p->SubCasesList, s, Link);
+ ADBG_SubCase_Delete(s);
+ }
+ HEAP_FREE(&SubCase_p->TestID_p);
+ HEAP_FREE(&SubCase_p->Title_p);
+ HEAP_FREE(&SubCase_p);
+ }
+}
+
+ADBG_SubCase_t *ADBG_Case_GetParentSubCase(
+ ADBG_Case_t *Case_p,
+ ADBG_SubCase_t *SubCase_p
+ )
+{
+ IDENTIFIER_NOT_USED(Case_p)
+ IDENTIFIER_NOT_USED(SubCase_p)
+ return SubCase_p->Parent_p;
+}
+
+static const char *ADBG_Case_GetTestID(ADBG_Case_t *Case_p)
+{
+ IDENTIFIER_NOT_USED(Case_p)
+
+ return Case_p->SuiteEntry_p->CaseDefinition_p->TestID_p;
+}
diff --git a/host/xtest/adbg/src/adbg_enum.c b/host/xtest/adbg/src/adbg_enum.c
new file mode 100644
index 0000000..8cb33f9
--- /dev/null
+++ b/host/xtest/adbg/src/adbg_enum.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+* 1. Includes
+*************************************************************************/
+#include "adbg_int.h"
+
+/*************************************************************************
+* 2. Definition of external constants and variables
+*************************************************************************/
+
+
+ADBG_ENUM_TABLE_DEFINE_BEGIN(Boolean)
+ADBG_ENUM_TABLE_ENTRY(false),
+ADBG_ENUM_TABLE_ENTRY(true)
+ADBG_ENUM_TABLE_DEFINE_END(Boolean);
+
+
+/*************************************************************************
+* 3. File scope types, constants and variables
+*************************************************************************/
+
+/*************************************************************************
+* 4. Declaration of file local functions
+*************************************************************************/
+
+/*************************************************************************
+* 5. Definition of external functions
+*************************************************************************/
+const char *Do_ADBG_GetEnumName(
+ const int Value,
+ const ADBG_EnumTable_t *const EnumTable_p
+ )
+{
+ const ADBG_EnumTable_t *Entry_p = EnumTable_p;
+
+ for (; Entry_p->Name_p != NULL; Entry_p++) {
+ if (Entry_p->Value == Value)
+ return Entry_p->Name_p;
+ }
+ return "<unresolvable enum name>";
+}
+
+
+/*************************************************************************
+* 6. Definition of internal functions
+*************************************************************************/
diff --git a/host/xtest/adbg/src/adbg_expect.c b/host/xtest/adbg/src/adbg_expect.c
new file mode 100644
index 0000000..bedfd5d
--- /dev/null
+++ b/host/xtest/adbg/src/adbg_expect.c
@@ -0,0 +1,322 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+ * 1. Includes
+ ************************************************************************/
+#include "adbg_int.h"
+
+/*************************************************************************
+ * 2. Definition of external constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 3. File scope types, constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 4. Declaration of file local functions
+ ************************************************************************/
+
+static bool ADBG_AssertHelper(ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber, const bool ExpressionOK);
+
+static const char *ADBG_GetFileBase(const char *const FileName_p);
+
+/*************************************************************************
+ * 5. Definition of external functions
+ ************************************************************************/
+void Do_ADBG_Assert(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const bool ExpressionOK,
+ const char *const Format_p, ...
+ )
+{
+ char Buffer[ADBG_STRING_LENGTH_MAX];
+ va_list List;
+
+ if (ADBG_AssertHelper(Case_p, FileName_p, LineNumber, ExpressionOK))
+ return;
+
+ /*lint -save -e718 -e746 -e530 lint doesn't seem to know of va_start */
+ va_start(List, Format_p);
+ /*lint -restore */
+ (void)vsnprintf(Buffer, sizeof(Buffer), Format_p, List);
+ va_end(List);
+
+ Do_ADBG_Log("%s:%d: %s",
+ ADBG_GetFileBase(FileName_p), LineNumber, Buffer);
+}
+
+bool Do_ADBG_Expect(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const int Expected,
+ const int Got,
+ const char *const GotVarName_p,
+ const ADBG_EnumTable_t *const EnumTable_p
+ )
+{
+ if (ADBG_AssertHelper(Case_p, FileName_p, LineNumber, Expected == Got))
+ return true;
+
+ if (EnumTable_p != NULL) {
+ Do_ADBG_Log("%s:%d: %s has an unexpected value: 0x%x = %s, "
+ "expected 0x%x = %s",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ GotVarName_p,
+ Got, Do_ADBG_GetEnumName(Got, EnumTable_p),
+ Expected,
+ Do_ADBG_GetEnumName(Expected, EnumTable_p));
+ } else {
+ Do_ADBG_Log(
+ "%s:%d: %s has an unexpected value: 0x%x, expected 0x%x",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ GotVarName_p, Got, Expected);
+ }
+
+ return false;
+}
+
+bool Do_ADBG_ExpectNot(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const int NotExpected,
+ const int Got,
+ const char *const GotVarName_p,
+ const ADBG_EnumTable_t *const EnumTable_p
+ )
+{
+ if (ADBG_AssertHelper(Case_p, FileName_p, LineNumber, NotExpected !=
+ Got))
+ return true;
+
+ if (EnumTable_p != NULL) {
+ Do_ADBG_Log("%s:%d: %s has an unexpected value: 0x%x = %s, "
+ "expected 0x%x = %s",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ GotVarName_p,
+ Got, Do_ADBG_GetEnumName(Got, EnumTable_p),
+ NotExpected,
+ Do_ADBG_GetEnumName(NotExpected, EnumTable_p));
+ } else {
+ Do_ADBG_Log(
+ "%s:%d: %s has an unexpected value: 0x%zu, expected 0x%zu",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ GotVarName_p, (size_t)Got, (size_t)NotExpected);
+ }
+
+ return false;
+}
+
+bool Do_ADBG_ExpectBuffer(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const void *const ExpectedBuffer_p,
+ const size_t ExpectedBufferLength,
+ const char *const GotBufferName_p,
+ const void *const GotBuffer_p,
+ const char *const GotBufferLengthName_p,
+ const size_t GotBufferLength
+ )
+{
+ if (!ADBG_AssertHelper(Case_p, FileName_p, LineNumber,
+ ExpectedBufferLength == GotBufferLength)) {
+ Do_ADBG_Log(
+ "%s:%d: %s has an unexpected value: %zu, expected %zu",
+ ADBG_GetFileBase(
+ FileName_p), LineNumber,
+ GotBufferLengthName_p, GotBufferLength,
+ ExpectedBufferLength);
+ return false;
+ }
+
+ if (!ADBG_AssertHelper(Case_p, FileName_p, LineNumber,
+ memcmp(ExpectedBuffer_p, GotBuffer_p,
+ ExpectedBufferLength) == 0)) {
+ Do_ADBG_Log("%s:%d: %s has an unexpected content:",
+ ADBG_GetFileBase(
+ FileName_p), LineNumber, GotBufferName_p);
+ Do_ADBG_Log("Got");
+ Do_ADBG_HexLog(GotBuffer_p, GotBufferLength, 16);
+ Do_ADBG_Log("Expected");
+ Do_ADBG_HexLog(ExpectedBuffer_p, ExpectedBufferLength, 16);
+ return false;
+ }
+
+ return true;
+}
+
+bool Do_ADBG_ExpectPointer(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const void *Expected_p,
+ const void *Got_p,
+ const char *const GotVarName_p
+ )
+{
+ if (ADBG_AssertHelper(Case_p, FileName_p, LineNumber, Expected_p ==
+ Got_p))
+ return true;
+
+ Do_ADBG_Log("%s:%d: %s has an unexpected value: %p, expected %p",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ GotVarName_p, Got_p, Expected_p);
+
+ return false;
+}
+
+
+
+bool Do_ADBG_ExpectPointerNotNULL(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const void *Got_p,
+ const char *const GotVarName_p
+ )
+{
+ if (ADBG_AssertHelper(Case_p, FileName_p, LineNumber, Got_p != NULL))
+ return true;
+
+ Do_ADBG_Log("%s:%d: %s has an unexpected value: %p, expected not NULL",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ GotVarName_p, Got_p);
+
+ return false;
+}
+
+bool Do_ADBG_ExpectCompareSigned(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const long Value1,
+ const long Value2,
+ const bool Result,
+ const char *const Value1Str_p,
+ const char *const ComparStr_p,
+ const char *const Value2Str_p
+ )
+{
+ if (!ADBG_AssertHelper(Case_p, FileName_p, LineNumber, Result)) {
+ Do_ADBG_Log(
+ "%s:%d: Expression \"%s %s %s\" (%ld %s %ld) is false",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ Value1Str_p, ComparStr_p, Value2Str_p,
+ Value1, ComparStr_p, Value2);
+ }
+ return Result;
+}
+
+bool Do_ADBG_ExpectCompareUnsigned(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const unsigned long Value1,
+ const unsigned long Value2,
+ const bool Result,
+ const char *const Value1Str_p,
+ const char *const ComparStr_p,
+ const char *const Value2Str_p
+ )
+{
+ if (!ADBG_AssertHelper(Case_p, FileName_p, LineNumber, Result)) {
+ Do_ADBG_Log(
+ "%s:%d: Expression \"%s %s %s\" (%lu %s %lu) is false",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ Value1Str_p, ComparStr_p, Value2Str_p,
+ Value1, ComparStr_p, Value2);
+ }
+ return Result;
+}
+
+
+bool Do_ADBG_ExpectComparePointer(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const void *const Value1_p,
+ const void *const Value2_p,
+ const bool Result,
+ const char *const Value1Str_p,
+ const char *const ComparStr_p,
+ const char *const Value2Str_p
+ )
+{
+ if (!ADBG_AssertHelper(Case_p, FileName_p, LineNumber, Result)) {
+ Do_ADBG_Log(
+ "%s:%d: Expression \"%s %s %s\" (%p %s %p) is false",
+ ADBG_GetFileBase(FileName_p), LineNumber,
+ Value1Str_p, ComparStr_p, Value2Str_p,
+ Value1_p, ComparStr_p, Value2_p);
+ }
+ return Result;
+}
+
+
+
+size_t Do_ADBG_GetNumberOfErrors(ADBG_Case_t *const Case_p)
+{
+ return Case_p->CurrentSubCase_p->Result.NumFailedTests;
+}
+
+
+/*************************************************************************
+ * 6. Definitions of internal functions
+ ************************************************************************/
+static bool ADBG_AssertHelper(
+ ADBG_Case_t *const Case_p,
+ const char *const FileName_p,
+ const int LineNumber,
+ const bool ExpressionOK
+ )
+{
+ ADBG_SubCase_t *SubCase_p = Case_p->CurrentSubCase_p;
+
+ IDENTIFIER_NOT_USED(Case_p)
+
+ SubCase_p->Result.NumTests++;
+
+ if (!ExpressionOK) {
+ SubCase_p->Result.NumFailedTests++;
+ if (SubCase_p->Result.FirstFailedRow == 0) {
+ SubCase_p->Result.FirstFailedRow = LineNumber;
+ SubCase_p->Result.FirstFailedFile_p = ADBG_GetFileBase(
+ FileName_p);
+ }
+ }
+
+ return ExpressionOK;
+}
+
+static const char *ADBG_GetFileBase(const char *const FileName_p)
+{
+ const char *Ch_p = FileName_p;
+ const char *Base_p = FileName_p;
+
+ while (*Ch_p != '\0') {
+ if (*Ch_p == '\\')
+ Base_p = Ch_p + 1;
+
+ Ch_p++;
+ }
+
+ return Base_p;
+}
diff --git a/host/xtest/adbg/src/adbg_int.h b/host/xtest/adbg/src/adbg_int.h
new file mode 100644
index 0000000..f9099da
--- /dev/null
+++ b/host/xtest/adbg/src/adbg_int.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef ADBG_INT_H
+#define ADBG_INT_H
+#include <sys/queue.h>
+#include <sys/param.h>
+
+#include <adbg.h>
+
+#include "security_utils_hex.h"
+#include "security_utils_mem.h"
+
+#include <sys/queue.h>
+
+#include <string.h>
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+
+/*************************************************************************
+* 2. Types, constants and external variables
+*************************************************************************/
+
+typedef struct ADBG_Result {
+ int NumTests;
+ int NumFailedTests;
+ int NumSubTests;
+ int NumFailedSubTests;
+ int NumSubCases;
+ int NumFailedSubCases;
+ int FirstFailedRow;
+ char const *FirstFailedFile_p;
+ bool AbortTestSuite;
+ const char *WhySkipped_p;
+} ADBG_Result_t;
+
+TAILQ_HEAD(ADBG_SubCaseHead, ADBG_SubCase);
+typedef struct ADBG_SubCaseHead ADBG_SubCaseHead_t;
+
+typedef struct ADBG_SubCase ADBG_SubCase_t;
+struct ADBG_SubCase {
+ char *TestID_p;
+ char *Title_p;
+ ADBG_Result_t Result;
+ ADBG_SubCase_t *Parent_p; /* The SubCase where this SubCase was added */
+ ADBG_SubCaseHead_t SubCasesList; /* SubCases created in this SubCase*/
+ TAILQ_ENTRY(ADBG_SubCase) Link;
+};
+
+/* Typedefed in t_adbg.h */
+struct ADBG_Case {
+ const ADBG_Case_SuiteEntry_t *SuiteEntry_p;
+
+ ADBG_SubCase_t *CurrentSubCase_p;
+ ADBG_SubCase_t *FirstSubCase_p;
+
+ ADBG_SuiteData_t *SuiteData_p;
+ ADBG_Result_t Result;
+ TAILQ_ENTRY(ADBG_Case) Link;
+};
+
+typedef struct {
+ ADBG_Case_t *Case_p;
+ ADBG_SubCase_t *CurrentSubCase_p;
+} ADBG_SubCase_Iterator_t;
+
+
+/*************************************************************************
+* 3. Functions
+*************************************************************************/
+void *ADBG_ListMemAllocFunction(size_t Length);
+void ADBG_ListMemFreeFunction(void *Memory_p);
+
+bool ADBG_Case_SubCaseIsMain(const ADBG_Case_t *const Case_p,
+ const ADBG_SubCase_t *const SubCase_p);
+
+void ADBG_Case_IterateSubCase(ADBG_Case_t *Case_p,
+ ADBG_SubCase_Iterator_t *Iterator_p);
+
+ADBG_SubCase_t *ADBG_Case_NextSubCase(ADBG_SubCase_Iterator_t *Iterator_p);
+
+ADBG_Case_t *ADBG_Case_New(const ADBG_Case_SuiteEntry_t *SuiteEntry_p,
+ ADBG_SuiteData_t *SuiteData_p);
+
+void ADBG_Case_Delete(ADBG_Case_t *Case_p);
+
+int ADBG_snprintf(char *Buffer_p, size_t BufferSize, const char *Format_p,
+ ...) __attribute__((__format__(__printf__, 3, 4)));
+
+int ADBG_vsnprintf(char *Buffer_p, size_t BufferSize, const char *Format_p,
+ va_list List) __attribute__((__format__(__printf__, 3, 0)));
+
+bool ADBG_TestIDMatches(const char *const TestID_p,
+ const char *const Argument_p);
+
+#define HEAP_ALLOC(x) ((x *)malloc(sizeof(x)))
+#define HEAP_UNTYPED_ALLOC(x) malloc((x))
+#define HEAP_FREE(x) do { if (*(x) != NULL) { free(*(x)); *(x) = NULL; \
+ } } while (0)
+
+#define IDENTIFIER_NOT_USED(x) { if (sizeof(&x)) {} }
+
+#endif /* ADBG_INT_H */
diff --git a/host/xtest/adbg/src/adbg_log.c b/host/xtest/adbg/src/adbg_log.c
new file mode 100644
index 0000000..034d571
--- /dev/null
+++ b/host/xtest/adbg/src/adbg_log.c
@@ -0,0 +1,408 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include "adbg_int.h"
+
+#include <stdlib.h>
+
+#include <ctype.h>
+/*************************************************************************
+ * 2. Definition of external constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 3. File scope types, constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 4. Declaration of file local functions
+ ************************************************************************/
+
+/*************************************************************************
+ * 5. Definition of external functions
+ ************************************************************************/
+
+/******************************************************************************/
+/*! @fn void Do_ADBG_Log( void* This_p, char* Format, ...)
+ * @brief
+ * @param [in] This_p
+ * @param [in] Format
+ * @param [in] ...
+ * @return void
+ */
+/******************************************************************************/
+void Do_ADBG_Log(const char *const Format, ...)
+{
+ va_list ap;
+ char buf[ADBG_STRING_LENGTH_MAX];
+
+ va_start(ap, Format);
+ vsnprintf(buf, sizeof(buf), Format, ap);
+ va_end(ap);
+ printf("%s\n", buf);
+}
+
+void Do_ADBG_LogHeading(unsigned Level, const char *const Format, ...)
+{
+ va_list List;
+ char String[ADBG_STRING_LENGTH_MAX];
+ char UnderLine;
+ char Numbers[10];
+ static int HeadingNumbers[3] = { 0, 0, 0 };
+
+/* lint -save -e718 -e746 -e530 lint doesn't seem to know of va_start */
+ va_start(List, Format);
+/* lint -restore */
+ (void)vsnprintf(String, sizeof(String), Format, List);
+ va_end(List);
+
+ switch (Level) {
+ case 0:
+ UnderLine = '#';
+ HeadingNumbers[0] = HeadingNumbers[1] = HeadingNumbers[2] = 0;
+ Numbers[0] = '\0';
+ break;
+ case 1:
+ UnderLine = '=';
+ HeadingNumbers[0]++;
+ HeadingNumbers[1] = HeadingNumbers[2] = 0;
+ (void)ADBG_snprintf(Numbers, sizeof(Numbers), "%d",
+ HeadingNumbers[0]);
+ break;
+ case 2:
+ UnderLine = '~';
+ HeadingNumbers[1]++;
+ HeadingNumbers[2] = 0;
+#if 0 /* Stupid snprintf bug only taking first argument */
+ (void)ADBG_snprintf(Numbers, sizeof(Numbers), "%d.%d",
+ HeadingNumbers[0], HeadingNumbers[1]);
+#else
+ (void)ADBG_snprintf(Numbers, sizeof(Numbers), "%d.",
+ HeadingNumbers[0]);
+ (void)ADBG_snprintf(Numbers + strlen(Numbers),
+ sizeof(Numbers) - strlen(Numbers),
+ "%d", HeadingNumbers[1]);
+#endif
+ break;
+ case 3:
+ UnderLine = '-';
+ HeadingNumbers[2]++;
+#if 0 /* Stupid snprintf bug only taking first argument */
+ (void)ADBG_snprintf(Numbers, sizeof(Numbers), "%d.%d.%d",
+ HeadingNumbers[0], HeadingNumbers[1],
+ HeadingNumbers[2]);
+#else
+ (void)ADBG_snprintf(Numbers, sizeof(Numbers), "%d.",
+ HeadingNumbers[0]);
+ (void)ADBG_snprintf(Numbers + strlen(Numbers),
+ sizeof(Numbers) - strlen(Numbers),
+ "%d.", HeadingNumbers[1]);
+ (void)ADBG_snprintf(Numbers + strlen(Numbers),
+ sizeof(Numbers) - strlen(Numbers),
+ "%d", HeadingNumbers[2]);
+#endif
+ break;
+ default:
+ UnderLine = '-';
+ Numbers[0] = '\0';
+ }
+
+ Do_ADBG_Log("%-5s %s", Numbers, String);
+
+ if (String[0] != '\0') {
+ size_t n;
+
+ for (n = 0; String[n] != '\0'; n++)
+ String[n] = UnderLine;
+
+ Do_ADBG_Log("%-5s %s", "", String);
+ if (Level == 0)
+ Do_ADBG_Log(" ");
+ }
+}
+
+void Do_ADBG_LogText(const char *const Text_p)
+{
+ static const ADBG_LogTableShapes_t Shapes = { ' ', ' ', ' ' };
+ ADBG_LogTable_t LogTable[2] = { { 3, NULL }, { 74, NULL } };
+
+ LogTable[1].Text_p = Text_p;
+ Do_ADBG_LogTableShapes(&Shapes, LogTable, 2);
+}
+
+void Do_ADBG_LogHelp(
+ const ADBG_HelpTable_t *const HelpTable_p,
+ const size_t HelpTableLength
+ )
+{
+ static const ADBG_LogTableShapes_t Shapes = { ' ', ' ', ' ' };
+ ADBG_LogTable_t Row[2] = { { 20, NULL }, { 50, NULL } };
+ size_t n;
+
+ for (n = 0; n < HelpTableLength; n++) {
+ Row[0].Text_p = HelpTable_p[n].Command_p;
+ Row[1].Text_p = HelpTable_p[n].Help_p;
+ Do_ADBG_LogTableShapes(&Shapes, Row, 2);
+ }
+}
+
+void Do_ADBG_HexLog(
+ const void *const Buf_p,
+ const size_t Size,
+ const size_t Cols
+ )
+{
+ const uint8_t *Data_p = Buf_p;
+ size_t n;
+
+ for (n = 0; n < Size; n += Cols) {
+ char HexBuffer[ADBG_STRING_LENGTH_MAX];
+ char AsciiBuffer[ADBG_STRING_LENGTH_MAX / 3];
+ size_t m, NumCols;
+
+ (void)SecUtil_BufferToHex(Data_p + n, MIN(Cols, Size - n), NULL,
+ HexBuffer, sizeof(HexBuffer));
+ NumCols = MIN(MIN(Cols, Size - n), sizeof(AsciiBuffer) - 1);
+ for (m = 0; m < NumCols; m++) {
+ int ch = Data_p[n + m];
+
+ if (isprint(ch))
+ AsciiBuffer[m] = (char)ch;
+ else
+ AsciiBuffer[m] = '.';
+ }
+ AsciiBuffer[m] = '\0';
+
+ Do_ADBG_Log(" %-*s %s", (int)Cols * 3, HexBuffer, AsciiBuffer);
+ }
+}
+
+void Do_ADBG_LogTable(
+ const ADBG_LogTable_t *const TableRow_p,
+ const size_t NumColumns
+ )
+{
+ const ADBG_LogTableShapes_t Shapes = { '+', '|', '-' };
+
+ Do_ADBG_LogTableShapes(&Shapes, TableRow_p, NumColumns);
+}
+
+void Do_ADBG_LogTableLine(
+ const ADBG_LogTable_t *const TableRow_p,
+ const size_t NumColumns
+ )
+{
+ const ADBG_LogTableShapes_t Shapes = { '+', '|', '-' };
+
+ Do_ADBG_LogTableShapesLine(&Shapes, TableRow_p, NumColumns);
+}
+
+
+void Do_ADBG_LogTableShapes(
+ const ADBG_LogTableShapes_t *const Shapes,
+ const ADBG_LogTable_t *const TableRow_p,
+ const size_t NumColumns
+ )
+{
+ char *Line_p;
+ size_t *LastPos_p;
+ size_t n;
+ size_t TableColumn;
+ size_t LinePosition;
+ size_t LineLength;
+ size_t NumColumnsLeft;
+
+ LineLength = 2; /* Starting and ending '|' */
+ for (n = 0; n < NumColumns; n++)
+ LineLength += TableRow_p[n].ColumnWidth + 1; /* One extra '|' */
+
+ Line_p = HEAP_UNTYPED_ALLOC(LineLength + 1);
+ LastPos_p = HEAP_UNTYPED_ALLOC(sizeof(size_t) * NumColumns);
+ if (Line_p == NULL || LastPos_p == NULL) {
+ Do_ADBG_Log("Do_ADBG_LogTableLine: Memory allocation failed");
+ goto CleanupReturn;
+ }
+ memset(LastPos_p, 0, sizeof(size_t) * NumColumns);
+
+ do {
+ NumColumnsLeft = NumColumns;
+ LinePosition = 0;
+ for (TableColumn = 0; TableColumn < NumColumns; TableColumn++) {
+ const ADBG_LogTable_t *Col_p = TableRow_p + TableColumn;
+ size_t TextLen = 0;
+ size_t ColumnPos;
+
+ if (Col_p->Text_p != NULL)
+ TextLen = strlen(Col_p->Text_p);
+
+ Line_p[LinePosition] = Shapes->Vertical;
+ LinePosition++;
+
+ if (Col_p->ColumnWidth <= 1) {
+ NumColumnsLeft--;
+ continue;
+ }
+
+ Line_p[LinePosition] = ' ';
+ LinePosition++;
+
+ if (Col_p->ColumnWidth <= 2) {
+ NumColumnsLeft--;
+ continue;
+ }
+
+ n = LastPos_p[TableColumn];
+ ColumnPos = 1;
+ while (n < TextLen && ColumnPos < Col_p->ColumnWidth) {
+ size_t WordLength;
+ size_t NewLine = 0;
+
+ /*
+ * We copy one complete word at a time.
+ * If the word is too long
+ * to fit in the column at all
+ * it's broken at the end of the
+ * column.
+ */
+
+ /* Consume leading spaces */
+ while (n < TextLen && Col_p->Text_p[n] == ' ')
+ n++;
+
+ /* Find out the length of the word */
+ WordLength = 0;
+ while ((n + WordLength) < TextLen &&
+ Col_p->Text_p[n + WordLength] != ' ') {
+ if (Col_p->Text_p[n + WordLength] ==
+ '\n') {
+ NewLine = 1;
+ break;
+ }
+ /*
+ * The -1 for ColumnWidth is
+ * to make room for a final space
+ * before the '|'.
+ */
+ if ((ColumnPos + WordLength) >=
+ (Col_p->ColumnWidth - 1)) {
+ if (ColumnPos != 1) {
+ /* Save this word
+ for the next line */
+ WordLength = 0;
+ }
+ break;
+ }
+ WordLength++;
+ }
+
+ /* Copy the word and update the positions */
+ memcpy(Line_p + LinePosition, Col_p->Text_p + n,
+ WordLength);
+ n += WordLength + NewLine;
+ LinePosition += WordLength;
+ ColumnPos += WordLength;
+
+ /* Now output all spaces */
+
+ if (WordLength == 0) {
+ /* The spaces will be added
+ in the outer loop */
+ break;
+ }
+
+ /*
+ * If there's spaces in the text at the
+ * current position
+ * and there's room for one, output one space.
+ * The rest of the spaces are consumed in
+ * the inner loop
+ * above. This will take an additional line if
+ * the spaces
+ * are at the end of the Text_p but you're not
+ * supposed end a Text_p with spaces any way.
+ */
+ if (Col_p->Text_p[n] == ' ' && ColumnPos <
+ Col_p->ColumnWidth) {
+ Line_p[LinePosition] = ' ';
+ LinePosition++;
+ ColumnPos++;
+ n++;
+ }
+ }
+ LastPos_p[TableColumn] = n;
+
+ if (LastPos_p[TableColumn] == TextLen)
+ NumColumnsLeft--;
+
+ /* Output spaces until the end of the column */
+ while (ColumnPos < Col_p->ColumnWidth) {
+ Line_p[LinePosition] = ' ';
+ LinePosition++;
+ ColumnPos++;
+ }
+ }
+
+ Line_p[LinePosition] = Shapes->Vertical;
+ LinePosition++;
+ Line_p[LinePosition] = '\0';
+ Do_ADBG_Log("%s", Line_p);
+ } while (NumColumnsLeft > 0);
+
+CleanupReturn:
+ HEAP_FREE(&Line_p);
+ HEAP_FREE(&LastPos_p);
+}
+
+void Do_ADBG_LogTableShapesLine(
+ const ADBG_LogTableShapes_t *const Shapes,
+ const ADBG_LogTable_t *const TableRow_p,
+ const size_t NumColumns
+ )
+{
+ char *Line_p;
+ size_t n;
+ size_t TableColumn;
+ size_t LinePosition;
+ size_t LineLength;
+
+ LineLength = 2; /* Starting and ending '+' */
+ for (n = 0; n < NumColumns; n++)
+ LineLength += TableRow_p[n].ColumnWidth + 1; /* One extra '+' */
+
+ Line_p = HEAP_UNTYPED_ALLOC(LineLength + 1);
+ if (Line_p == NULL) {
+ Do_ADBG_Log("Do_ADBG_LogTableLine: Memory allocation failed");
+ goto CleanupReturn;
+ }
+
+ LinePosition = 0;
+ for (TableColumn = 0; TableColumn < NumColumns; TableColumn++) {
+ Line_p[LinePosition] = Shapes->Corner;
+ LinePosition++;
+ for (n = 0; n < TableRow_p[TableColumn].ColumnWidth; n++) {
+ Line_p[LinePosition] = Shapes->Horizontal;
+ LinePosition++;
+ }
+ }
+ Line_p[LinePosition] = Shapes->Corner;
+ LinePosition++;
+ Line_p[LinePosition] = '\0';
+ Do_ADBG_Log("%s", Line_p);
+
+CleanupReturn:
+ HEAP_FREE(&Line_p);
+}
+
+/*************************************************************************
+ * 6. Definitions of internal functions
+ ************************************************************************/
diff --git a/host/xtest/adbg/src/adbg_mts.c b/host/xtest/adbg/src/adbg_mts.c
new file mode 100644
index 0000000..029a3a3
--- /dev/null
+++ b/host/xtest/adbg/src/adbg_mts.c
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+ * 1. Includes
+ ************************************************************************/
+#include "adbg_int.h"
+
+/*************************************************************************
+ * 2. Definition of external constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 3. File scope types, constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 4. Declaration of file local functions
+ ************************************************************************/
+
+/*************************************************************************
+ * 5. Definition of external functions
+ ************************************************************************/
+void Do_ADBG_MTS_Suite(
+ const ADBG_Suite_Definition_t *Suite_p,
+ int argc,
+ char *argv[]
+ )
+{
+ const ADBG_Case_Definition_t *CaseDefinition_p;
+ char *Argument_p = NULL;
+ size_t n;
+ ADBG_LogTable_t LogTable[3] = {
+ { 11, NULL }, { 52, NULL }, { 13, NULL } };
+
+ if (argc > 1)
+ Argument_p = argv[1];
+
+ /* Title of MTS */
+ Do_ADBG_LogHeading(0, "%s module test specification",
+ Suite_p->SuiteID_p);
+
+ Do_ADBG_LogHeading(1, "Description of the test cases");
+
+ /* Horizontal line for three columns */
+ Do_ADBG_LogTableLine(LogTable, 3);
+
+ /* Description of each column */
+ LogTable[0].Text_p = "Test CaseID";
+ LogTable[1].Text_p = "Short Description";
+ LogTable[2].Text_p = "Requirement IDs";
+ Do_ADBG_LogTable(LogTable, 3);
+
+ /* Horizontal line for three columns */
+ Do_ADBG_LogTableLine(LogTable, 3);
+
+ for (n = 0; Suite_p->SuiteEntries_p[n].CaseDefinition_p != NULL; n++) {
+ CaseDefinition_p = Suite_p->SuiteEntries_p[n].CaseDefinition_p;
+
+ if (Argument_p != NULL &&
+ !ADBG_TestIDMatches(CaseDefinition_p->TestID_p,
+ Argument_p)) {
+ continue;
+ }
+
+ /* Print the three columns of a test case */
+ LogTable[0].Text_p = CaseDefinition_p->TestID_p;
+ LogTable[1].Text_p = CaseDefinition_p->ShortDescription_p;
+ LogTable[2].Text_p = CaseDefinition_p->RequirementIDs_p;
+ Do_ADBG_LogTable(LogTable, 3);
+
+ /* Horizontal line for three columns */
+ Do_ADBG_LogTableLine(LogTable, 3);
+ }
+
+
+ Do_ADBG_Log(" ");
+ Do_ADBG_LogHeading(1, "Detailed description of each test case");
+
+ for (n = 0; Suite_p->SuiteEntries_p[n].CaseDefinition_p != NULL; n++) {
+ CaseDefinition_p = Suite_p->SuiteEntries_p[n].CaseDefinition_p;
+
+ if (Argument_p != NULL &&
+ !ADBG_TestIDMatches(CaseDefinition_p->TestID_p,
+ Argument_p)) {
+ continue;
+ }
+
+ Do_ADBG_LogHeading(2, "%s %s",
+ CaseDefinition_p->TestID_p,
+ CaseDefinition_p->Title_p);
+ if (Suite_p->SuiteEntries_p[n].WhyDisabled_p != NULL) {
+ Do_ADBG_LogText("This test was disabled because:");
+ Do_ADBG_LogText(
+ Suite_p->SuiteEntries_p[n].WhyDisabled_p);
+ Do_ADBG_Log(" ");
+ }
+ Do_ADBG_LogText("Objective:");
+ Do_ADBG_LogText(CaseDefinition_p->ShortDescription_p);
+ Do_ADBG_Log(" ");
+ Do_ADBG_LogText("Implementation:");
+ Do_ADBG_LogText(CaseDefinition_p->HowToImplement_p);
+ Do_ADBG_Log(" ");
+ }
+}
+
+/*************************************************************************
+ * 6. Definitions of internal functions
+ ************************************************************************/
diff --git a/host/xtest/adbg/src/adbg_run.c b/host/xtest/adbg/src/adbg_run.c
new file mode 100644
index 0000000..5d61639
--- /dev/null
+++ b/host/xtest/adbg/src/adbg_run.c
@@ -0,0 +1,242 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+ * 1. Includes
+ ************************************************************************/
+#include "adbg_int.h"
+
+/*************************************************************************
+ * 2. Definition of external constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 3. File scope types, constants and variables
+ ************************************************************************/
+
+TAILQ_HEAD(ADBG_CaseHead, ADBG_Case);
+typedef struct ADBG_CaseHead ADBG_CaseHead_t;
+
+typedef struct ADBG_Runner {
+ ADBG_Result_t Result;
+ const ADBG_Suite_Definition_t *Suite_p;
+
+ ADBG_SuiteData_t SuiteData;
+ ADBG_CaseHead_t CasesList;
+} ADBG_Runner_t;
+
+/*************************************************************************
+ * 4. Declaration of file local functions
+ ************************************************************************/
+
+static int ADBG_RunSuite(ADBG_Runner_t *Runner_p, int argc, char *argv[]);
+
+
+/*************************************************************************
+ * 5. Definition of external functions
+ ************************************************************************/
+int Do_ADBG_RunSuite(
+ const ADBG_Suite_Definition_t *Suite_p,
+ int argc,
+ char *argv[]
+ )
+{
+ ADBG_Runner_t *Runner_p;
+
+ Runner_p = HEAP_ALLOC(ADBG_Runner_t);
+ if (Runner_p == NULL) {
+ Do_ADBG_Log("HEAP_ALLOC failed for Suite %s!",
+ Suite_p->SuiteID_p);
+ return -1;
+ }
+ memset(Runner_p, 0, sizeof(ADBG_Runner_t));
+ TAILQ_INIT(&Runner_p->CasesList);
+ Runner_p->Suite_p = Suite_p;
+
+ int ret = ADBG_RunSuite(Runner_p, argc, argv);
+ HEAP_FREE(&Runner_p);
+ return ret;
+}
+
+/*************************************************************************
+ * 6. Definitions of internal functions
+ ************************************************************************/
+static int ADBG_RunSuite(
+ ADBG_Runner_t *Runner_p,
+ int argc,
+ char *argv[]
+ )
+{
+ size_t n;
+ ADBG_Case_t *Case_p;
+ size_t NumSkippedTestCases = 0;
+ int failed_test = 0;
+
+ Do_ADBG_Log("######################################################");
+ Do_ADBG_Log("#");
+ Do_ADBG_Log("# %s", Runner_p->Suite_p->SuiteID_p);
+ Do_ADBG_Log("#");
+ Do_ADBG_Log("######################################################");
+
+ for (n = 0;
+ Runner_p->Suite_p->SuiteEntries_p[n].CaseDefinition_p != NULL;
+ n++) {
+ const ADBG_Case_SuiteEntry_t *SuiteEntry_p =
+ &Runner_p->Suite_p->SuiteEntries_p[n];
+ if (argc > 0) {
+ bool HaveMatch = false;
+ int i;
+
+ for (i = 0; i < argc; i++) {
+ if (ADBG_TestIDMatches(SuiteEntry_p->
+ CaseDefinition_p->
+ TestID_p,
+ argv[i])) {
+ HaveMatch = true;
+ break;
+ }
+ }
+ if (!HaveMatch) {
+ NumSkippedTestCases++;
+ continue;
+ }
+ }
+
+ Case_p = ADBG_Case_New(SuiteEntry_p, &Runner_p->SuiteData);
+ if (Case_p == NULL) {
+ Do_ADBG_Log("HEAP_ALLOC failed for Case %s!",
+ SuiteEntry_p->CaseDefinition_p->TestID_p);
+ Runner_p->Result.AbortTestSuite = 1;
+ break;
+ }
+
+ TAILQ_INSERT_TAIL(&Runner_p->CasesList, Case_p, Link);
+
+ /* Start the parent test case */
+ Do_ADBG_BeginSubCase(Case_p, "%s",
+ SuiteEntry_p->CaseDefinition_p->Title_p);
+
+ if (SuiteEntry_p->WhyDisabled_p == NULL) {
+ /* Run case */
+ SuiteEntry_p->CaseDefinition_p->Run_fp(Case_p);
+ } else {
+ NumSkippedTestCases++;
+ }
+
+ /* End abondoned subcases */
+ while (Case_p->CurrentSubCase_p != Case_p->FirstSubCase_p)
+ Do_ADBG_EndSubCase(Case_p, NULL);
+
+ /* End the parent test case */
+ Do_ADBG_EndSubCase(Case_p, "%s",
+ SuiteEntry_p->CaseDefinition_p->Title_p);
+
+ /* Sum up the errors */
+ Case_p->Result.WhySkipped_p = SuiteEntry_p->WhyDisabled_p;
+ Runner_p->Result.NumTests += Case_p->Result.NumTests +
+ Case_p->Result.NumSubTests;
+ Runner_p->Result.NumFailedTests +=
+ Case_p->Result.NumFailedTests +
+ Case_p->Result.
+ NumFailedSubTests;
+ Runner_p->Result.NumSubCases++;
+ if (Case_p->Result.NumFailedTests +
+ Case_p->Result.NumFailedSubTests > 0)
+ Runner_p->Result.NumFailedSubCases++;
+
+ Runner_p->Result.AbortTestSuite = Case_p->Result.AbortTestSuite;
+
+ if (Runner_p->Result.AbortTestSuite) {
+ Do_ADBG_Log("Test suite aborted by %s!",
+ SuiteEntry_p->CaseDefinition_p->TestID_p);
+ break;
+ }
+ }
+
+ if (Runner_p->Suite_p->CleanupSuite_fp != NULL)
+ Runner_p->Suite_p->CleanupSuite_fp(&Runner_p->SuiteData);
+
+ Do_ADBG_Log("+-----------------------------------------------------");
+ if (argc > 0) {
+ int i;
+
+ for (i = 0; i < argc; i++)
+ Do_ADBG_Log(
+ "Result of testsuite %s filtered by \"%s\":",
+ Runner_p->Suite_p->SuiteID_p, argv[i]);
+ } else {
+ Do_ADBG_Log("Result of testsuite %s:",
+ Runner_p->Suite_p->SuiteID_p);
+ }
+
+ TAILQ_FOREACH(Case_p, &Runner_p->CasesList, Link) {
+ ADBG_SubCase_Iterator_t Iterator;
+ ADBG_SubCase_t *SubCase_p;
+
+ ADBG_Case_IterateSubCase(Case_p, &Iterator);
+ while ((SubCase_p = ADBG_Case_NextSubCase(&Iterator)) != NULL) {
+ if (Case_p->Result.WhySkipped_p != NULL) {
+ Do_ADBG_Log("%s SKIPPED: \"%s\"",
+ SubCase_p->TestID_p,
+ Case_p->Result.WhySkipped_p);
+ } else if (SubCase_p->Result.NumFailedTests +
+ SubCase_p->Result.NumFailedSubTests > 0) {
+ if (SubCase_p->Result.FirstFailedFile_p !=
+ NULL) {
+ Do_ADBG_Log(
+ "%s FAILED first error at %s:%d",
+ SubCase_p->TestID_p,
+ SubCase_p->
+ Result.FirstFailedFile_p,
+ SubCase_p->
+ Result.FirstFailedRow);
+ } else {
+ Do_ADBG_Log("%s FAILED",
+ SubCase_p->TestID_p);
+ }
+ } else if (ADBG_Case_SubCaseIsMain(Case_p, SubCase_p)) {
+ /* A level one test case is displayed
+ if successfull too */
+ Do_ADBG_Log("%s OK", SubCase_p->TestID_p);
+ }
+ }
+ }
+
+
+ Do_ADBG_Log("+-----------------------------------------------------");
+ if (Runner_p->Result.AbortTestSuite)
+ Do_ADBG_Log("Test suite was ABORTED");
+
+ Do_ADBG_Log("%d subtest%s of which %d failed",
+ Runner_p->Result.NumTests,
+ Runner_p->Result.NumTests > 1 ? "s" : "",
+ Runner_p->Result.NumFailedTests);
+ Do_ADBG_Log("%d test case%s of which %d failed",
+ Runner_p->Result.NumSubCases,
+ Runner_p->Result.NumSubCases > 1 ? "s" : "",
+ Runner_p->Result.NumFailedSubCases);
+ Do_ADBG_Log("%zu test case%s was skipped",
+ NumSkippedTestCases,
+ NumSkippedTestCases > 1 ? "s" : "");
+
+ failed_test = Runner_p->Result.NumFailedSubCases;
+
+ while (true) {
+ Case_p = TAILQ_FIRST(&Runner_p->CasesList);
+ if (Case_p == NULL)
+ break;
+ TAILQ_REMOVE(&Runner_p->CasesList, Case_p, Link);
+ ADBG_Case_Delete(Case_p);
+ }
+ return failed_test;
+}
diff --git a/host/xtest/adbg/src/adbg_util.c b/host/xtest/adbg/src/adbg_util.c
new file mode 100644
index 0000000..0d29a74
--- /dev/null
+++ b/host/xtest/adbg/src/adbg_util.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+ * 1. Includes
+ ************************************************************************/
+#include "adbg_int.h"
+
+/*************************************************************************
+ * 2. Definition of external constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 3. File scope types, constants and variables
+ ************************************************************************/
+
+/*************************************************************************
+ * 4. Declaration of file local functions
+ ************************************************************************/
+
+/*************************************************************************
+ * 5. Definition of external functions
+ ************************************************************************/
+bool ADBG_TestIDMatches(
+ const char *const TestID_p,
+ const char *const Argument_p
+ )
+{
+ if (Argument_p == NULL)
+ return false;
+
+ return strstr(TestID_p, Argument_p) != NULL;
+}
+
+void *ADBG_ListMemAllocFunction(size_t Length)
+{
+ return HEAP_UNTYPED_ALLOC(Length);
+}
+
+void ADBG_ListMemFreeFunction(void *Memory_p)
+{
+ void *p = Memory_p;
+
+ HEAP_FREE(&p);
+}
+
+int ADBG_snprintf(
+ char *Buffer_p,
+ size_t BufferSize,
+ const char *Format_p,
+ ...
+ )
+{
+ va_list List;
+ int ReturnValue;
+
+ /*lint -save -e718 -e746 -e530 lint doesn't seem to know of va_start */
+ va_start(List, Format_p);
+ /*lint -restore */
+ ReturnValue = ADBG_vsnprintf(Buffer_p, BufferSize, Format_p, List);
+ va_end(List);
+ return ReturnValue;
+}
+
+int ADBG_vsnprintf(
+ char *Buffer_p,
+ size_t BufferSize,
+ const char *Format_p,
+ va_list List
+ )
+{
+ int Length;
+
+ Length = vsnprintf(Buffer_p, BufferSize, Format_p, List);
+
+ /*
+ * The moses version of vsnprintf() doesn't seem to add
+ * a terminating zero to the string if the result is too
+ * large.
+ */
+ if (Buffer_p != NULL && BufferSize > 0)
+ Buffer_p[BufferSize - 1] = '\0';
+
+ return Length;
+}
+
+/*************************************************************************
+ * 6. Definitions of internal functions
+ ************************************************************************/
diff --git a/host/xtest/adbg/src/r_list.h b/host/xtest/adbg/src/r_list.h
new file mode 100644
index 0000000..1f2bafb
--- /dev/null
+++ b/host/xtest/adbg/src/r_list.h
@@ -0,0 +1,1066 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef INCLUSION_GUARD_R_LIST_H
+#define INCLUSION_GUARD_R_LIST_H
+
+/*************************************************************************
+**************************************************************************
+*
+* DESCRIPTION:
+*
+* Header file containing the function prototypes for the doubly linked list
+* function category
+*
+*************************************************************************/
+
+#include <stdbool.h>
+#include "t_list.h"
+
+#define xmalloc malloc
+#define xfree free
+
+
+/** AUTOGEN_SWBP_FUNCTION_NOT_FOUND_IN_REFERENCE_MANUAL */
+bool ListStrComparisonFunc(const void *AnElementKey_p,
+ const void *KeyToMatch_p);
+
+#define Util_ListInsertBefore(a, b, c) \
+ Util_EListInsertBefore((a), (void *)(b), \
+ (c))
+#define Util_ListInsertAfter(a, b, c) \
+ Util_EListInsertAfter((a), (void *)(b), \
+ (c))
+#define Util_ListMatchingKey(a, b) \
+ Util_EListMatchingKey((a), (void *)(b), \
+ ListStrComparisonFunc)
+#define Util_ListCreate() \
+ Util_EListCreate(xmalloc, xfree)
+
+/* These structure are not public. They are included here
+ * to allow for macro
+ * definition (see the macros at the end of the file) */
+
+struct LListItem {
+ struct LListItem *Prev_p;
+ struct LListItem *Next_p;
+ void *Body_p;
+ const void *EKey_p;
+};
+
+struct DL_List {
+ uint16_t NbrOfElements; /* Number of elements
+ in the linked list */
+ ListItem_t *Head_p; /* first item in the list */
+ ListItem_t *Tail_p; /* last item in the list */
+ ListItem_t *Curr_p; /* the "current" item in the list */
+ ListMemAllocFunction_t MemAllocFunc_p; /* pointer to
+ allocator function */
+ ListMemFreeFunction_t MemFreeFunc_p; /* pointer to the
+ memory freeing function */
+ bool ClientHandleStyle; /* True if General Map style
+ is applied */
+ void *ClientHandle_p; /* Store the client handle pointer if
+ callbacks is of ClientHandle style */
+};
+
+/**
+ * This function creates an empty list.
+ *
+ * @param [in] MemAlloc_p Pointer to an allocation function that complies to
+ * the following interface: void* Allocator(size_t Size);
+ * @param [in] MemFree_p Pointer to a de-allocation function that complies to
+ * the following interface: void Free(void* Mem_p);
+ *
+ * @return List_p Pointer to the list, null if unable to create list.
+ *
+ */
+List_t *Util_EListCreate(const ListMemAllocFunction_t MemAlloc_p,
+ const ListMemFreeFunction_t MemFree_p);
+/**
+ * This function creates an empty list with a client handle as input parameter.
+ * This client handle will be an input parameter in all callbacks to the client
+ * functions. For memory allocation and de-allocation is xmalloc and xfree are
+ * automatically selected.
+ *
+ * @param [in] ClientHandle_p Pointer to a client handle used in client callbacks
+ *
+ * @return List_p Pointer to the list, null if unable to create list.
+ *
+ */
+List_t *Util_EListCreateClientHandleStyle(const void *const ClientHandle_p);
+
+/**
+ * This function makes sure that the list pointer is not NULL. If it is, the
+ * function immediately returns LIST_STATUS_INVALID_LIST. Then the function
+ * returns the status of the list pointed to by List_p. The list status
+ * returned is a bit map. The returned value has to be bitwise ANDed with the
+ * status codes listed above in Return Values. See also Util_ListHead(),
+ * Util_ListTail(), Util_ListIsEmpty() and Util_ListOffList().
+ *
+ * @param [in] List_p Pointer to the list whose status will be obtained.
+ *
+ * @retval LIST_STATUS_LIST_EMPTY
+ * @retval LIST_STATUS_NOTHING_TO_REPORT
+ * @retval LIST_STATUS_PTR_OFF_LIST
+ * @retval LIST_STATUS_PTR_TO_TAIL
+ * @retval LIST_STATUS_PTR_TO_HEAD
+ * @retval LIST_STATUS_INVALID_LIST
+ *
+ */
+
+ListStatus_t Util_ListStatus(const List_t *const List_p);
+
+
+/**
+ * This function returns the number of elements in the list pointed to by
+ * List_p.
+ *
+ * @param [in] List_p Pointer to the list whose length will be
+ * obtained.
+ * @param [out] ListLength_p Number of elements in the list.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_INVALID_PARAM
+ *
+ */
+
+ListResult_t Util_ListLength(const List_t *const List_p,
+ uint16_t *const ListLength_p);
+
+
+/**
+ * This function makes sure that the list pointer is not NULL. If it is, the
+ * function immediately returns LIST_STATUS_INVALID_LIST. Then the function
+ * checks whether the list's current pointer for the list pointed to by List_p
+ * points to the tail of the list. If so the function returns
+ * LIST_STATUS_PTR_TO_TAIL, otherwise the function returns
+ * LIST_STATUS_NOTHING_TO_REPORT. See also Util_ListStatus(), Util_ListHead(),
+ * Util_ListIsEmpty() and Util_ListOffList().
+ *
+ * @param [in] List_p Pointer to the list whose current pointer will be
+ * checked against the list's tail.
+ *
+ * @retval LIST_STATUS_NOTHING_TO_REPORT
+ * @retval LIST_STATUS_PTR_TO_TAIL
+ * @retval LIST_STATUS_INVALID_LIST
+ *
+ */
+
+ListStatus_t Util_ListTail(const List_t *const List_p);
+
+
+/**
+ * This function makes sure that the list pointer is not NULL. If it is, the
+ * function immediately returns LIST_STATUS_INVALID_LIST. Then the function
+ * checks whether the list's current pointer for the list pointed to by List_p
+ * is pointing to an element inside the list. If so the function returns
+ * LIST_STATUS_NOTHING_TO_REPORT, otherwise the function returns
+ * LIST_STATUS_PTR_OFF_LIST. See also Util_ListStatus(), Util_ListTail(),
+ * Util_ListHead() and Util_ListIsEmpty().
+ *
+ * @param [in] List_p Pointer to the list whose current pointer is checked for
+ * validity. An invalid pointer is not pointing to an
+ * element inside the list.
+ *
+ * @retval LIST_STATUS_NOTHING_TO_REPORT
+ * @retval LIST_STATUS_PTR_OFF_LIST
+ * @retval LIST_STATUS_INVALID_LIST
+ *
+ */
+
+ListStatus_t Util_ListOffList(const List_t *const List_p);
+
+
+/**
+ * This function makes sure that the list pointer is not NULL. If it is, the
+ * function immediately returns LIST_STATUS_INVALID_LIST. Then the function
+ * checks whether the list's current pointer for the list pointed to by List_p
+ * points to the head of the list. If so the function returns
+ * LIST_STATUS_PTR_TO_HEAD, otherwise the function returns
+ * LIST_STATUS_NOTHING_TO_REPORT. See also Util_ListStatus(), Util_ListTail(),
+ * Util_ListIsEmpty() and Util_ListOffList().
+ *
+ * @param [in] List_p Pointer to the list whose current pointer will be
+ * checked against the list's head.
+ *
+ * @retval LIST_STATUS_NOTHING_TO_REPORT
+ * @retval LIST_STATUS_PTR_TO_HEAD
+ * @retval LIST_STATUS_INVALID_LIST
+ *
+ */
+ListStatus_t Util_ListHead(const List_t *const List_p);
+
+
+/**
+ * This function makes sure that the list pointer is not NULL. If it is, the
+ * function immediately returns LIST_STATUS_INVALID_LIST. Then the function
+ * checks whether the list pointed to by List_p is empty (i.e. created but no
+ * element in the list). If so the function returns LIST_STATUS_LIST_EMPTY,
+ * otherwise the function returns LIST_STATUS_NOTHING_TO_REPORT. See also
+ * Util_ListStatus(), Util_ListTail(), Util_ListHead() and Util_ListOffList().
+ *
+ * @param [in] List_p Pointer to the list to be verified for emptiness.
+ *
+ * @retval LIST_STATUS_NOTHING_TO_REPORT
+ * @retval LIST_STATUS_LIST_EMPTY
+ * @retval LIST_STATUS_INVALID_LIST
+ *
+ */
+ListStatus_t Util_ListIsEmpty(const List_t *const List_p);
+
+
+/**
+ * This function inserts the element pointed to by ElemContent_p before the
+ * element pointed to by the list's current pointer. When the function returns,
+ * the list's current pointer points to the newly added element.
+ *
+ * A key may be used to mark elements in the list. The list can then be
+ * searched using Util_ListMatchingKey() or Util_EListMatchingKey().
+ *
+ * In Util_ListInsertBefore(), the client provided key must be a NULL
+ * terminated string while in Util_EListInsertBefore(), the client provided key
+ * may be of any type.
+ *
+ * Notice that Util_ListInsertBefore() is provided for backward compatibility
+ * reason only. Use of Util_EListInsertBefore() is recommended in new
+ * implementations.
+ *
+ * See also Util_EListInsertAfter(), Util_ListInsertFirst(),
+ * Util_ListInsertLast(), Util_List_Remove(), Util_ListKeyedRemove() and
+ * Util_ListDelete().
+ *
+ * @param [in, out] List_p Pointer to the list in which the element will be
+ * inserted.
+ * @param [in] Key_p Pointer to a client's key. Key_p may be NULL.
+ * @param [in] ElemContent_p Pointer to the element to be inserted in the
+ * list.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_COULD_NOT_ALLOC_MEM
+ *
+ */
+
+ListResult_t Util_EListInsertBefore(List_t *const List_p,
+ const void *const Key_p,
+ void *const ElemContent_p);
+
+
+/**
+ * This function Util_ListInsertFirst() inserts the element pointed to by
+ * ElemContent_p at the head of the list. The
+ * list's current pointer remains unchanged.
+ *
+ * A key may be used to mark elements in the list. The list can then be
+ * searched using Util_ListMatchingKey() or Util_EListMatchingKey().
+ *
+ * See also Util_ListInsertAfter(), Util_EListInsertAfter(),
+ * Util_ListInsertLast(), Util_List_Remove(),
+ * Util_ListKeyedRemove() and Util_ListDelete().
+ *
+ * @param [in, out] List_p Pointer to the list in which the element will be
+ * inserted.
+ * @param [in] Key_p Pointer to a client's key. Key_p may be NULL.
+ * @param [in] ElemContent_p Pointer to the element to be inserted in the
+ * list.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_COULD_NOT_ALLOC_MEM
+ *
+ */
+ListResult_t Util_ListInsertFirst(List_t *const List_p, const void *const Key_p,
+ void *const ElemContent_p);
+
+
+/**
+ * This function inserts the element pointed to by ElemContent_p after the
+ * element pointed to by the list's current pointer. When the function returns,
+ * the list's current pointer points to the newly added element.
+ *
+ * A key may be used to mark elements in the list. The list can then be
+ * searched using Util_ListMatchingKey() or Util_EListMatchingKey().
+ *
+ * In Util_ListInsertAfter(), the client provided key must be a NULL terminated
+ * string while in Util_EListInsertAfter(), the client provided key may be of
+ * any type.
+ *
+ * Notice that Util_ListInsertAfter() is provided for backward compatibility
+ * reason only. Use of Util_EListInsertAfter() is recommended in new
+ * implementations.
+ *
+ * See also Util_EListInsertBefore(), Util_ListInsertFirst(),
+ * Util_ListInsertLast(), Util_List_Remove(), Util_ListKeyedRemove() and
+ * Util_ListDelete().
+ *
+ * @param [in, out] List_p Pointer to the list in which the element will be
+ * inserted.
+ * @param [in] Key_p Pointer to a client's key. Key_p must point to a
+ * NULL terminated string. Key_p may be NULL.
+ * @param [in] ElemContent_p Pointer to the element to be inserted in the
+ * list.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_COULD_NOT_ALLOC_MEM
+ *
+ */
+
+ListResult_t Util_EListInsertAfter(List_t *const List_p,
+ const void *const Key_p,
+ void *const ElemContent_p);
+
+
+/**
+ * This function Util_ListInsertLast()
+ * inserts the element pointed to by ElemContent_p at the tail of the list. The
+ * list's current pointer remains unchanged.
+ *
+ * A key may be used to mark elements in the list. The list can then be
+ * searched using Util_ListMatchingKey() or Util_EListMatchingKey().
+ *
+ * See also Util_ListInsertAfter(), Util_EListInsertAfter(),
+ * Util_ListInsertFirst(), Util_List_Remove(),
+ * Util_ListKeyedRemove() and Util_ListDelete().
+ *
+ * @param [in, out] List_p Pointer to the list in which the element will be
+ * inserted.
+ * @param [in] Key_p Pointer to a client's key. Key_p may be NULL.
+ * @param [in] ElemContent_p Pointer to the element to be inserted in the
+ * list.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_COULD_NOT_ALLOC_MEM
+ *
+ */
+ListResult_t Util_ListInsertLast(List_t *const List_p, const void *const Key_p,
+ void *const ElemContent_p);
+
+
+/**
+ * This function scans the list pointed to by List_p starting from the list's
+ * current pointer. Once the tail of the list has been searched, if an element
+ * has still not been found, the search resumes from the head of the list. The
+ * first element whose key matches the key pointed to by Key_p is removed.
+ *
+ * If a match is found, the list's current pointer will point to the element
+ * after the one removed. If the element removed is the tail of the list, the
+ * list's current pointer will point to the tail. When the last element is
+ * removed, the current pointer is set to NULL. If no match is found, the list
+ * is left unchanged.
+ *
+ * If the matching function is NULL, Util_ListKeyedRemove() will perform an
+ * integer comparison. Otherwise, the client provided routine will be used to
+ * compare keys.
+ *
+ * See also Util_EListInsertAfter(),
+ * Util_EListInsertBefore (), Util_ListInsertFirst(), Util_ListInsertLast(),
+ * Util_List_Remove() and Util_ListDelete().
+ *
+ * @param [in, out] List_p Pointer to the list to be searched and from
+ * which the found element will be removed
+ * @param [in] Key_p Pointer to the key that identifies the
+ * element to be removed.
+ * @param [in] KeyMatchingFunc_p Client function that knows how to compare
+ * keys of the client specific key data type.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_PARAM
+ * @retval LIST_ERROR_NO_MATCH_FOUND
+ *
+ */
+
+ListResult_t Util_ListKeyedRemove(List_t *const List_p,
+ const void *const Key_p,
+ const ListKeyMatchingFunction_t KeyMatchingFunc_p);
+
+/**
+ * This function scans the list pointed to by List_p starting from the list's
+ * current pointer. Once the tail of the list has been searched, if a matching
+ * element has still not been found, the search resumes from the head of the
+ * list.
+ *
+ * The first element whose key matches the key pointed to by Key_p is returned.
+ * Notice that if more than one element in the list match the specified key,
+ * only the first one (from and including the element at the current pointer)
+ * is returned. If more matching elements are desired, the client must
+ * increment the current pointer (using Util_ListNext() or Util_ListIsNext())
+ * and call the matching function again (Util_EListMatchingKey() or
+ * Util_ListMatchingKey).
+ *
+ * If no element in the list matches or if invalid parameters are specified,
+ * the function returns NULL.
+ *
+ * Note that for Util_ListMatchingKey, the key matching function is a string
+ * comparison and is case sensitive. The string matching only matches the
+ * characters in Key_p (e.g. key_p = "Blue" will match "BlueSky" and "Blue
+ * Color" but not "blueSky" or "Blu").
+ *
+ * In Util_EListMatchingKey, KeyMatchingFunc_p is a client specific comparison
+ * function. If NULL is specified, an integer comparison (i.e. the element
+ * pointed to by Key_p is assumed to be a signed integer) will be performed by
+ * default. If KeyMatchingFunc_p is not NULL, the client specific comparison
+ * function will be used to match the Key_p.
+ *
+ * @param [in, out] List_p Pointer to the list to be searched.
+ * @param [in] Key_p Pointer to a client's key. In Util_ListMatchingKey(),
+ * Key_p must point to a NULL terminated string. In
+ * Util_EListMatchingKey(), Key_p points to a key for which
+ * the type is not known to the list library.
+ * @param [in] KeyMatchingFunc_p The client's function to be used to compare keys
+ *
+ * @return void* Address of the element whose key has matched Key_p. NULL if no
+ * match has been found or if the list is invalid. The current pointer
+ * into the list points to the element returned or is not changed if
+ * the function returns NULL.
+ *
+ */
+
+void *Util_EListMatchingKey(List_t *const List_p, const void *const Key_p,
+ const ListKeyMatchingFunction_t KeyMatchingFunc_p);
+
+/**
+ * This function is similar to Util_EListMatchingKey except that the the comparison
+ * function follows the General Map ClientHandle style with client handle as a
+ * parameter in the callback.
+ * @param [in, out] List_p Pointer to the list to be searched.
+ * @param [in] Key_p Pointer to a client's key. In Util_ListMatchingKey(),
+ * Key_p must point to a NULL terminated string. In
+ * Util_EListMatchingKey(), Key_p points to a key for which
+ * the type is not known to the list library.
+ * @param [in] KeyMatchingFunc The client's function to be used to compare keys with
+ * general map ClientHandle style.
+ *
+ * @return void* Address of the element whose key has matched Key_p. NULL if no
+ * match has been found or if the list is invalid. The current pointer
+ * into the list points to the element returned or is not changed if
+ * the function returns NULL.
+ *
+ */
+void *Util_EListMatchingKeyClientHandleStyle(List_t *const List_p,
+ const void *const Key_p,
+ const ListKeyMatchingFunctionClientHandleStyle_t KeyMatchingFunc);
+
+/**
+ * This function scans the list pointed to by List_p starting from the list's
+ * current pointer. Once the tail of the list has been searched, if an element
+ * has still not been found, the search resumes from the head of the list. The
+ * position in the list of the first element whose key matches the key pointed
+ * to by Key_p is returned. The position is counted from the head to the tail
+ * starting at position 1 for the head.
+ *
+ * If a match is found, the list's current pointer will point to the matched
+ * element. If no match is found, the list is left unchanged.
+ *
+ * If the matching function is NULL, Util_ListKeyedIndex() will perform an
+ * integer comparison. Otherwise, the client provided routine will be used to
+ * compare keys.
+ *
+ * See also Util_ListCurrIndex().
+ *
+ * @param [in, out] List_p Pointer to the list to be searched and from
+ * which the index to the matched element will be
+ * returned.
+ * @param [in] Key_p Pointer to the key that identifies the
+ * element for which the index will be returned.
+ * @param [in] KeyMatchingFunc_p Client function that knows how to compare
+ * keys of the client specific key data type.
+ *
+ * @return int Position of the element found in the list or -1 if the element
+ * could not be found (because the specified key is not found or
+ * input parameters are invalid).
+ */
+
+int Util_ListKeyedIndex(List_t *const List_p, const void *const Key_p,
+ const ListKeyMatchingFunction_t KeyMatchingFunc_p);
+
+
+/**
+ * This function returns the index of the list's current element or -1 if the
+ * current element is not valid. The index of the element at the head of the
+ * list is 1.
+ *
+ * See also Util_ListKeyedIndex().
+ *
+ * @param [in] List_p Pointer to the list from which the index to the current
+ * element will be returned.
+ *
+ * @return int Position of the element pointed to by the list's current pointer
+ * or -1 if the list's current pointer is NULL or
+ * input parameters are invalid).
+ */
+int Util_ListCurrIndex(const List_t *const List_p);
+
+
+/**
+ * This function relinks the elements from index First to Last inclusively
+ * after the element at position "To". After the function has executed
+ * successfully, the element at index First will appear directly after the
+ * element at index To. "To" may not be between First and Last but may be
+ * smaller than First or larger than Last. After successful completion, the
+ * list's current pointer is reset (see Util_ListResetCurr()).
+ *
+ * @param [in, out] List_p Pointer to the list in which a range of elements will be
+ * moved.
+ * @param [in] First The position of the first element to be relinked.
+ * @param [in] Last The position of the last element to be relinked.
+ * First and Last Indices defines the range of elements to move.
+ * The range includes First and Last elements. Last must be
+ * greater or equal to First. Notice that these are not
+ * const because the function uses these variables
+ * internally and changes their values. This is done to
+ * avoid defining extra local variables and initialising
+ * them with input parameters.
+ * @param [in] To The index of the element in the list AFTER which the
+ * range of elements from First to Last will be linked.
+ * Notice that this is not a const because the function uses
+ * this variable internally and changes its value. This is
+ * done to avoid defining an extra local variable and
+ * initialising it with the input parameter.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_PARAM
+ *
+ */
+
+ListResult_t Util_ListMoveSubrange(List_t *const List_p, uint16_t First,
+ uint16_t Last, uint16_t To);
+
+/**
+ * This function removes the elements from index First to index Last
+ * inclusively from FromList_p and links them to the tail of the list pointed
+ * to by ToList_p.
+ *
+ * The list current pointer is reset in both FromList_p and ToList_p.
+ *
+ * @param [in, out] List_p Pointer to the list from which a range of elements
+ * will be removed.
+ * @param [in] First The position of the first element to be relinked.
+ * @param [in] Last The position of the last element to be relinked.
+ * First and Last Indices defines the range of elements to move.
+ * The range includes First and Last elements. Last must be
+ * greater or equal to First. Notice that these are not
+ * const because the function uses these variables
+ * internally and changes their values. This is done to
+ * avoid defining extra local variables and initialising
+ * them with input parameters.
+ * @param [in, out] ToList_p The list where the range of elements from List_p will
+ * be linked.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_PARAM
+ *
+ */
+
+ListResult_t Util_ListGetSubrange(List_t *const FromList_p, uint16_t First,
+ uint16_t Last, List_t *const ToList_p);
+
+/**
+ * This function sets the list's current pointer to NULL.
+ *
+ * It is typically used to prepare the list before an iteration through the
+ * list using Util_ListIsNext() or Util_ListIsPrev(). Util_ListIsNext() is
+ * used to start iterating from the head and Util_ListIsPrev() is used to start
+ * iterating from the tail.
+ *
+ * @param [in, out] List_p Pointer to the list whose current element pointer will
+ * be reset.
+ *
+ * @return TRUE if the list's current pointer can be reset.
+ * Otherwise, it returns FALSE (i.e. if the list is empty)
+ */
+
+bool Util_ListResetCurr(List_t *const List_p);
+
+
+/**
+ * This function moves the list's current pointer to the tail of the list. It
+ * returns the pointer to the element at the tail of the list or NULL if the
+ * list is empty.
+ *
+ * See also Util_ListNext(), Util_ListPrev(), Util_ListGotoHead(),
+ * Util_ListGotoIth() and Util_ListCurr().
+ *
+ * @param [in, out] List_p Pointer to the list whose current pointer will be moved.
+ *
+ * @return void* Address of the tail element. NULL if list empty.
+ */
+void *Util_ListGotoTail(List_t *const List_p);
+
+/**
+ * This function moves the list's current pointer to the head of the list. It
+ * returns the pointer to the element at the head of the list or NULL if the
+ * list is empty.
+ *
+ * See also Util_ListNext(), Util_ListPrev(), Util_ListGotoTail(),
+ * Util_ListGotoIth() and Util_ListCurr().
+ *
+ * @param [in, out] List_p Pointer to the list whose current pointer will be moved.
+ *
+ * @return void* Address of the head element. NULL if list empty.
+ */
+
+void *Util_ListGotoHead(List_t *const List_p);
+
+
+/**
+ * This function moves the list's current pointer to the i:th element of the
+ * list. The head of the list is element 1, the next one is element 2 and so
+ * on. It returns the pointer to the element or NULL if the list does not
+ * contain at least i element(s).
+ *
+ * See also Util_ListNext(), Util_ListPrev(), Util_ListGotoHead(),
+ * Util_ListGotoTail() and Util_ListCurr().
+ *
+ * @param [in, out] List_p Pointer to the list whose current pointer will be moved.
+ * @param [in] i The element rank in the list. The head of the list is
+ * element 1, the next one is element 2 and so on.
+ *
+ * @return void* Address of the current element. NULL if list empty
+ * or not long enough.
+ */
+
+void *Util_ListGotoIth(List_t *const List_p, uint16_t i);
+
+/**
+ * This function returns the pointer to the element pointed to by the list's
+ * current pointer or NULL if the current pointer points outside the list.
+ *
+ * See also Util_ListNext(), Util_ListPrev(), Util_ListGotoHead(),
+ * Util_ListGotoTail() and Util_ListGotoIth().
+ *
+ * @param [in] List_p Pointer to the list whose element pointed to by the
+ * list's current pointer will be returned
+ *
+ * @return void* The address of the contents of the current element, null
+ * if there is no current element.
+ */
+void *Util_ListCurr(const List_t *const List_p);
+
+
+/**
+ * This function advances the list's current pointer by one element towards the
+ * tail of the list. It returns the pointer to the element or NULL if the
+ * current pointer pointed to the tail of the list prior to the call.
+ *
+ * If the current pointer is NULL prior to the call and the list is not empty,
+ * the current pointer will point to the head of the list.
+ *
+ * See also Util_ListPrev(), Util_ListGotoHead(), Util_ListGotoTail(),
+ * Util_ListGotoIth(), Util_ListCurr() and Util_ListIsNext().
+ *
+ * @param [in, out] List_p Pointer to the list whose current pointer will be moved.
+ *
+ * @return void* The address of the contents of the next element, NULL
+ * if there is no next element or list is empty.
+ */
+void *Util_ListNext(List_t *const List_p);
+
+
+/**
+ * This function advances the list's current pointer by one element towards the
+ * tail of the list.
+ *
+ * If the current pointer is NULL prior to the call and the list is not empty,
+ * the current pointer will point to the head of the list.
+ *
+ * The function returns TRUE if the current pointer has been stepped, otherwise
+ * it returns FALSE.
+ *
+ * See also Util_ListResetCurr(), Util_ListIsPrev() and Util_ListNext().
+ *
+ * @param [in, out] List_p Pointer to the list whose current pointer will be moved.
+ *
+ * @return TRUE if the current list pointer was not already at the tail before
+ * call. Otherwise, it returns FALSE (e.g. if the list is empty)
+ *
+ */
+bool Util_ListIsNext(List_t *const List_p);
+
+
+/**
+ * This function moves the list's current pointer by one element towards the
+ * head of the list. It returns the pointer to the element or NULL if the
+ * current pointer pointed to the head of the list prior to the call.
+ *
+ * If the current pointer is NULL prior to the call and the list is not empty,
+ * the current pointer will point to the tail of the list.
+ *
+ * See also Util_ListNext(), Util_ListGotoHead(), Util_ListGotoTail(),
+ * Util_ListGotoIth(), Util_ListCurr() and Util_ListIsPrev().
+ *
+ * @param [in, out] List_p Pointer to the list whose current pointer will be moved.
+ *
+ * @return void* The address of the contents of the previous element, NULL
+ * if there is no prev element or list is empty.
+ *
+ */
+void *Util_ListPrev(List_t *const List_p);
+
+
+
+/**
+ * This function advances the list's current pointer by one element towards the
+ * head of the list.
+ *
+ * If the current pointer is NULL prior to the call and the list is not empty,
+ * the current pointer will point to the tail of the list.
+ *
+ * The function returns TRUE if the current pointer has been stepped, otherwise
+ * it returns FALSE.
+ *
+ * See also Util_ListResetCurr(), Util_ListIsNext() and Util_ListPrev().
+ *
+ * @param [in, out] List_p Pointer to the list whose current pointer will be moved.
+ *
+ * @return TRUE if the current pointer has been stepped, otherwise
+ * it returns FALSE.
+ */
+
+bool Util_ListIsPrev(List_t *const List_p);
+
+
+/**
+ * This function removes the element pointed to by the list's current pointer
+ * from the list. After the function has completed, the list's current pointer
+ * will point to the next element or the previous element if the list's tail is
+ * removed. The current pointer will be NULL after the last element in the list
+ * has been removed.
+ *
+ * See also Util_ListDelete(), Util_ListKeyedRemove(),
+ * Util_ListInsertAfter(),
+ * Util_EListInsertAfter, Util_ListInsertFirst(),
+ * Util_ListInsertLast(), Util_EListInsertBefore() and
+ * Util_ListInsertBefore().
+ *
+ * @param [in, out] List_p Pointer to the list from which the element pointed to by
+ * the list's current pointer will be removed.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_CURRENT_PTR_OFF_LIST
+ *
+ */
+
+ListResult_t Util_ListRemove(List_t *const List_p);
+
+
+/**
+ * This function deletes the element pointed to by the list's current pointer
+ * from the list. If DelFunc is not NULL, the client's delete function will
+ * be called prior to removing the current element from the list. If DelFunc
+ * is NULL, the element is not freed.
+ *
+ * See also Util_ListRemove(), Util_ListInsertAfter(), Util_EListInsertBefore()
+ * and Util_ListInsertBefore().
+ *
+ * @param [in, out] List_p Pointer to the list whose status will be obtained.
+ * @param [in] DelFunc Function provided by client that knows how to
+ * deallocate the resources associated with the element
+ * to be deleted. NULL indicates that the client does not
+ * require the element's resources to be deallocated
+ * within the Util_ListDelete() function.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_CURRENT_PTR_OFF_LIST
+ *
+ */
+
+ListResult_t Util_ListDelete(List_t *const List_p,
+ const ListDeleteFunction_t DelFunc);
+/**
+ * This function deletes the element pointed to by the list's current pointer
+ * from the list. If DelFunc_p is not NULL, the client's delete function will
+ * be called prior to removing the current element from the list. If DelFunc
+ * is NULL, the element is not freed.
+ *
+ * See also Util_ListRemove(), Util_ListInsertAfter(), Util_EListInsertBefore()
+ * and Util_ListInsertBefore().
+ *
+ * @param [in, out] List_p Pointer to the list whose status will be obtained.
+ * @param [in] DelFunc Function provided by client that knows how to
+ * deallocate the resources associated with the element
+ * to be deleted. NULL indicates that the client does not
+ * require the element's resources to be deallocated
+ * within the Util_ListDelete() function. The DelFunc should
+ * be of type ListDeleteFunctionGeneralMap_t (see t_list.h) and
+ * is slightly different from the one used in Util_ListDelete.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_CURRENT_PTR_OFF_LIST
+ *
+ */
+
+ListResult_t Util_ListDeleteGeneralMap(List_t *const List_p,
+ const ListDeleteFunctionGeneralMap_t DelFunc);
+
+/**
+ * This function deletes the element pointed to by the list's current pointer
+ * from the list. If DelFunc is not NULL, the client's delete function will
+ * be called prior to removing the current element from the list. If DelFunc
+ * is NULL, the element is not freed. This function is slightly
+ * different from above
+ * Util_ListDeleteGeneralMap. Support for Client Handle is added in the
+ * callback function.
+ *
+ * See also Util_ListRemove(), Util_ListInsertAfter(), Util_EListInsertBefore()
+ * and Util_ListInsertBefore().
+ *
+ * @param [in, out] List_p Pointer to the list whose status will be obtained.
+ * @param [in] DelFunc Function provided by client that knows how to
+ * deallocate the resources associated with the element
+ * to be deleted. NULL indicates that the client does not
+ * require the element's resources to be deallocated
+ * within the Util_ListDelete() function. The DelFunc should
+ * be of type ListDeleteFunctionGeneralMapClientHandleStyle_t
+ * (see t_list.h) and is slightly different from the one
+ * used in Util_ListDeleteGeneralMap. This function type
+ * include support for client handles in user callbacks.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ * @retval LIST_ERROR_CURRENT_PTR_OFF_LIST
+ *
+ */
+
+ListResult_t Util_ListDeleteGeneralMapClientHandleStyle(List_t *const List_p,
+ const ListDeleteFunctionGeneralMapClientHandleStyle_t DelFunc);
+
+/**
+ * This function removes and deletes all the elements in the list pointed to by
+ * List_pp. If the client specified a delete function (i.e. DelFunc is not
+ * NULL), it is called for each element in the list. If DelFunc_p is set to
+ * NULL, the list is destroyed but the elements are not freed.
+ *
+ * The pointer to the list is set to NULL upon return.
+ *
+ * See also Util_ListCreate(), Util_EListCreate().
+ *
+ * @param [in, out] List_pp Pointer to the list pointer to be destroyed.
+ * @param [in] DelFunc Function provided by client that knows how a
+ * client's element can be destroyed. NULL indicates that
+ * the elements in the list don't need to be freed while
+ * destroying the list.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ *
+ */
+
+ListResult_t Util_ListDestroy(List_t **List_pp,
+ const ListDeleteFunction_t DelFunc);
+
+/**
+ * This function removes and deletes all the elements in the list pointed to by
+ * List_pp. If the client specified a delete function (i.e. DelFunc is not
+ * NULL), it is called for each element in the list. If DelFunc_p is set to
+ * NULL, the list is destroyed but the elements are not freed.
+ *
+ * The pointer to the list is set to NULL upon return.
+ *
+ * See also Util_ListCreate(), Util_EListCreate().
+ *
+ * @param [in, out] List_pp Pointer to the list pointer to be destroyed.
+ * @param [in] DelFunc Function provided by client that knows how a
+ * client's element can be destroyed. NULL indicates that
+ * the elements in the list don't need to be freed while
+ * destroying the list. The DelFunc should
+ * be of type ListDeleteFunctionGeneralMap_t (see t_list.h) and
+ * is slightly different from the one used in Util_ListDestroy.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ *
+ */
+
+ListResult_t Util_ListDestroyGeneralMap(List_t **List_pp,
+ const ListDeleteFunctionGeneralMap_t DelFunc);
+
+/**
+ * This function removes and deletes all the elements in the list pointed to by
+ * List_pp. If the client specified a delete function (i.e. DelFunc is not
+ * NULL), it is called for each element in the list. If DelFunc_p is set to
+ * NULL, the list is destroyed but the elements are not freed. This function is
+ * slightly different from above
+ * Util_ListDestroyGeneralMap. Support for Client Handle is added in the
+ * callback function.
+ *
+ * The pointer to the list is set to NULL upon return.
+ *
+ * See also Util_ListCreate(), Util_EListCreate().
+ *
+ * @param [in, out] List_pp Pointer to the list pointer to be destroyed.
+ * @param [in] DelFunc Function provided by client that knows how a
+ * client's element can be destroyed. NULL indicates that
+ * the elements in the list don't need to be freed while
+ * destroying the list. The DelFunc should
+ * be of type ListDeleteFunctionGeneralMapClientHandleStyle_t
+ * (see t_list.h) and is slightly different from the one
+ * used in Util_ListDestroyGeneralMap. This function type
+ * include support for client handles in user callbacks.
+ *
+ * @retval LIST_SUCCESS
+ * @retval LIST_ERROR_INVALID_LIST
+ *
+ */
+ListResult_t Util_ListDestroyGeneralMapClientHandleStyle(List_t **List_pp,
+ const ListDeleteFunctionGeneralMapClientHandleStyle_t DelFunc);
+
+/**
+ * This function prints the information about the list. While printing
+ * information about the list, the list is scanned. If debug information about
+ * the element content is desired, the client must specify the debug routine,
+ * DbgFunc_p, that knows how to print this information. DbgFunc_p equal to NULL
+ * indicates that no debug information about the element's contents is desired.
+ *
+ *
+ * It is ONLY meant to be used during development and integration. It should be
+ * configured out of the library before the release. This can be done by
+ * defining REMOVE_UF_LISTPRINTDEBUG in the product's product.defines file.
+ *
+ * @param [in, out] List_p Pointer to the list whose debug information will be
+ * printed.
+ * @param [in] DbgFunc Client's function that is called to
+ * print debug information about the content of the
+ * elements in the list. DbgFunc_p can be NULL.
+ *
+ */
+
+void Util_ListPrintDebug(List_t *const List_p,
+ const ListDebugFunction_t DbgFunc);
+
+/**
+ * This function prints the information about the list. While printing
+ * information about the list, the list is scanned. If debug information about
+ * the element content is desired, the client must specify the debug routine,
+ * DbgFunc_p, that knows how to print this information. DbgFunc_p equal to NULL
+ * indicates that no debug information about the element's contents is desired.
+ *
+ * This function has been added to conform with the function type used in
+ * General Map for Util_Map_CallForEach.
+ *
+ * It is ONLY meant to be used during development and integration. It should be
+ * configured out of the library before the release. This can be done by
+ * defining REMOVE_UF_LISTPRINTDEBUGGENERALMAP in the
+ * product's product.defines file.
+ *
+ * @param [in, out] List_p Pointer to the list whose debug information will be
+ * printed.
+ * @param [in] DbgFunc Function of type ListDebugFunctionGeneralMap_t
+ * that agrees with the style used in general Map.
+ *
+ */
+
+void Util_ListPrintDebugGeneralMap(List_t *const List_p,
+ const ListDebugFunctionGeneralMap_t DbgFunc);
+
+/*************************************************************************
+ * Macros
+ **************************************************************************/
+
+/**
+ * LIST_APPEND(Element_p, Key_p, List_p) is used to insert an element at the
+ * tail of a doubly linked list.
+ * Example:
+ *
+ * List* MyList_p = NULL;
+ * ClientElementType_t* MyElement_p;
+ * ....
+ * MyElement_p = HEAP_ALLOC(ClientElementType_t);
+ * ....
+ * LIST_APPEND(MyElement_p, NULL, MyList_p)
+ *
+ *
+ * @param [in] Element_p Pointer to the client's element to be inserted in the list
+ * @param [in] Key_p Pointer the the element's key. Key_p can be NULL.
+ * @param [in] List_p Pointer to the doubly linked list. If List_p points to NULL,
+ * then the macro will create the list.
+ *
+ */
+
+#define LIST_APPEND(Element_p, Key_p, List_p) \
+ { \
+ if ((List_p) == NULL) \
+ (List_p) = Util_EListCreate(xmalloc, xfree); \
+ Util_ListGotoTail(List_p); \
+ Util_ListInsertAfter((List_p), (Key_p), (Element_p)); \
+ }
+
+/**
+ * LIST_FOR_EACH_ELEMENT_IN_LIST(ElementDataType_t, Element_p, List_p)
+ * iterates through all elements in the list from head to tail.
+ * Example:
+ * Given that the list MyList_p has been created and several elements added to
+ * it, the client could iterate through the list from head to tail using the
+ * following simple construct.
+ *
+ * LIST_FOR_EACH_ELEMENT_IN_LIST(ElementType_t, ThisElement_p, MyList_p)
+ * {
+ * // Here is the client code to manipulate
+ * each element (pointed to by ThisElement_p)
+ * }
+ *
+ * @param [in] ElementDataType_t The data type of the elements in the list pointed to by List_p)
+ * @param [in] Element_p Points to the element being iterated.
+ * @param [in] List_p Pointer to the doubly linked list to be iterated.
+ *
+ */
+
+#define LIST_FOR_EACH_ELEMENT_IN_LIST(ElementDataType_t, Element_p, List_p) \
+ { \
+ if (!(List_p)) \
+ ; \
+ else \
+ for ((List_p)->Curr_p = (List_p)->Head_p \
+ ; \
+ (List_p)->Curr_p && NULL != \
+ ((Element_p) = \
+ (ElementDataType_t *)(List_p)->\
+ Curr_p->Body_p) \
+ ; \
+ ((List_p)->Curr_p = (List_p)->Curr_p->Next_p)) \
+ ; \
+ }
+
+/**
+ *
+ * LIST_LENGTH(List_p) returns the number of elements in the list.
+ * Example:
+ * Given that the list MyList_p has been created and several elements added to
+ * it, the client could obtain the number of elements in the list using this
+ * macro.
+ *
+ * uint16_t ListLength;
+ * ....
+ *
+ * if (MyList_p)
+ * {
+ * ListLength = LIST_LENGTH(MyList_p);
+ * }
+ *
+ *
+ * @param [in] List_p A pointer to the doubly linked list whose length will be obtained.
+ * LIST_LENGTH must not be expanded with a pointer to NULL
+ *
+ */
+
+#define LIST_LENGTH(List_p) { (List_p)->NbrOfElements }
+
+
+
+#endif /* INCLUSION_GUARD_R_LIST_H */
diff --git a/host/xtest/adbg/src/r_list_genutil.c b/host/xtest/adbg/src/r_list_genutil.c
new file mode 100644
index 0000000..81e3e35
--- /dev/null
+++ b/host/xtest/adbg/src/r_list_genutil.c
@@ -0,0 +1,1675 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+**************************************************************************
+*
+* DESCRIPTION:
+*
+* Source file containing the functions for the manipulation of doubly
+* linked lists.
+* A linked list can be created/deleted, elements can be added/removed,
+* the list can be
+* traversed in both directions, the current list index can be moved in
+* different ways
+* (to head, to tail, to a specific index). The elements in a list can be
+* identified with a key (NULL terminated character string).
+* The key is specified by the client.
+* A function allows the client to look for the next (from head to tail)
+* element with a given key. Key usage is of course optional.
+* The library allocates memory only for the management of the list.
+* The client's data must be allocated by the client.
+* If so desired by the client, the client's data
+* can however be freed when the list is destroyed.
+*************************************************************************/
+
+/*************************************************************************
+* Includes
+*************************************************************************/
+
+#include "r_list.h"
+#include <stdlib.h>
+#include <string.h>
+
+#define C_(x)
+#define B_(x)
+#define PRE_CONDITION(a, b)
+#define IDENTIFIER_NOT_USED(x) { if (sizeof(&x)) {} }
+
+/*************************************************************************
+* Definition of external constants and variables
+*************************************************************************/
+
+/*************************************************************************
+* File scope types, constants and variables
+*************************************************************************/
+
+/*************************************************************************
+* Declaration of file local functions
+*************************************************************************/
+static bool ListIntComparisonFunc(const void *AnElementKey_p,
+ const void *KeyToMatch_p);
+
+static bool ListMoveForward(uint16_t NbrOfElement, ListItem_t **Element_pp);
+
+/*************************************************************************
+* Definition of functions
+*************************************************************************/
+
+/*************************************************************************
+ *
+ * Name: ListIntComparisonFunc
+ *
+ * Parameters: AnElementKey_p [In]
+ * A pointer to an element's key
+ * KeyToMatch_p [In]
+ * The pointer to the key to match
+ *
+ * Returns: true if the element's key is equal to the key to match
+ *
+ * Description: This function is used in conjunction to trying to find a key
+ * match in a linked list. The function is only used when the
+ * client of the list library does not provide a key matching
+ * function when calling Util_EListMatchingKey(), in which case,
+ * it is assumed that the key is a 32 bit unsigned integer.
+ *
+ **************************************************************************/
+bool ListIntComparisonFunc(const void *AnElementKey_p, const void *KeyToMatch_p)
+{
+ if (*((uint32_t *)(AnElementKey_p)) == *((uint32_t *)(KeyToMatch_p)))
+ return true;
+ else
+ return false;
+}
+
+/*************************************************************************
+ *
+ * Name: ListMoveForward
+ *
+ * Parameters: NbrOfElements [In]
+ * Nbr of elements the list should be traversed by
+ * Element_pp [In/Out]
+ * The pointer to the list element pointer from where
+ * the list will be traversed.
+ * On return, Element_pp will point to the element
+ * That is linked NbrOfElements after the starting element.
+ *
+ * Returns: true if the list could be traversed by NbrOfElements.
+ * false if the end of the list is reached before
+ * having traversed the list by NbrOfElements.
+ *
+ * Description: This function is used in conjunction with ListMoveSubrange().
+ *
+ **************************************************************************/
+static bool ListMoveForward(uint16_t NbrOfElements, ListItem_t **Element_pp)
+{
+ while (NbrOfElements != 0 && *Element_pp != NULL) {
+ *Element_pp = (*Element_pp)->Next_p;
+ NbrOfElements--;
+ }
+ if (*Element_pp == NULL)
+ return false;
+ else
+ return true;
+}
+
+
+/*************************************************************************
+ *
+ * Name: ListStrComparisonFunc
+ *
+ * Parameters: AnElementKey_p [In]
+ * A pointer to an element's key
+ * KeyToMatch_p [In]
+ * The pointer to the key to match
+ *
+ * Returns: true if the element's key is equal to the key to match
+ *
+ * Description: This function is used in conjunction to trying to find a key
+ * match in a linked list. The function is only used when the
+ * client of the list library use the obsolete
+ * Util_ListMatchingKey()
+ * function which always expects the key to be a NULL terminated
+ * string.
+ *
+ **************************************************************************/
+bool ListStrComparisonFunc(const void *AnElementKey_p, const void *KeyToMatch_p)
+{
+ if (strncmp(AnElementKey_p, KeyToMatch_p, strlen(KeyToMatch_p)) == 0)
+ return true;
+ else
+ return false;
+}
+
+/*
+ * NAME
+ * Util_EListCreate
+ */
+#ifndef REMOVE_UF_LISTCREATE
+List_t *Util_EListCreate(const ListMemAllocFunction_t MemAlloc_p,
+ const ListMemFreeFunction_t MemFree_p)
+{
+ List_t *List_p;
+ ListMemAllocFunction_t MyMemAlloc_p;
+ ListMemFreeFunction_t MyMemFree_p;
+
+ /* if no allocation function or no free function
+ specified, then use xmalloc and xfree */
+ if (MemAlloc_p && MemFree_p) {
+ MyMemAlloc_p = MemAlloc_p;
+ MyMemFree_p = MemFree_p;
+ } else {
+ MyMemAlloc_p = xmalloc;
+ MyMemFree_p = xfree;
+ }
+
+ List_p = (List_t *)MyMemAlloc_p(sizeof(List_t));
+ if (List_p != NULL) {
+ List_p->Head_p = NULL;
+ List_p->Tail_p = NULL;
+ List_p->Curr_p = NULL;
+ List_p->NbrOfElements = 0;
+ List_p->MemAllocFunc_p = MyMemAlloc_p;
+ List_p->MemFreeFunc_p = MyMemFree_p;
+ List_p->ClientHandleStyle = false;
+ List_p->ClientHandle_p = NULL;
+ }
+
+ C_(printf("\nUtil_EListCreate: List = 0x%x", (int)List_p);)
+
+ return List_p;
+}
+#endif /* REMOVE_UF_LISTCREATE */
+/*
+ * NAME
+ * Util_EListCreateClientHandleStyle
+ */
+#ifndef REMOVE_UF_LISTCREATECLIENTHANDLESTYLE
+List_t *Util_EListCreateClientHandleStyle(const void *const ClientHandle_p)
+{
+ List_t *List_p;
+
+ List_p = (List_t *)xmalloc(sizeof(List_t));
+ if (NULL != List_p) {
+ List_p->Head_p = NULL;
+ List_p->Tail_p = NULL;
+ List_p->Curr_p = NULL;
+ List_p->NbrOfElements = 0;
+ List_p->MemAllocFunc_p = xmalloc;
+ List_p->MemFreeFunc_p = xfree;
+ List_p->ClientHandleStyle = true;
+ List_p->ClientHandle_p = (void *)ClientHandle_p;
+ }
+
+ C_(printf("\nUtil_EListCreate: List = 0x%x", (int)List_p);)
+
+ return List_p;
+}
+#endif /* REMOVE_UF_LISTCREATECLIENTHANDLESTYLE */
+
+/*
+ * NAME
+ * Util_ListLength
+ *
+ */
+#ifndef REMOVE_UF_LISTLENGTH
+ListResult_t Util_ListLength(const List_t *const List_p,
+ uint16_t *const ListLength_p)
+{
+ PRE_CONDITION(List_p != NULL, return LIST_ERROR_INVALID_LIST);
+ PRE_CONDITION(ListLength_p != NULL, return LIST_ERROR_INVALID_PARAM);
+
+ *ListLength_p = List_p->NbrOfElements;
+ return LIST_SUCCESS;
+}
+
+#endif /* REMOVE_UF_LISTLENGTH */
+/*
+ * NAME
+ * Util_ListTail
+ *
+ *
+ */
+#ifndef REMOVE_UF_LISTTAIL
+ListStatus_t Util_ListTail(const List_t *const List_p)
+{
+ ListStatus_t Result;
+
+ PRE_CONDITION(List_p != NULL, return LIST_STATUS_INVALID_LIST);
+
+ Result = LIST_STATUS_NOTHING_TO_REPORT;
+
+ if (List_p->Curr_p != NULL) {
+ if (List_p->Curr_p->Next_p == NULL)
+ Result = LIST_STATUS_PTR_TO_TAIL;
+
+ }
+ C_(printf("\nUtil_ListHead: %d, List = 0x%x", Result, (int)List_p);)
+ return Result;
+}
+#endif /* REMOVE_UF_LISTTAIL */
+
+/*
+ * NAME
+ * Util_ListOffList
+ *
+ */
+#ifndef REMOVE_UF_LISTOFFLIST
+ListStatus_t Util_ListOffList(const List_t *const List_p)
+{
+ ListStatus_t Result;
+
+ PRE_CONDITION(List_p != NULL, return LIST_STATUS_INVALID_LIST);
+
+ if (List_p->Curr_p == NULL)
+ Result = LIST_STATUS_PTR_OFF_LIST;
+ else
+ Result = LIST_STATUS_NOTHING_TO_REPORT;
+
+ C_(printf("\nUtil_ListOffList: %d, List = 0x%x", Result, (int)List_p);)
+ return Result;
+}
+#endif /* REMOVE_UF_LISTOFFLIST */
+/*
+ * NAME
+ * Util_ListHead
+ *
+ *
+ */
+#ifndef REMOVE_UF_LISTHEAD
+ListStatus_t Util_ListHead(const List_t *const List_p)
+{
+ ListStatus_t Result;
+
+ PRE_CONDITION(List_p != NULL, return LIST_STATUS_INVALID_LIST);
+
+ Result = LIST_STATUS_NOTHING_TO_REPORT;
+
+ if (List_p->Curr_p != NULL) {
+ if (List_p->Curr_p->Prev_p == NULL)
+ Result = LIST_STATUS_PTR_TO_HEAD;
+
+ }
+ C_(printf("\nUtil_ListHead: %d, List = 0x%x", Result, (int)List_p);)
+ return Result;
+}
+#endif /* REMOVE_UF_UTIL_LISTHEAD */
+/*
+ * NAME
+ * Uilt_ListIsEmpty
+ *
+ */
+#ifndef REMOVE_UF_LISTISEMPTY
+ListStatus_t Util_ListIsEmpty(const List_t *const List_p)
+{
+ ListStatus_t Result;
+
+ PRE_CONDITION(List_p != NULL, return LIST_STATUS_INVALID_LIST);
+
+ if (List_p->Head_p == NULL)
+ Result = LIST_STATUS_LIST_EMPTY;
+ else
+ Result = LIST_STATUS_NOTHING_TO_REPORT;
+
+ C_(printf("\nUtil_ListIsEmpty: %d, List = 0x%x", Result, (int)List_p);)
+ return Result;
+}
+#endif
+/*
+ * NAME
+ * Util_EListInsertBefore
+ *
+ */
+#ifndef REMOVE_UF_ELISTINSERTBEFORE
+
+ListResult_t Util_EListInsertBefore(List_t *const List_p,
+ const void *const Key_p,
+ void *const ElemContent_p)
+{
+ ListItem_t *ListItem_p;
+
+
+ PRE_CONDITION(List_p != NULL, return LIST_ERROR_INVALID_LIST);
+
+
+ ListItem_p =
+ (ListItem_t *)(*List_p->MemAllocFunc_p)(sizeof(ListItem_t));
+ if (ListItem_p == NULL) {
+ B_(printf(
+ "\nUtil_EListInsertBefore:\n LIST_ERROR_COULD_NOT_ALLOC_MEM for Element_p = 0x%x, Key_p = 0x%x, List_p = 0x%x",
+ (int)ElemContent_p, (int)Key_p, (int)List_p);)
+ return LIST_ERROR_COULD_NOT_ALLOC_MEM;
+ }
+
+ ListItem_p->EKey_p = Key_p;
+ ListItem_p->Body_p = ElemContent_p;
+
+ List_p->NbrOfElements++;
+
+ if (List_p->Curr_p == NULL) {
+ /* list is empty or we're off the list,
+ add item at the head of the list */
+ /* and set the current pointer to point
+ to the newly added element */
+ ListItem_p->Next_p = List_p->Head_p;
+
+ if (List_p->Head_p == NULL)
+ List_p->Tail_p = ListItem_p;
+ else
+ List_p->Head_p->Prev_p = ListItem_p;
+
+ ListItem_p->Prev_p = NULL;
+ List_p->Head_p = ListItem_p;
+ List_p->Curr_p = ListItem_p;
+ } else {
+ if (List_p->Curr_p->Prev_p == NULL) {
+ /* The current pointer points to the head of the list */
+ List_p->Head_p->Prev_p = ListItem_p;
+ ListItem_p->Prev_p = NULL;
+ ListItem_p->Next_p = List_p->Head_p;
+ List_p->Head_p = ListItem_p;
+ List_p->Curr_p = ListItem_p;
+ } else {
+ ListItem_p->Prev_p = List_p->Curr_p->Prev_p;
+ ListItem_p->Next_p = List_p->Curr_p;
+ List_p->Curr_p->Prev_p->Next_p = ListItem_p;
+ List_p->Curr_p->Prev_p = ListItem_p;
+ List_p->Curr_p = ListItem_p;
+ }
+ }
+ C_(printf(
+ "\nUtil_EListInsertBefore:\n LIST_SUCCESS for Element_p = 0x%x, Key_p = 0x%x, List_p = 0x%x",
+ (int)ElemContent_p, (int)Key_p, (int)List_p);)
+ return LIST_SUCCESS;
+}
+
+#endif /* REMOVE_UF_ELISTINSERTBEFORE */
+
+
+/*
+ * NAME
+ * Util_ListInsertFirst
+ *
+ */
+#ifndef REMOVE_UF_LISTINSERTFIRST
+
+ListResult_t Util_ListInsertFirst(List_t *const List_p,
+ const void *const Key_p,
+ void *const ElemContent_p)
+{
+ ListItem_t *ListItem_p;
+
+ PRE_CONDITION(List_p != NULL, return LIST_ERROR_INVALID_LIST);
+
+
+ ListItem_p =
+ (ListItem_t *)(*List_p->MemAllocFunc_p)(sizeof(ListItem_t));
+ if (ListItem_p == NULL) {
+ B_(printf(
+ "\nUtil_EListInsertBefore:\n LIST_ERROR_COULD_NOT_ALLOC_MEM for Element_p = 0x%x, Key_p = 0x%x, List_p = 0x%x",
+ (int)ElemContent_p, (int)Key_p, (int)List_p);)
+ return LIST_ERROR_COULD_NOT_ALLOC_MEM;
+ }
+
+ ListItem_p->EKey_p = Key_p;
+ ListItem_p->Body_p = ElemContent_p;
+ List_p->NbrOfElements++;
+
+
+ ListItem_p->Next_p = List_p->Head_p;
+
+ if (List_p->Head_p == NULL) {
+ /* list is empty */
+ List_p->Tail_p = ListItem_p;
+ } else {
+ /* list is not empty, link element at the head */
+ List_p->Head_p->Prev_p = ListItem_p;
+ }
+ ListItem_p->Prev_p = NULL;
+ List_p->Head_p = ListItem_p;
+
+ C_(printf(
+ "\nUtil_ListInsertFirst:\n LIST_SUCCESS for Element_p = 0x%x, Key_p = 0x%x, List_p = 0x%x",
+ (int)ElemContent_p, (int)Key_p, (int)List_p);)
+ return LIST_SUCCESS;
+}
+#endif /* REMOVE_UF_LISTINSERTFIRST */
+
+
+/*
+ * NAME
+ * Util_EListInsertAfter
+ *
+ */
+#ifndef REMOVE_UF_ELISTINSERTAFTER
+
+ListResult_t Util_EListInsertAfter(List_t *const List_p,
+ const void *const Key_p,
+ void *const ElemContent_p)
+{
+ ListItem_t *ListItem_p;
+
+ PRE_CONDITION(List_p != NULL, return LIST_ERROR_INVALID_LIST);
+
+ ListItem_p =
+ (ListItem_t *)(*List_p->MemAllocFunc_p)(sizeof(ListItem_t));
+ if (ListItem_p == NULL) {
+ B_(printf(
+ "\nUtil_EListInsertAfter:\n LIST_ERROR_COULD_NOT_ALLOC_MEM for Element = 0x%x, Key_p = 0x%x, List = 0x%x",
+ (int)ElemContent_p, (int)Key_p, (int)List_p);)
+ return LIST_ERROR_COULD_NOT_ALLOC_MEM;
+ }
+
+ ListItem_p->EKey_p = Key_p;
+ ListItem_p->Body_p = ElemContent_p;
+
+ List_p->NbrOfElements++;
+
+ if (List_p->Curr_p == NULL) {
+ /* list is empty or we're off the list,
+ add item at the tail of the list */
+ ListItem_p->Prev_p = List_p->Tail_p;
+ if (List_p->Head_p == NULL)
+ List_p->Head_p = ListItem_p;
+ else
+ List_p->Tail_p->Next_p = ListItem_p;
+
+ ListItem_p->Next_p = NULL;
+ List_p->Tail_p = ListItem_p;
+ List_p->Curr_p = ListItem_p;
+ } else {
+ if (List_p->Curr_p->Next_p == NULL) {
+ List_p->Tail_p->Next_p = ListItem_p;
+ ListItem_p->Next_p = NULL;
+ ListItem_p->Prev_p = List_p->Tail_p;
+ List_p->Tail_p = ListItem_p;
+ List_p->Curr_p = ListItem_p;
+ } else {
+ ListItem_p->Next_p = List_p->Curr_p->Next_p;
+ ListItem_p->Prev_p = List_p->Curr_p;
+ List_p->Curr_p->Next_p->Prev_p = ListItem_p;
+ List_p->Curr_p->Next_p = ListItem_p;
+ List_p->Curr_p = ListItem_p;
+ }
+ }
+ C_(printf(
+ "\nUtil_EListInsertAfter:\n LIST_SUCCESS for Element_p = 0x%x, Key_p = 0x%x, List_p = 0x%x",
+ (int)ElemContent_p, (int)Key_p, (int)List_p);)
+ return LIST_SUCCESS;
+}
+#endif /* REMOVE_UF_ELISTINSERTAFTER */
+
+
+/*
+ * NAME
+ * Util_ListInsertLast
+ *
+ */
+#ifndef REMOVE_UF_LISTINSERTLAST
+
+ListResult_t Util_ListInsertLast(List_t *const List_p,
+ const void *const Key_p,
+ void *const ElemContent_p)
+{
+ ListItem_t *ListItem_p;
+
+ PRE_CONDITION(List_p != NULL, return LIST_ERROR_INVALID_LIST);
+
+
+ ListItem_p =
+ (ListItem_t *)(*List_p->MemAllocFunc_p)(sizeof(ListItem_t));
+ if (ListItem_p == NULL) {
+ B_(printf(
+ "\nUtil_ListInsertLast:\n LIST_ERROR_COULD_NOT_ALLOC_MEM for Element = 0x%x, Key_p = 0x%x, List = 0x%x",
+ (int)ElemContent_p, (int)Key_p, (int)List_p);)
+ return LIST_ERROR_COULD_NOT_ALLOC_MEM;
+ }
+
+ ListItem_p->EKey_p = Key_p;
+ ListItem_p->Body_p = ElemContent_p;
+
+ List_p->NbrOfElements++;
+
+ /* Insert the element at the tail of the list */
+ ListItem_p->Prev_p = List_p->Tail_p;
+ if (List_p->Head_p == NULL) {
+ /* list is empty */
+ List_p->Head_p = ListItem_p;
+ } else {
+ /* list is not empty, link element at the tail */
+ List_p->Tail_p->Next_p = ListItem_p;
+ }
+
+ ListItem_p->Next_p = NULL;
+ List_p->Tail_p = ListItem_p;
+
+ C_(printf(
+ "\nUtil_ListInsertLast:\n LIST_SUCCESS for Element_p = 0x%x, Key_p = 0x%x, List_p = 0x%x",
+ (int)ElemContent_p, (int)Key_p, (int)List_p);)
+ return LIST_SUCCESS;
+}
+#endif /* REMOVE_UF_LISTINSERTLAST */
+
+
+/*
+ * NAME
+ * Util_ListGotoTail
+ *
+ */
+#ifndef REMOVE_UF_LISTGOTOTAIL
+#ifdef REMOVE_UF_LISTCURR
+#undef REMOVE_UF_LISTCURR
+#endif
+void *Util_ListGotoTail(List_t *const List_p)
+{
+ PRE_CONDITION(List_p != NULL, return NULL);
+
+ List_p->Curr_p = List_p->Tail_p;
+ C_(printf("\nUtil_ListGotoTail: List = 0x%x", (int)List_p);)
+ return Util_ListCurr(List_p);
+}
+#endif /* REMOVE_UF_LISTGOTOTAIL */
+
+#ifndef REMOVE_UF_LISTRESETCURR
+bool Util_ListResetCurr(List_t *const List_p)
+{
+ PRE_CONDITION(List_p != NULL, return false);
+
+ List_p->Curr_p = NULL;
+ C_(printf("\nUtil_ListResetCurr: List = 0x%x", (int)List_p);)
+ return true;
+}
+#endif /* REMOVE_UF_LISTRESETCURR */
+
+/*
+ * NAME
+ * Util_ListGotoHead
+ *
+ */
+#ifndef REMOVE_UF_LISTGOTOHEAD
+#ifdef REMOVE_UF_LISTCURR
+#undef REMOVE_UF_LISTCURR
+#endif
+void *Util_ListGotoHead(List_t *const List_p)
+{
+ PRE_CONDITION(List_p != NULL, return NULL);
+
+ List_p->Curr_p = List_p->Head_p;
+ C_(printf("\nUtil_ListGotoHead: List = 0x%x", (int)List_p);)
+ return Util_ListCurr(List_p);
+}
+#endif /* REMOVE_UF_LISTGOTOHEAD */
+
+
+/*
+ * NAME
+ * Util_ListGotoIth
+ *
+ */
+#ifndef REMOVE_UF_LISTGOTOITH
+#ifdef REMOVE_UF_LISTCURR
+#undef REMOVE_UF_LISTCURR
+#endif
+void *Util_ListGotoIth(List_t *const List_p, uint16_t i)
+{
+ PRE_CONDITION((List_p != NULL) && (i >= 1), return NULL);
+
+ List_p->Curr_p = List_p->Head_p;
+ while ((List_p->Curr_p != NULL) && (i > 1)) {
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+ i--;
+ }
+ C_(printf("\nUtil_ListGotoIth: list 0x%x pointing to the %dth element",
+ (int)List_p, i);)
+ return Util_ListCurr(List_p);
+}
+#endif /* REMOVE_UF_LISTGOTOITH */
+
+
+/*
+ * NAME
+ * Util_ListIsNext
+ */
+#ifndef REMOVE_UF_LISTISNEXT
+#ifdef REMOVE_UF_LISTSTATUS
+#undef REMOVE_UF_LISTSTATUS
+#endif
+bool Util_ListIsNext(List_t *const List_p)
+{
+ ListStatus_t Status;
+
+ Status = Util_ListStatus(List_p);
+ if (Status &
+ (LIST_STATUS_PTR_TO_TAIL |
+ LIST_STATUS_LIST_EMPTY |
+ LIST_STATUS_INVALID_LIST)
+ ) {
+ return false;
+ } else {
+ if (Status & LIST_STATUS_PTR_OFF_LIST)
+ List_p->Curr_p = List_p->Head_p;
+ else
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+
+ return true;
+ }
+}
+#endif
+
+/*
+ * NAME
+ * Util_ListIsPrev
+ */
+#ifndef REMOVE_UF_LISTISPREV
+#ifdef REMOVE_UF_LISTSTATUS
+#undef REMOVE_UF_LISTSTATUS
+#endif
+bool Util_ListIsPrev(List_t *const List_p)
+{
+ ListStatus_t Status;
+
+ Status = Util_ListStatus(List_p);
+ if (Status &
+ (LIST_STATUS_PTR_TO_HEAD |
+ LIST_STATUS_LIST_EMPTY |
+ LIST_STATUS_INVALID_LIST)
+ ) {
+ return false;
+ } else {
+ if (Status & LIST_STATUS_PTR_OFF_LIST)
+ List_p->Curr_p = List_p->Tail_p;
+ else
+ List_p->Curr_p = List_p->Curr_p->Prev_p;
+
+ return true;
+ }
+}
+#endif
+
+/*
+ * NAME
+ * Util_ListStatus
+ *
+ */
+#ifndef REMOVE_UF_LISTSTATUS
+ListStatus_t Util_ListStatus(const List_t *const List_p)
+{
+ ListStatus_t Result = LIST_STATUS_NOTHING_TO_REPORT; /* = 0 */
+
+ PRE_CONDITION(List_p != NULL, return LIST_STATUS_INVALID_LIST);
+
+ if (List_p->Head_p == NULL) {
+ Result = LIST_STATUS_LIST_EMPTY;
+ } else if (List_p->Curr_p == NULL) {
+ Result = LIST_STATUS_PTR_OFF_LIST;
+ } else {
+ if (List_p->Curr_p->Next_p == NULL)
+ Result = LIST_STATUS_PTR_TO_TAIL;
+
+ if (List_p->Curr_p->Prev_p == NULL)
+ Result |= LIST_STATUS_PTR_TO_HEAD;
+
+ }
+ C_(printf("\nUtil_ListStatus: %d, List = 0x%x", Result, (int)List_p);)
+ return Result;
+}
+#endif /* REMOVE_UF_LISTSTATUS */
+
+
+/*
+ * NAME
+ * Util_ListNext
+ *
+ */
+#ifndef REMOVE_UF_LISTNEXT
+#ifdef REMOVE_UF_LISTCURR
+#undef REMOVE_UF_LISTCURR
+#endif
+void *Util_ListNext(List_t *const List_p)
+{
+ PRE_CONDITION(List_p != NULL, return NULL);
+
+ if (List_p->Curr_p == NULL) {
+ if (List_p->Head_p == NULL) {
+ B_(printf("\nUtil_ListNext: List = 0x%x is empty",
+ (int)List_p);)
+ return NULL;
+ } else {
+ List_p->Curr_p = List_p->Head_p;
+ }
+ } else {
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+ }
+ return Util_ListCurr(List_p);
+}
+#endif /* REMOVE_UF_LISTNEXT */
+
+
+/*
+ * NAME
+ * Util_ListPrev
+ *
+ */
+#ifndef REMOVE_UF_LISTPREV
+#ifdef REMOVE_UF_LISTCURR
+#undef REMOVE_UF_LISTCURR
+#endif
+void *Util_ListPrev(List_t *const List_p)
+{
+ PRE_CONDITION(List_p != NULL, return NULL);
+
+ if (List_p->Curr_p == NULL) {
+ if (List_p->Head_p == NULL) {
+ B_(printf("\nUtil_ListPrev: List = 0x%x is empty",
+ (int)List_p);)
+ return NULL;
+ } else {
+ List_p->Curr_p = List_p->Tail_p;
+ }
+ } else {
+ List_p->Curr_p = List_p->Curr_p->Prev_p;
+ }
+
+ return Util_ListCurr(List_p);
+}
+#endif /* REMOVE_UF_LISTPREV */
+
+
+/*
+ * NAME
+ * Util_ListKeyedRemove
+ *
+ */
+#ifndef REMOVE_UF_LISTKEYEDREMOVE
+#ifdef REMOVE_UF_LISTREMOVE
+#undef REMOVE_UF_LISTREMOVE
+#endif
+
+ListResult_t Util_ListKeyedRemove(List_t *const List_p,
+ const void *const Key_p,
+ const ListKeyMatchingFunction_t
+ KeyMatchingFunc_p)
+{
+ PRE_CONDITION((List_p != NULL) && (Key_p != NULL),
+ return LIST_ERROR_INVALID_PARAM);
+
+ /* Make sure the list is not empty */
+ if (List_p->Head_p == NULL) {
+ return LIST_ERROR_NO_MATCH_FOUND;
+ } else {
+ /* the "current" item in the list at
+ the time the function is entered */
+ ListItem_t *Temp_p;
+ /* Last element of the list that
+ should be checked for a matchhing key */
+ ListItem_t *LastElement_p;
+ ListKeyMatchingFunction_t ComparisonFunc_p;
+
+ Temp_p = List_p->Curr_p;
+ LastElement_p = Temp_p;
+
+ if (List_p->Curr_p == NULL) {
+ List_p->Curr_p = List_p->Head_p;
+ LastElement_p = List_p->Head_p;
+ }
+
+ if (KeyMatchingFunc_p == NULL)
+ ComparisonFunc_p = ListIntComparisonFunc;
+ else
+ ComparisonFunc_p = KeyMatchingFunc_p;
+
+ do {
+ if (List_p->Curr_p->EKey_p != NULL) {
+ if ((*ComparisonFunc_p)(List_p->Curr_p->EKey_p,
+ Key_p)) {
+ C_(printf(
+ "\nUtil_ListKeyedRemove: Found a match, List = 0x%x",
+ (int)List_p);)
+ return Util_ListRemove(List_p);
+ }
+ }
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+ /* wrap around */
+ if (List_p->Curr_p == NULL)
+ List_p->Curr_p = List_p->Head_p;
+
+ } while (List_p->Curr_p != LastElement_p);
+
+ C_(printf("\nUtil_ListKeyedRemove: NULL, List = 0x%x",
+ (int)List_p);)
+ List_p->Curr_p = Temp_p;
+
+ return LIST_ERROR_NO_MATCH_FOUND;
+ }
+}
+#endif /* REMOVE_UF_LISTKEYEDREMOVE */
+
+/*
+ * NAME
+ * Util_EListMatchingKey
+ *
+ */
+#ifndef REMOVE_UF_ELISTMATCHINGKEY
+#ifdef REMOVE_UF_LISTCURR
+#undef REMOVE_UF_LISTCURR
+#endif
+
+void *Util_EListMatchingKey(List_t *const List_p,
+ const void *const Key_p,
+ const ListKeyMatchingFunction_t KeyMatchingFunc_p)
+{
+ PRE_CONDITION((List_p != NULL) && (Key_p != NULL), return NULL);
+
+ /* Make sure the list is not empty */
+ if (List_p->Head_p == NULL) {
+ return NULL;
+ } else {
+ /* the "current" item in the
+ list at the time the function is entered */
+ ListItem_t *Temp_p;
+ /* Last element of the list
+ that should be checked for a matchhing key */
+ ListItem_t *LastElement_p;
+ ListKeyMatchingFunction_t ComparisonFunc_p;
+
+ Temp_p = List_p->Curr_p;
+ LastElement_p = Temp_p;
+
+ if (List_p->Curr_p == NULL) {
+ List_p->Curr_p = List_p->Head_p;
+ LastElement_p = List_p->Head_p;
+ }
+
+ if (KeyMatchingFunc_p == NULL)
+ ComparisonFunc_p = ListIntComparisonFunc;
+ else
+ ComparisonFunc_p = KeyMatchingFunc_p;
+
+ do {
+ if (List_p->Curr_p->EKey_p != NULL) {
+ if ((*ComparisonFunc_p)(List_p->Curr_p->EKey_p,
+ Key_p)) {
+ C_(printf(
+ "\nUtil_EListMatchingKey: Found a match, List = 0x%x",
+ (int)List_p);)
+ return Util_ListCurr(List_p);
+ }
+ }
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+ /* wrap around */
+ if (List_p->Curr_p == NULL)
+ List_p->Curr_p = List_p->Head_p;
+
+ } while (List_p->Curr_p != LastElement_p);
+
+ C_(printf("\nUtil_EListMatchingKey: NULL, List = 0x%x",
+ (int)List_p);)
+ List_p->Curr_p = Temp_p;
+ return NULL;
+ }
+}
+
+#endif /* REMOVE_UF_ELISTMATCHINGKEY */
+
+/*
+ * NAME
+ * Util_EListMatchingKeyClientHandleStyle
+ *
+ */
+#ifndef REMOVE_UF_ELISTMATCHINGKEYREMOVECLIENTHANDLESTYLE
+#ifdef REMOVE_UF_LISTCURR
+#undef REMOVE_UF_LISTCURR
+#endif
+
+void *Util_EListMatchingKeyClientHandleStyle(List_t *const List_p,
+ const void *const Key_p,
+ const ListKeyMatchingFunctionClientHandleStyle_t
+ KeyMatchingFunc_p)
+{
+ PRE_CONDITION((NULL != List_p) && (NULL != Key_p), return NULL);
+
+ /* Make sure the list is not empty */
+ if (NULL == List_p->Head_p) {
+ return NULL;
+ } else {
+ /* the "current" item in the
+ list at the time the function is entered */
+ ListItem_t *Temp_p;
+ /* Last element of the list
+ that should be checked for a matchhing key */
+ ListItem_t *LastElement_p;
+
+ Temp_p = List_p->Curr_p;
+ LastElement_p = Temp_p;
+
+ if (NULL == List_p->Curr_p) {
+ List_p->Curr_p = List_p->Head_p;
+ LastElement_p = List_p->Head_p;
+ }
+
+ do {
+ if (NULL != List_p->Curr_p->EKey_p) {
+ if ((*KeyMatchingFunc_p)(List_p->ClientHandle_p,
+ List_p->Curr_p->EKey_p,
+ Key_p)) {
+ C_(printf(
+ "\nUtil_EListMatchingKey: Found a match, List = 0x%x",
+ (int)List_p);)
+ return Util_ListCurr(List_p);
+ }
+ }
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+ /* wrap around */
+ if (List_p->Curr_p == NULL)
+ List_p->Curr_p = List_p->Head_p;
+
+ } while (List_p->Curr_p != LastElement_p);
+
+ C_(printf("\nUtil_EListMatchingKey: NULL, List = 0x%x",
+ (int)List_p);)
+ List_p->Curr_p = Temp_p;
+ return NULL;
+ }
+}
+#endif /* REMOVE_UF_ELISTMATCHINGKEYREMOVECLIENTHANDLESTYLE */
+
+/*
+ * NAME
+ * Util_ListKeyedIndex
+ *
+ */
+#ifndef REMOVE_UF_LISTKEYEDINDEX
+
+int Util_ListKeyedIndex(List_t *const List_p,
+ const void *const Key_p,
+ const ListKeyMatchingFunction_t KeyMatchingFunc_p)
+{
+ PRE_CONDITION((List_p != NULL) && (Key_p != NULL), return -1);
+
+ /* Make sure the list is not empty */
+ if (List_p->Head_p == NULL) {
+ return -1;
+ } else {
+ /* the "current" item in the
+ list at the time the function is entered */
+ ListItem_t *Temp_p;
+
+ ListKeyMatchingFunction_t ComparisonFunc_p;
+ int PositionInList;
+
+ if (KeyMatchingFunc_p == NULL)
+ ComparisonFunc_p = ListIntComparisonFunc;
+ else
+ ComparisonFunc_p = KeyMatchingFunc_p;
+
+ Temp_p = List_p->Curr_p;
+ List_p->Curr_p = List_p->Head_p;
+ PositionInList = 1;
+ do {
+ if (List_p->Curr_p->EKey_p != NULL) {
+ if ((*ComparisonFunc_p)(List_p->Curr_p->EKey_p,
+ Key_p)) {
+ C_(printf(
+ "\nUtil_ListKeyedIndex: Found, List = 0x%x",
+ (int)List_p);)
+ return PositionInList;
+ }
+ }
+ PositionInList++;
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+ } while (List_p->Curr_p != NULL);
+
+ C_(printf("\nUtil_ListKeyedIndex: Not Found, List = 0x%x",
+ (int)List_p);)
+ List_p->Curr_p = Temp_p;
+ return -1;
+ }
+}
+
+#endif /* REMOVE_UF_LISTKEYEDINDEX */
+
+
+/*
+ * NAME
+ * Util_ListCurrIndex
+ *
+ */
+#ifndef REMOVE_UF_LISTCURRINDEX
+
+int Util_ListCurrIndex(const List_t *const List_p)
+{
+ if (List_p == NULL || List_p->Curr_p == NULL || List_p->Head_p ==
+ NULL) {
+ B_(printf(
+ "\nUtil_ListKeyedIndex: invalid input parameters, \n List = 0x%x",
+ (int)List_p);)
+ return -1;
+ }
+
+ /* the "current" item in the
+ list at the time the function is entered */
+ ListItem_t *Temp_p;
+
+ int PositionInList;
+
+ Temp_p = List_p->Head_p;
+ PositionInList = 1;
+
+ while (Temp_p != List_p->Curr_p && Temp_p != NULL) {
+ PositionInList++;
+ Temp_p = Temp_p->Next_p;
+ }
+ if (Temp_p == List_p->Curr_p) {
+ C_(printf("\nUtil_ListCurrIndex: Found, List = 0x%x",
+ (int)List_p);)
+ return PositionInList;
+ } else {
+ C_(printf("\nUtil_ListCurrIndex: Not Found, List = 0x%x",
+ (int)List_p);)
+ return -1;
+ }
+}
+
+#endif /* REMOVE_UF_LISTCURRINDEX */
+
+
+
+#ifndef REMOVE_UF_LISTMOVESUBRANGE
+
+ListResult_t Util_ListMoveSubrange(List_t *const List_p,
+ uint16_t First,
+ uint16_t Last,
+ uint16_t To)
+{
+ ListItem_t *First_p;
+ ListItem_t *Last_p;
+
+ ListItem_t *After_p;
+ ListItem_t *BeforeFirst_p;
+ uint16_t DeltaIndexToNext;
+ ListItem_t *To_p = NULL;
+
+ First--;
+ Last--;
+ To--;
+
+ PRE_CONDITION((List_p != NULL) &&
+ ((First > To) || (To > Last)) && (First <= Last),
+ return LIST_ERROR_INVALID_PARAM);
+
+ if (To < First) {
+ To_p = List_p->Head_p;
+ if (!ListMoveForward(To, &To_p))
+ return LIST_ERROR_INVALID_PARAM;
+
+ DeltaIndexToNext = First - To;
+ First_p = To_p;
+ } else {
+ DeltaIndexToNext = First;
+ First_p = List_p->Head_p;
+ }
+
+
+ if (!ListMoveForward(DeltaIndexToNext, &First_p))
+ return LIST_ERROR_INVALID_PARAM;
+
+ DeltaIndexToNext = Last - First;
+ Last_p = First_p;
+ if (!ListMoveForward(DeltaIndexToNext, &Last_p))
+ return LIST_ERROR_INVALID_PARAM;
+
+ if (To > Last) {
+ DeltaIndexToNext = To - Last;
+ To_p = Last_p;
+ if (!ListMoveForward(DeltaIndexToNext, &To_p))
+ return LIST_ERROR_INVALID_PARAM;
+ }
+
+ /* Patch the hole left after removing the
+ elements from first to last. */
+ BeforeFirst_p = First_p->Prev_p;
+ After_p = Last_p->Next_p;
+ if (BeforeFirst_p != NULL) {
+ BeforeFirst_p->Next_p = After_p;
+ } else {
+ /* The head of the list pointed to
+ First_p before the call, */
+ /* It should now point to the first
+ element after Last_p */
+ List_p->Head_p = After_p;
+ }
+
+ if (After_p != NULL) {
+ After_p->Prev_p = BeforeFirst_p;
+ } else {
+ /* The tail of the list pointed to Last_p before the call, */
+ /* It should now point to the element
+ before the first element removed */
+ List_p->Tail_p = BeforeFirst_p;
+ }
+
+ /* Insert the removed elements after the element pointed to by To_p */
+ if (To_p != NULL) {
+ After_p = To_p->Next_p;
+
+ To_p->Next_p = First_p;
+ First_p->Prev_p = To_p;
+ }
+ Last_p->Next_p = After_p;
+ if (After_p != NULL) {
+ After_p->Prev_p = Last_p;
+ } else {
+ /* The tail of the list pointed to To_p prior to the call, */
+ /* The tail of the list becomes the last element moved */
+ List_p->Tail_p = Last_p;
+ }
+
+ List_p->Curr_p = NULL;
+
+ C_(printf(
+ "\nUtil_ListMoveSub: Reordered elements in list OK, List = 0x%x",
+ (int)List_p);)
+ return LIST_SUCCESS;
+}
+#endif /* REMOVE_UF_LISTMOVESUBRANGE */
+
+
+#ifndef REMOVE_UF_LISTGETSUBRANGE
+
+ListResult_t Util_ListGetSubrange(List_t *const FromList_p,
+ uint16_t First,
+ uint16_t Last,
+ List_t *const ToList_p)
+{
+ ListItem_t *First_p;
+ ListItem_t *Last_p;
+ ListItem_t *BeforeFirst_p;
+ ListItem_t *AfterLast_p;
+ uint16_t NbrOfElementsToMove;
+
+ First--;
+ Last--;
+
+ PRE_CONDITION((FromList_p != NULL) && (ToList_p != NULL) &&
+ (First <= Last),
+ return LIST_ERROR_INVALID_PARAM);
+
+ NbrOfElementsToMove = Last + 1 - First;
+
+ First_p = FromList_p->Head_p;
+ if (!ListMoveForward(First, &First_p))
+ return LIST_ERROR_INVALID_PARAM;
+
+ Last -= First;
+ Last_p = First_p;
+ if (!ListMoveForward(Last, &Last_p))
+ return LIST_ERROR_INVALID_PARAM;
+
+ /* relink the elements in FromList_p */
+ BeforeFirst_p = First_p->Prev_p;
+ AfterLast_p = Last_p->Next_p;
+ if (BeforeFirst_p != NULL) {
+ BeforeFirst_p->Next_p = AfterLast_p;
+ } else {
+ /* The head of the list pointed to
+ First_p before the call, */
+ /* It should now point to the first
+ element after Last_p */
+ FromList_p->Head_p = AfterLast_p;
+ }
+
+ if (AfterLast_p != NULL) {
+ AfterLast_p->Prev_p = BeforeFirst_p;
+ } else {
+ /* The tail of the list pointed to
+ Last_p before the call, */
+ /* It should now point to the element
+ before the first element removed */
+ FromList_p->Tail_p = BeforeFirst_p;
+ }
+
+ ToList_p->NbrOfElements += NbrOfElementsToMove;
+ FromList_p->NbrOfElements -= NbrOfElementsToMove;
+
+ /* Initialize the ToList */
+ if (ToList_p->Tail_p == NULL) {
+ /* ToList_p is empty, First_p becomes
+ the head and Last_p becomes the tail */
+ ToList_p->Head_p = First_p;
+ First_p->Prev_p = NULL;
+
+ ToList_p->Tail_p = Last_p;
+ Last_p->Next_p = NULL;
+ } else {
+ /* Link the elements removed from
+ FromList_p to the tail of ToList_p */
+ ToList_p->Tail_p->Next_p = First_p;
+ First_p->Prev_p = ToList_p->Tail_p;
+
+ ToList_p->Tail_p = Last_p;
+ Last_p->Next_p = NULL;
+ }
+
+ /* The current pointer in FromList_p and ToList_p are reset. */
+ ToList_p->Curr_p = NULL;
+ FromList_p->Curr_p = NULL;
+
+ C_(printf("\nUtil_ListGetSubrange: OK, ToList = 0x%x", (int)ToList_p);)
+ return LIST_SUCCESS;
+}
+#endif /* REMOVE_UF_LISTGETSUBRANGE */
+
+/*
+ * NAME
+ * Util_ListCurr
+ *
+ */
+#ifndef REMOVE_UF_LISTCURR
+void *Util_ListCurr(const List_t *const List_p)
+{
+ PRE_CONDITION(List_p != NULL, return NULL);
+
+ if (List_p->Curr_p == NULL) {
+ C_(printf(
+ "\nUtil_ListCurrent: list element pointer is NULL, List = 0x%x",
+ (int)List_p);)
+ return NULL;
+ } else {
+ C_(printf(
+ "\nUtil_ListCurrent: list element pointer is 0x%x, List = 0x%x",
+ (int)List_p->Curr_p->Body_p, (int)List_p);)
+ return List_p->Curr_p->Body_p;
+ }
+}
+#endif /* REMOVE_UF_LISTCURR */
+
+/*
+ * NAME
+ * Util_ListDestroy
+ *
+ */
+#ifndef REMOVE_UF_LISTDESTROY
+#ifdef REMOVE_UF_LISTDELETE
+#undef REMOVE_UF_LISTDELETE
+#endif
+ListResult_t Util_ListDestroy(List_t **List_pp,
+ const ListDeleteFunction_t DelFunc_p)
+{
+ ListResult_t Result = LIST_SUCCESS;
+ List_t *List_p = *List_pp;
+
+ PRE_CONDITION(List_p != NULL, return LIST_ERROR_INVALID_LIST);
+
+ /* traverse the list from the head */
+ List_p->Curr_p = List_p->Head_p;
+
+ while ((List_p->Curr_p != NULL) && (Result == LIST_SUCCESS))
+ Result = Util_ListDelete(List_p, DelFunc_p);
+
+ if (Result == LIST_SUCCESS) {
+ (*List_p->MemFreeFunc_p)(List_p);
+ *List_pp = NULL;
+ }
+ C_(printf("\nUtil_ListDestroy: Return = %d, List = 0x%x is destroyed",
+ Result, (int)List_p);)
+ return Result;
+}
+#endif /* REMOVE_UF_LISTDESTROY */
+
+/*
+ * NAME
+ * Util_ListDestroyGeneralMap
+ * special attention for the delete function callback due to general map.
+ * General map allows seperate allocation for key and value therefore must
+ * the callback include both these parameters
+ */
+#ifndef REMOVE_UF_LISTDESTROYGENERALMAP
+#ifdef REMOVE_UF_LISTDELETEGENERALMAP
+#undef REMOVE_UF_LISTDELETEGENERALMAP
+#endif
+ListResult_t Util_ListDestroyGeneralMap(List_t **List_pp,
+ const ListDeleteFunctionGeneralMap_t DelFunc_p)
+{
+ ListResult_t Result = LIST_SUCCESS;
+ List_t *List_p = *List_pp;
+
+ PRE_CONDITION(NULL != List_p, return LIST_ERROR_INVALID_LIST);
+
+ /* traverse the list from the head */
+ List_p->Curr_p = List_p->Head_p;
+
+ while ((NULL != List_p->Curr_p) && (LIST_SUCCESS == Result))
+ Result = Util_ListDeleteGeneralMap(List_p, DelFunc_p);
+
+ if (LIST_SUCCESS == Result) {
+ (*List_p->MemFreeFunc_p)(List_p);
+ *List_pp = NULL;
+ }
+ C_(printf("\nUtil_ListDestroy: Return = %d, List = 0x%x is destroyed",
+ Result, (int)List_p);)
+ return Result;
+}
+#endif /* REMOVE_UF_LISTDESTROYGENERALMAP */
+
+/*
+ * NAME
+ * Util_ListDestroyGeneralMap
+ * Special attention to ClientHandle style with client handler in callbacks
+ */
+#ifndef REMOVE_UF_LISTDESTROYGENERALMAPCLIENTHANDLESTYLE
+#ifdef REMOVE_UF_LISTDELETEGENERALMAPCLIENTHANDLESTYLE
+#undef REMOVE_UF_LISTDELETEGENERALMAPCLIENTHANDLESTYLE
+#endif
+ListResult_t Util_ListDestroyGeneralMapClientHandleStyle(List_t **List_pp,
+ const ListDeleteFunctionGeneralMapClientHandleStyle_t DelFunc_p)
+{
+ ListResult_t Result = LIST_SUCCESS;
+ List_t *List_p = *List_pp;
+
+ PRE_CONDITION(NULL != List_p, return LIST_ERROR_INVALID_LIST);
+
+ /* traverse the list from the head */
+ List_p->Curr_p = List_p->Head_p;
+
+ while ((NULL != List_p->Curr_p) && (LIST_SUCCESS == Result))
+ Result = Util_ListDeleteGeneralMapClientHandleStyle(List_p,
+ DelFunc_p);
+
+ if (LIST_SUCCESS == Result) {
+ (*List_p->MemFreeFunc_p)(List_p);
+ *List_pp = NULL;
+ }
+ C_(printf("\nUtil_ListDestroy: Return = %d, List = 0x%x is destroyed",
+ Result, (int)List_p);)
+ return Result;
+}
+#endif /* REMOVE_UF_LISTDESTROYGENERALMAPCLIENTHANDLESTYLE */
+
+
+/*
+ * NAME
+ * Util_ListDelete
+ *
+ */
+#ifndef REMOVE_UF_LISTDELETE
+#ifdef REMOVE_UF_LISTREMOVE
+#undef REMOVE_UF_LISTREMOVE
+#endif
+ListResult_t Util_ListDelete(List_t *const List_p,
+ const ListDeleteFunction_t DelFunc_p)
+{
+ PRE_CONDITION(List_p != NULL, return LIST_ERROR_INVALID_LIST);
+
+ if (List_p->Curr_p == NULL) {
+ /* list is empty or no current element, nothing to remove */
+ B_(printf(
+ "\nUtil_ListDelete: LIST_ERROR_CURRENT_PTR_OFF_LIST, List = 0x%x is empty",
+ (int)List_p);)
+ return LIST_ERROR_CURRENT_PTR_OFF_LIST;
+ }
+
+ /* delete the element body using the application's delete callback */
+ if (DelFunc_p != NULL) {
+ C_(printf(
+ "\nUtil_ListDelete: Calling application delete function: List_p = 0x%x",
+ (int)List_p);)
+ (*(DelFunc_p)) (List_p->Curr_p->Body_p);
+ }
+
+ return Util_ListRemove(List_p);
+}
+#endif /* REMOVE_UF_LISTDELETE */
+
+/*
+ * NAME
+ * Util_ListDeleteGeneralMap
+ * Changes due to general map is propagated from destoy function
+ */
+#ifndef REMOVE_UF_LISTDELETEGENERALMAP
+#ifdef REMOVE_UF_LISTREMOVE
+#undef REMOVE_UF_LISTREMOVE
+#endif
+ListResult_t Util_ListDeleteGeneralMap(List_t *const List_p,
+ const ListDeleteFunctionGeneralMap_t DelFunc_p)
+{
+ PRE_CONDITION(NULL != List_p, return LIST_ERROR_INVALID_LIST);
+
+ if (NULL == List_p->Curr_p) {
+ /* list is empty or no current element, nothing to remove */
+ B_(printf(
+ "\nUtil_ListDelete: LIST_ERROR_CURRENT_PTR_OFF_LIST, List = 0x%x is empty",
+ (int)List_p);)
+ return LIST_ERROR_CURRENT_PTR_OFF_LIST;
+ }
+
+ /* delete the element body using the application's delete callback */
+ if (NULL != DelFunc_p) {
+ C_(printf(
+ "\nUtil_ListDelete: Calling application delete function: List_p = 0x%x",
+ (int)List_p);)
+ (*(DelFunc_p)) ((void *)List_p->Curr_p->EKey_p,
+ List_p->Curr_p->Body_p);
+ }
+
+ return Util_ListRemove(List_p);
+}
+#endif /* REMOVE_UF_LISTDELETEGENERALMAP */
+
+/*
+ * NAME
+ * Util_ListDeleteGeneralMapClientHandleStyle
+ * Changes due to general map and ClientHandle style is
+ * propagated from destoy function
+ *
+ */
+#ifndef REMOVE_UF_LISTDELETEGENERALMAPCLIENTHANDLESTYLE
+#ifdef REMOVE_UF_LISTREMOVE
+#undef REMOVE_UF_LISTREMOVE
+#endif
+ListResult_t Util_ListDeleteGeneralMapClientHandleStyle(List_t *const List_p,
+ const ListDeleteFunctionGeneralMapClientHandleStyle_t DelFunc_p)
+{
+ PRE_CONDITION(NULL != List_p, return LIST_ERROR_INVALID_LIST);
+
+ if (NULL == List_p->Curr_p) {
+ /* list is empty or no current element, nothing to remove */
+ B_(printf(
+ "\nUtil_ListDelete: LIST_ERROR_CURRENT_PTR_OFF_LIST, List = 0x%x is empty",
+ (int)List_p);)
+ return LIST_ERROR_CURRENT_PTR_OFF_LIST;
+ }
+
+ /* delete the element body using the application's delete callback */
+ if (NULL != DelFunc_p) {
+ C_(printf(
+ "\nUtil_ListDelete: Calling application delete function: List_p = 0x%x",
+ (int)List_p);)
+ (*(DelFunc_p)) (List_p->ClientHandle_p, NULL,
+ List_p->Curr_p->Body_p);
+ }
+
+ return Util_ListRemove(List_p);
+}
+#endif /* REMOVE_UF_LISTDELETEGENERALMAPCLIENTHANDLESTYLE */
+
+/*
+ * NAME
+ * Util_ListRemove
+ *
+ */
+#ifndef REMOVE_UF_LISTREMOVE
+ListResult_t Util_ListRemove(List_t *const List_p)
+{
+ PRE_CONDITION(List_p != NULL, return LIST_ERROR_INVALID_LIST);
+
+ if (List_p->Curr_p == NULL) {
+ /* list is empty or no current element, nothing to remove */
+ B_(printf(
+ "\nUtil_ListRemove: LIST_ERROR_CURRENT_PTR_OFF_LIST, List = 0x%x is empty",
+ (int)List_p);)
+ return LIST_ERROR_CURRENT_PTR_OFF_LIST;
+ }
+
+ List_p->NbrOfElements--;
+ if (List_p->Curr_p->Next_p == NULL) { /* tail?? */
+ if (List_p->Curr_p->Prev_p == NULL) { /* head?? */
+ /* list has only one element */
+ (*List_p->MemFreeFunc_p)(List_p->Curr_p);
+ List_p->Curr_p = NULL;
+ List_p->Head_p = NULL;
+ List_p->Tail_p = NULL;
+ } else {
+ /* item to be removed is at the tail of list */
+ List_p->Tail_p = List_p->Curr_p->Prev_p;
+ List_p->Tail_p->Next_p = NULL;
+ (*List_p->MemFreeFunc_p)(List_p->Curr_p);
+ List_p->Curr_p = List_p->Tail_p;
+ }
+ } else {
+ ListItem_t *Temp_p;
+
+ if (List_p->Curr_p->Prev_p == NULL) { /* head?? */
+ /* item to be removed is at the head of the list */
+ List_p->Head_p = List_p->Head_p->Next_p;
+ List_p->Head_p->Prev_p = NULL;
+ } else {
+ /* item to be removed is located in the middle
+ of the list */
+ List_p->Curr_p->Prev_p->Next_p = List_p->Curr_p->Next_p;
+ List_p->Curr_p->Next_p->Prev_p = List_p->Curr_p->Prev_p;
+ }
+
+ /* de-allocate memory and set current pointer to point
+ to next element in list. */
+ Temp_p = List_p->Curr_p->Next_p;
+ (*List_p->MemFreeFunc_p)(List_p->Curr_p);
+ List_p->Curr_p = Temp_p;
+ }
+ C_(printf(
+ "\nUtil_ListRemove: LIST_SUCCESS, Current element on List = 0x%x is removed",
+ (int)List_p);)
+
+ return LIST_SUCCESS;
+}
+#endif /* REMOVE_UF_LISTREMOVE */
+
+
+#ifndef REMOVE_UF_LISTPRINTDEBUG
+/*
+ * NAME
+ * Util_ListPrintDebug
+ *
+ */
+void Util_ListPrintDebug(List_t *const List_p,
+ const ListDebugFunction_t DbgFunc_p)
+{
+ PRE_CONDITION(List_p != NULL, C_(printf(
+ "\nInvalid List Specified");
+ ) return );
+
+ C_(printf("\nLIST STATUS:");)
+ if (List_p->Head_p == NULL) {
+ C_(printf(" Empty\n");)
+ C_(printf("DONE\n");)
+ } else {
+ ListItem_t *TempCurr_p = List_p->Curr_p;
+ uint16_t Index = 1;
+ IDENTIFIER_NOT_USED(Index); /*Removes Lint warning*/
+ if (List_p->Curr_p == NULL) {
+ C_(printf(" Off List: true");)
+ } else {
+ C_(printf(" Off List: false");)
+ }
+
+ C_(printf(" Head: 0x%x", (int)List_p->Head_p);)
+ C_(printf(" Tail: 0x%x", (int)List_p->Tail_p);)
+ C_(printf(" Current: 0x%x", (int)List_p->Curr_p);)
+ C_(printf(" NbrOfElements: %d", (int)List_p->NbrOfElements);)
+ C_(printf("\nLIST CONTENTS: ");)
+
+ List_p->Curr_p = List_p->Head_p;
+ while (List_p->Curr_p != NULL) {
+ C_(printf("\nElement number: %d", Index);)
+ Index++;
+ C_(printf("\n Element ptr: 0x%x",
+ (int)List_p->Curr_p);)
+ C_(printf("\n Contents ptr: 0x%x",
+ (int)List_p->Curr_p->Body_p);)
+ C_(printf("\n Key ptr: 0x%x\n",
+ (int)List_p->Curr_p->EKey_p);)
+ if (DbgFunc_p != NULL)
+ (*DbgFunc_p)(List_p->Curr_p->Body_p);
+
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+ }
+ C_(printf("DONE\n");)
+ List_p->Curr_p = TempCurr_p;
+ }
+}
+#endif /* REMOVE_UF_LISTPRINTDEBUG */
+
+#ifndef REMOVE_UF_LISTPRINTDEBUGGENERALMAP
+/*
+ * NAME
+ * Util_ListPrintDebugGeneralMap
+ * To comply with callforeach in general map style the callback
+ * declaration had to be modified
+ */
+void Util_ListPrintDebugGeneralMap(List_t *const List_p,
+ const ListDebugFunctionGeneralMap_t DbgFunc_p)
+{
+ PRE_CONDITION(NULL != List_p, C_(printf(
+ "\nInvalid List Specified");
+ ) return );
+
+ C_(printf("\nLIST STATUS:");)
+ if (NULL == List_p->Head_p) {
+ C_(printf(" Empty\n");)
+ C_(printf("DONE\n");)
+ } else {
+ ListItem_t *TempCurr_p = List_p->Curr_p;
+ uint16_t Index = 1;
+ IDENTIFIER_NOT_USED(Index); /* Removes Lint warning */
+ if (NULL == List_p->Curr_p) {
+ C_(printf(" Off List: true");)
+ } else {
+ C_(printf(" Off List: false");)
+ }
+
+ C_(printf(" Head: 0x%x", (int)List_p->Head_p);)
+ C_(printf(" Tail: 0x%x", (int)List_p->Tail_p);)
+ C_(printf(" Current: 0x%x", (int)List_p->Curr_p);)
+ C_(printf(" NbrOfElements: %d", (int)List_p->NbrOfElements);)
+ C_(printf("\nLIST CONTENTS: ");)
+
+ List_p->Curr_p = List_p->Head_p;
+ while (NULL != List_p->Curr_p) {
+ C_(printf("\nElement number: %d", Index);)
+ Index++;
+ C_(printf("\n Element ptr: 0x%x",
+ (int)List_p->Curr_p);)
+ C_(printf("\n Contents ptr: 0x%x",
+ (int)List_p->Curr_p->Body_p);)
+ C_(printf("\n Key ptr: 0x%x\n",
+ (int)List_p->Curr_p->EKey_p);)
+ if (NULL != DbgFunc_p)
+ (*DbgFunc_p)(NULL, List_p->Curr_p->Body_p, NULL,
+ NULL);
+
+ List_p->Curr_p = List_p->Curr_p->Next_p;
+ }
+ C_(printf("DONE\n");)
+ List_p->Curr_p = TempCurr_p;
+ }
+}
+#endif /* REMOVE_UF_LISTPRINTDEBUGGENERALMAP */
diff --git a/host/xtest/adbg/src/security_utils_hex.c b/host/xtest/adbg/src/security_utils_hex.c
new file mode 100644
index 0000000..913799c
--- /dev/null
+++ b/host/xtest/adbg/src/security_utils_hex.c
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+* 1. Includes
+*************************************************************************/
+#include <sys/param.h>
+#include <stdint.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "security_utils_hex.h"
+
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+
+/*************************************************************************
+* 2. Definition of external constants and variables
+*************************************************************************/
+
+/*************************************************************************
+* 3. File scope types, constants and variables
+*************************************************************************/
+static const char SecUtil_HexChars[] = {
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
+};
+/*************************************************************************
+* 4. Declaration of file local functions
+*************************************************************************/
+
+/*************************************************************************
+* 5. Definition of external functions
+*************************************************************************/
+#if 0
+void SecBase_HexPrintBuffer(
+ const char *Prefix_p,
+ const char *Postfix_p,
+ const char *BufferName_p,
+ const void *Buffer_p,
+ size_t BufferLength
+ )
+{
+ char LineBuf[67];
+ size_t LinePos = 0;
+ const uint8 *Data_p = Buffer_p;
+ size_t n;
+ char EmptyString[] = "";
+
+ if (Prefix_p == NULL)
+ Prefix_p = EmptyString;
+ if (Postfix_p == NULL)
+ Postfix_p = EmptyString;
+
+ if (BufferName_p != NULL) {
+ DELAY_MS(5);
+ printf("%s%s: Size: %d%s", Prefix_p, BufferName_p, BufferLength,
+ Postfix_p);
+ }
+
+ /* Initialize the line buffer for a new line */
+ SEC_MEM_SET(LineBuf, ' ', sizeof(LineBuf));
+ LineBuf[sizeof(LineBuf) - 1] = '\0';
+ LinePos = 0;
+ for (n = 0; n < BufferLength; n++) {
+ char Separator;
+ char PrintableChar;
+
+ if (((n + 1) % 4) == 0)
+ Separator = ' ';
+ else
+ Separator = ':';
+
+ if (isprint(Data_p[n]))
+ PrintableChar = (char)Data_p[n];
+ else
+ PrintableChar = '.';
+
+ LineBuf[LinePos * 3 + 0] = SecBase_HexChars[Data_p[n] >> 4];
+ LineBuf[LinePos * 3 + 1] = SecBase_HexChars[Data_p[n] & 0x0F];
+ LineBuf[LinePos * 3 + 2] = Separator;
+ LineBuf[50 + LinePos] = PrintableChar;
+
+ LinePos++;
+ if (LinePos == 16) {
+ DELAY_MS(5);
+ printf("%s%s%s", Prefix_p, LineBuf, Postfix_p);
+ /* Initialize the line buffer for a new line */
+ SEC_MEM_SET(LineBuf, ' ', sizeof(LineBuf));
+ LineBuf[sizeof(LineBuf) - 1] = '\0';
+ LinePos = 0;
+ }
+ }
+ if (LinePos != 0) {
+ DELAY_MS(5);
+ printf("%s%s%s", Prefix_p, LineBuf, Postfix_p);
+ }
+ (void)fflush(stdout);
+}
+#endif
+
+#if 0
+void SecUtil_CHexPrintBuffer(
+ const char *Prefix_p,
+ const char *Postfix,
+ const void *Buffer_p,
+ size_t BufferLength
+ )
+{
+ char LineBuf[84];
+ const uint8 *Data_p = Buffer_p;
+ size_t n;
+ char EmptyString[] = "";
+ static const SecUtil_HexFormat_t HexFormat = { "0x", ", ", ", " };
+
+ if (Prefix_p == NULL)
+ Prefix_p = EmptyString;
+ if (Postfix == NULL)
+ Postfix = EmptyString;
+
+ for (n = 0; n < BufferLength; n += 16) {
+ (void)SecUtil_BufferToHex(Data_p + n, MIN(16, BufferLength - n),
+ &HexFormat,
+ LineBuf, sizeof(LineBuf));
+ DELAY_MS(5);
+ printf("%s%s%s", Prefix_p, LineBuf, Postfix);
+ }
+}
+#endif
+
+size_t SecUtil_BufferToHex(
+ const void *const Buffer_p,
+ size_t BufferLength,
+ const SecUtil_HexFormat_t *const HexFormat_p,
+ char *const Destination_p,
+ const size_t DestinationLength
+ )
+{
+ const uint8_t *Data_p = Buffer_p;
+ size_t UsedDestLength;
+ size_t n;
+ const char *ByteSeparator_p = NULL;
+ const char *GroupSeparator_p = NULL;
+ const char *BytePrefix_p = NULL;
+ size_t BytePrefixLength;
+
+ if (DestinationLength > 1)
+ Destination_p[0] = '\0';
+
+ UsedDestLength = 1;
+
+ if (HexFormat_p != NULL) {
+ BytePrefix_p = HexFormat_p->BytePrefix_p;
+ ByteSeparator_p = HexFormat_p->ByteSeparator_p;
+ GroupSeparator_p = HexFormat_p->GroupSeparator_p;
+ }
+
+ if (BytePrefix_p == NULL)
+ BytePrefix_p = "";
+
+ BytePrefixLength = strlen(BytePrefix_p);
+
+ if (ByteSeparator_p == NULL)
+ ByteSeparator_p = ":";
+
+ if (GroupSeparator_p == NULL)
+ GroupSeparator_p = " ";
+
+ /*
+ * This for loop is unnecessarily complicated due to
+ * the absense of both snprintf and strlcat
+ */
+ for (n = 0; n < BufferLength; n++) {
+ const char *Separator_p;
+ size_t SeparatorLength;
+
+ /* Establish separator for this byte and the next */
+ if (n == BufferLength - 1)
+ Separator_p = "";
+ else if ((n + 1) % 4 == 0)
+ Separator_p = GroupSeparator_p;
+ else
+ Separator_p = ByteSeparator_p;
+
+ SeparatorLength = strlen(Separator_p);
+
+ /* Insert the Byte prefix */
+ if (UsedDestLength < DestinationLength) {
+ size_t CopyLength;
+
+ CopyLength = MIN(BytePrefixLength,
+ DestinationLength - UsedDestLength);
+ memcpy(Destination_p + UsedDestLength - 1, BytePrefix_p,
+ CopyLength);
+ Destination_p[UsedDestLength - 1 + CopyLength] = '\0';
+ }
+ UsedDestLength += BytePrefixLength;
+
+ /* Insert the first nibble of the ASCII hexadecimal byte */
+ if (UsedDestLength < DestinationLength) {
+ Destination_p[UsedDestLength -
+ 1] = SecUtil_HexChars[Data_p[n] >> 4];
+ Destination_p[UsedDestLength] = '\0';
+ }
+ UsedDestLength++;
+
+ /* Insert the second nibble of the ASCII hexadecimal byte */
+ if (UsedDestLength < DestinationLength) {
+ Destination_p[UsedDestLength -
+ 1] = SecUtil_HexChars[Data_p[n] & 0x0F];
+ Destination_p[UsedDestLength] = '\0';
+ }
+ UsedDestLength++;
+
+ /* Insert the separator */
+ if (UsedDestLength < DestinationLength) {
+ size_t CopyLength;
+
+ CopyLength = MIN(SeparatorLength,
+ DestinationLength - UsedDestLength);
+ memcpy(Destination_p + UsedDestLength - 1, Separator_p,
+ CopyLength);
+ Destination_p[UsedDestLength - 1 + CopyLength] = '\0';
+ }
+ UsedDestLength += SeparatorLength;
+ }
+ return UsedDestLength;
+}
+
+/*************************************************************************
+* 6. Definition of internal functions
+*************************************************************************/
diff --git a/host/xtest/adbg/src/security_utils_hex.h b/host/xtest/adbg/src/security_utils_hex.h
new file mode 100644
index 0000000..b5847af
--- /dev/null
+++ b/host/xtest/adbg/src/security_utils_hex.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef INCLUSION_GUARD_UTILS_HEX_H
+#define INCLUSION_GUARD_UTILS_HEX_H
+/*************************************************************************
+* 1. Includes
+*************************************************************************/
+
+/*************************************************************************
+* 2. Types, constants and external variables
+*************************************************************************/
+
+#if 0 /* Should format into a buffer instead */
+/**
+ **************************************************************************
+ * Prints data hexadecimally to stdout
+ *
+ * Each line of binary data is printed as 66 characters on the format
+ * shown below:
+ * XX:XX:XX:XX XX:XX:XX:XX XX:XX:XX:XX XX:XX:XX:XX xxxxxxxxxxxxxxxx
+ *
+ * @param [in] Prefix_p String printed first each line, may be NULL
+ * to indicate the empty string
+ * @param [in] Postfix_p String printed last each line, may be NULL
+ * to indicate the empty string
+ * @param [in] BufferName_p Name of the buffer, if != NULL the name of the
+ * buffer is printed together with the length of
+ * the buffer before the data is printed
+ * @param [in] Buffer_p Pointer to a buffer holding the data
+ * @param [in] BufferLength Length of the buffer above
+ *
+ * @sigbased No
+ * @waitmode Wait mode
+ **************************************************************************/
+void SecUtil_HexPrintBuffer(const char *Prefix_p, const char *Postfix_p,
+ const char *BufferName_p, const void *Buffer_p,
+ size_t BufferLength);
+#endif
+
+#if 0
+/**
+ **************************************************************************
+ * Prints data hexadecimally in a format suitable for initialization of
+ * an array in c.
+ *
+ * 0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,0xXX,
+ * 0xXX,0xXX,
+ *
+ * @param [in] Prefix_p String printed first each line, may be NULL
+ * to indicate the empty string
+ * @param [in] Postfix_p String printed last each line, may be NULL
+ * to indicate the empty string
+ * @param [in] Buffer_p Pointer to a buffer holding the data
+ * @param [in] BufferLength Length of the buffer above
+ *
+ * @sigbased No
+ * @waitmode Wait mode
+ **************************************************************************/
+void SecUtil_CHexPrintBuffer(const char *Prefix_p, const char *Postfix_p,
+ const void *Buffer_p, size_t BufferLength);
+#endif
+
+/**************************************************************************
+* Specifies how hexadecial data should be formated
+*
+* @param BytePrefix_p ASCII string prefix for each hexadecimal
+* byte printed (for example "0x"). If NULL
+* nothing is inserted in front of a byte.
+* @param ByteSeparator_p ASCII string to insert between each printed
+* hexadecimal byte. If NULL a ":" is inserted
+* between each hexadecial byte.
+* @param GroupSeparator_p ASCII string to insert instead of
+* ByteSeparator_p between each group
+* of printed hexadecimal bytes. If NULL " "
+* is used as group separator.
+**************************************************************************/
+typedef struct {
+ const char *BytePrefix_p;
+ const char *ByteSeparator_p;
+ const char *GroupSeparator_p;
+} SecUtil_HexFormat_t;
+
+/*************************************************************************
+* 3. Functions
+*************************************************************************/
+
+/****************************************************************************
+ * Formats data hexadecimally into an NULL terminated ASCII string in
+ * the format below.
+ *
+ * 0xXX:0xXX:0xXX:0xXX 0xXX:0xXX:0xXX:0xXX
+ * 0xXX:0xXX:0xXX:0xXX 0xXX:0xXX:0xXX:0xXX
+ *
+ * The colons and spaces in the result can be cusomized with ByteSeparator_p
+ * and GroupSeparator_p respectivly.
+ *
+ * @param [in] Buffer_p Pointer to a buffer holding the data
+ * @param [in] BufferLength Length of the buffer above
+ * @param [in] HexFormat_p How the data should be formatted
+ * @param [in, out] Destination_p Output ASCII buffer
+ * @param [in] DestinationLength Length of output buffer
+ *
+ * @returns The size of a needed DestinationLength, if greater than supplied
+ * DestinationLength the result in Destination_p is truncated but
+ * still NULL terminated.
+ * @sigbased No
+ * @waitmode Wait mode
+ **************************************************************************/
+
+size_t SecUtil_BufferToHex(const void *const Buffer_p, size_t BufferLength,
+ const SecUtil_HexFormat_t *const HexFormat_p,
+ char *const Destination_p,
+ const size_t DestinationLength);
+
+#endif /*INCLUSION_GUARD_UTILS_HEX_H*/
diff --git a/host/xtest/adbg/src/security_utils_mem.c b/host/xtest/adbg/src/security_utils_mem.c
new file mode 100644
index 0000000..f5b9acb
--- /dev/null
+++ b/host/xtest/adbg/src/security_utils_mem.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+/*************************************************************************
+* 1. Includes
+*************************************************************************/
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include "security_utils_mem.h"
+
+/*************************************************************************
+* 2. Definition of external constants and variables
+*************************************************************************/
+
+/*************************************************************************
+* 3. File scope types, constants and variables
+*************************************************************************/
+
+/*************************************************************************
+* 4. Declaration of file local functions
+*************************************************************************/
+
+static uint32_t MWC_Random(void *Pointer_p);
+
+/*************************************************************************
+* 5. Definition of external functions
+*************************************************************************/
+char *SecUtil_Heap_StrDup(
+ const char *const String_p,
+ const bool Unsafe,
+ const char *const File_p,
+ const unsigned int Line
+ )
+{
+ (void)&Unsafe;
+ (void)&File_p;
+ (void)&Line;
+ return strdup(String_p);
+}
+
+void SecUtil_WipeMemory(
+ void *const Buffer_p,
+ const size_t BufferLength
+ )
+{
+ uint8_t *p = Buffer_p;
+ size_t n;
+ uint32_t Number;
+
+ for (n = 0; n < BufferLength; n++)
+ p[n] = (uint8_t)n;
+
+ memset(p, 0xAA, BufferLength);
+ memset(p, 0x55, BufferLength);
+
+ for (n = 0; n < BufferLength / sizeof(uint32_t); n++) {
+ Number = MWC_Random(Buffer_p);
+ memcpy(p + n, &Number, sizeof(uint32_t));
+ }
+
+ n = (n - 1) * sizeof(uint32_t);
+
+/* Add the last bytes which didn't fill a complete uint32_t */
+ Number = MWC_Random(Buffer_p);
+ for (; n < BufferLength; n++) {
+ p[n] = 0xF & (uint8_t)Number;
+ Number >>= 8;
+ }
+}
+
+void SecUtil_SecureHeapFree_helper(
+ void **const Buffer_pp
+ )
+{
+ if (Buffer_pp != NULL) {
+ if (*Buffer_pp != NULL) {
+ free(*Buffer_pp);
+ *Buffer_pp = NULL;
+ }
+ }
+}
+
+/*************************************************************************
+* 6. Definition of internal functions
+*************************************************************************/
+
+/*
+ * There may be concurrent calls to this function but it doesn't matter,
+ * the result will still be hard to predict.
+ *
+ * Inspiration for implementation of this function was collected from
+ * http://www.bobwheeler.com/statistics/Password/MarsagliaPost.txt
+ * It doesn't seem to have any specified license, but in any case
+ * this a somewhat different implementation.
+ */
+static uint32_t MWC_Random(void *Pointer_p)
+{
+ static uint32_t static_z;
+ static uint32_t static_w;
+ static bool Initialized;
+/*
+ * In case of concurrent access, use private variables for
+ * the actual calculation.
+ */
+ uint32_t z = static_z;
+ uint32_t w = static_w;
+
+ if (!Initialized) {
+ z = 362436069 * ((uint32_t)(uintptr_t)Pointer_p >> 16);
+ w = 521288629 * ((uint32_t)(uintptr_t)Pointer_p & 0xFFFF);
+ Initialized = true;
+ }
+
+ z = 36969 * (z & 65535) + (z >> 16);
+ w = 18000 * (w & 65535) + (w >> 16);
+
+ static_z = z;
+ static_w = w;
+
+ return (z << 16) + (w & 65535);
+}
diff --git a/host/xtest/adbg/src/security_utils_mem.h b/host/xtest/adbg/src/security_utils_mem.h
new file mode 100644
index 0000000..831710f
--- /dev/null
+++ b/host/xtest/adbg/src/security_utils_mem.h
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef INCLUSION_GUARD_SECURITY_UTILS_MEM_H
+#define INCLUSION_GUARD_SECURITY_UTILS_MEM_H
+
+/*************************************************************************
+* 1. Includes
+*************************************************************************/
+
+#include <stdbool.h>
+/*************************************************************************
+* 2. Types, constants and external variables
+*************************************************************************/
+
+/*************************************************************************
+* 3. Functions and macros
+*************************************************************************/
+
+/**
+ * Creates an allocated copy if a string while keeping track of
+ * where the memory allocation was initiated.
+ *
+ * The copy should later be freed with HEAP_FREE
+ *
+ * @param in String_p The string to be copied
+ *
+ * @return Returns a pointer to a copy of String_p on success and NULL
+ * if memory allocation failed.
+ */
+#define SECUTIL_HEAP_STRDUP(String_p) \
+ SecUtil_Heap_StrDup((String_p), false, __FILE__, __LINE__)
+
+/**
+ * Creates an allocated copy if a string while keeping track of
+ * where the memory allocation was initiated.
+ *
+ * The copy should later be freed with HEAP_UNSAFE_FREE
+ *
+ * @param in String_p The string to be copied
+ *
+ * @return Returns a pointer to a copy of String_p on success and NULL
+ * if memory allocation failed.
+ */
+#define SECUTIL_HEAP_UNSAFE_STRDUP(String_p) \
+ SecUtil_Heap_StrDup((String_p), true, __FILE__, __LINE__)
+
+/**
+ * This function is a helper function for the two macros
+ * SECUTIL_HEAP_STRDUP and SECUTIL_HEAP_UNSAFE_STRDUP.
+ *
+ * The function allocates sufficient memroy for
+ * a copy of the string String_p.
+ *
+ * @param in String_p The string to be copied
+ * @param in Unsafe If true use HEAP_UNSAFE_UNTYPED_ALLOC_DBG else
+ * use HEAP_UNTYPED_ALLOC_DBG
+ * @param in File_p Name of the file where the function is called
+ * @param in Line Line number of the file where the function is called
+ *
+ * @return Returns a pointer to a copy of String_p on success and NULL
+ * if memory allocation failed.
+ */
+char *SecUtil_Heap_StrDup(const char *const String_p, const bool Unsafe,
+ const char *const File_p, const unsigned int Line);
+
+/**
+ * Wipes the buffer using several different bit patterns to avoid
+ * leaking information.
+ *
+ * This function should preferably be used as a help function in
+ * a FREE macro.
+ *
+ * @param in Buffer_p Pointer to the buffer to wipe
+ * @param in BufferLength Length (in bytes) of the buffer to wipe
+ */
+void SecUtil_WipeMemory(void *const Buffer_p, const size_t BufferLength);
+
+
+/*
+ * Modules using the SECURE_HEAP macros below should use them through
+ * a private define. This makes it easier during code inspection to see
+ * that the policy for handling memory is consistent.
+ */
+
+/**
+ * Macro for secure memory allocation. Only a wrapper for
+ * HEAP_ALLOC. The interesting part is SECUTIL_SECURE_HEAP_FREE
+ * below.
+ *
+ * @param in Type The type that memory should be allocated for
+ *
+ * @return a pointer to a buffer large enough to hald the supplied type,
+ * or NULL on failure.
+ */
+#define SECUTIL_SECURE_HEAP_ALLOC(Type) HEAP_ALLOC((TypeNmae))
+
+/**
+ * Macro for secure memory allocation. Only a wrapper for
+ * HEAP_UNTYPED_ALLOC. The interesting part is SECUTIL_SECURE_HEAP_FREE
+ * below.
+ *
+ * @param in Size The size of the buffer to be allocated
+ *
+ * @return a pointer to a buffer of the specified size,
+ * or NULL on failure.
+ */
+#define SECUTIL_SECURE_UNTYPED_HEAP_ALLOC(Size) \
+ HEAP_UNTYPED_ALLOC((Size))
+
+/**
+ * Macro for secure memory free. Secure is in the sense that information
+ * leakage is avoided by wiping the memory before it's released.
+ *
+ * Note that buffer must have been allocated with SECUTIL_SECURE_HEAP_ALLOC
+ * or SECUTIL_SECURE_UNTYPED_HEAP_ALLOC before of anything could happen
+ * (most likely a crash).
+ *
+ * @param in Buffer_pp A pointer to a pointer of the buffer to free.
+ */
+#define SECUTIL_SECURE_HEAP_FREE(Buffer_pp) \
+ SecUtil_SecureHeapFree_helper((void **)(Buffer_pp))
+
+
+/**
+ * Helper function for SECUTIL_SECURE_HEAP_FREE. The function
+ * calls HEAP_BUFFER_SIZE to determine the size of the buffer
+ * and then calls SecUtil_WipeMemory to wipe the memory. Finally
+ * the buffer is freed with HEAP_FREE
+ *
+ * If the supplied buffer is NULL this function does nothing.
+ *
+ * Note that the buffer has be allocated with HEAP_ALLOC or
+ * HEAP_UNTYPED_HEAP_ALLOC before or anything could happen.
+ *
+ * @param in Buffer_pp A pointer to a pointer of the buffer to
+ * wipe and free
+ */
+void SecUtil_SecureHeapFree_helper(void **const Buffer_pp);
+
+/**
+ * Macro for unaligned memcpy(). To be used when source or destination
+ * may not be properly aligned. Usage of this macro will only affect
+ * performance when copying large chunks of data (which is already
+ * present in the memory cache).
+ *
+ * Use this macro if you cannot guarantee that the pointers
+ * have properly aligned values.
+ */
+#define SEC_MEMCPY_UNALIGNED(x, y, z) \
+ do { \
+ void *memcpy_hack_dst = (x); \
+ const void *memcpy_hack_src = (y); \
+ memcpy(memcpy_hack_dst, memcpy_hack_src, (z)); \
+ } while (0)
+
+/**
+ * Macros for secure erase.
+ */
+#define SECUTIL_SECURE_ERASE_UINT32(X) { \
+ *((volatile uint32*)(&X)) = 0 }
+
+#define SECUTIL_SECURE_ERASE_UINT16(X) { \
+ *((volatile uint16*)(&X)) = 0 }
+
+#define SECUTIL_SECURE_ERASE_UINT8(X) { \
+ *((volatile uint8*)(&X)) = 0 }
+
+#define SECUTIL_SECURE_ERASE_BOOLEAN(X) { \
+ *((volatile bool*)(&X)) = 0 }
+
+#define SECUTIL_SECURE_ERASE_ARRAY(X) { \
+ memset(((void *)(X)), 0x0, sizeof(X)) }
+
+#define SECUTIL_SECURE_ERASE_TYPED_ARRAY(X) { \
+ SECUTIL_SECURE_ERASE_UNTYPED_ARRAY(X, sizeof(X)) }
+
+#define SECUTIL_SECURE_ERASE_UNTYPED_ARRAY(X, L) { \
+ memset(((void *)(X)), 0x0, L) }
+
+#define SECUTIL_SECURE_ERASE_STRUCT(X) { \
+ memset(((void *)(&X)), 0x0, sizeof(X)) }
+
+#endif /* INCLUSION_GUARD_SECURITY_UTILS_MEM_H */
diff --git a/host/xtest/adbg/src/t_list.h b/host/xtest/adbg/src/t_list.h
new file mode 100644
index 0000000..0a64f83
--- /dev/null
+++ b/host/xtest/adbg/src/t_list.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef INCLUSION_GUARD_T_LIST_H
+#define INCLUSION_GUARD_T_LIST_H
+
+/*************************************************************************
+**************************************************************************
+*
+* DESCRIPTION:
+*
+* Header file containing external type declaration for the doubly linked
+* list category "list"
+*
+*************************************************************************/
+
+#include <stddef.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define List_t DL_List_t
+
+/**
+ * The client using the Util_ListDelete() and Util_ListDestroy()
+ * functions can provide a function that knows how to delete the client's
+ * elements. This is to simplify the client's code when destroying the list.
+ */
+typedef void (*ListDeleteFunction_t)(void *);
+
+/**
+ * Compare with ListDeleteFunction_t. Key and value is handled separately in
+ * general map style.
+ *
+ * @param [in, out] Key_p A pointer to the elements key for the element to be removed.
+ * @param [in, out] Value_p A pointer to the elements body for the element to be removed.
+ * @return void
+ */
+
+typedef void (*ListDeleteFunctionGeneralMap_t)(void *Key_p, void *Value_p);
+
+/**
+ * Compare with ListDeleteFunctionGeneralMap_t. Extra parameter for client handle
+ * used for ClientHandle style callbacks
+ *
+ * @param [in] ClientHandle_p A pointer to client handle.
+ * @param [in, out] Key_p A pointer to the element's key for the element to be removed.
+ * @param [in, out] Value_p A pointer to the element's body for the element to be removed.
+ * @return void
+ */
+typedef void (*ListDeleteFunctionGeneralMapClientHandleStyle_t)(const void *
+ const
+ ClientHandle_p,
+ void *Key_p,
+void *Value_p);
+
+/**
+ * This is a help function provided by the client. The function should
+ * print information about the client's elements. The function is used
+ * when printing the content of a list using Util_ListPrintDebug().
+ * The list library function prints information about the list while
+ * the client's function prints information about the elements that
+ * are in the list. One special version exist for General Map callback.
+ */
+
+typedef void (*ListDebugFunction_t)(void *);
+
+/**
+ * Compare with ListDebugFunction_t, this function type is harmonized with the
+ * style used in general Map. The ListDebugFunctionGeneralMap_t function
+ * is applied to each element when scanning through the entire List.
+ *
+ * @param [in] Key_p A pointer to the element's key for the current element
+ * (i.e. the element currently being iterated)
+ * @param [in, out] Value_p A pointer to the element's body for the current element
+ * (i.e. the element currently being iterated)
+ * @param [in, out] Data_pp A pointer to client's data (may also be used as output data)
+ * @param [in, out] Break_p TRUE if the client wants to break the iteration loop. FALSE
+ * otherwise.
+ *
+ *
+ */
+
+typedef void (*ListDebugFunctionGeneralMap_t)(const void *const Key_p,
+ void *const Value_p,
+ void **const Data_pp,
+ bool *const Break_p);
+
+/**
+ * This is a key comparison function provided by the client.
+ * When adding an element into a list, the client may provide a key.
+ * The key may then be used to find the element in the list.
+ * When the data type of the key is other than an integer
+ * (when Util_EListMatchingKey() is used) or an ascii string
+ * (when Util_ListMatchingKey() is used), the client has to provide a
+ * ListKeyMatchingFunction_t function that is called when comparing keys.
+ */
+
+typedef bool (*ListKeyMatchingFunction_t)(const void *, const void *);
+
+/**
+ * Compare with ListKeyMatchingFunction_t, only added an extra parameter for client handle
+ * used for ClientHandle style callbacks
+ *
+ * @param [in] ClientHandle_p A pointer to client handle.
+ * @param [in] KeyA_p A pointer to the first key. Must not be NULL.
+ * @param [in] KeyB_p A pointer to the second key. Must not be NULL.
+ * @return bool TRUE if the first and second key are identical.
+ * FALSE otherwise
+ */
+typedef bool (*ListKeyMatchingFunctionClientHandleStyle_t)(const void *
+ ClientHandle_p,
+ const void *KeyA_p,
+ const void *KeyB_p);
+
+/**
+ * This is a memory allocation function provided by the client.
+ * The client using Util_EListCreate() provides a memory allocation function.
+ * This may be useful in cases where a list is created in one context
+ * and freed in another context. Note that this usage (e.g. a list being
+ * used to share information between two or more processes) is strongly
+ * discouraged. Use Util_ListCreate() instead
+ */
+
+typedef void * (*ListMemAllocFunction_t)(size_t);
+
+/**
+ * This is a memory de-allocation function provided by the client.
+ * The client using Util_EListCreate() provides a memory allocation
+ * and de-allocation functions. This may be useful in cases where a
+ * list is created in one context and freed in another context.
+ * Note that this usage (e.g. a list being used to share information
+ * between two or more processes) is strongly discouraged.
+ * Use Util_ListCreate() instead.
+ */
+
+typedef void (*ListMemFreeFunction_t)(void *);
+
+
+/**
+ * Type used to link element in the list. LListItem is not publicized.
+ */
+
+typedef struct LListItem ListItem_t;
+
+/**
+ * Type used to hold a linked list. A pointer to a list is returned
+ * to the client after a call to Util_ListCreate(). Then, the list
+ * pointer is used as input to the other functions in the category.
+ * DL_List is not publicized.
+ */
+
+typedef struct DL_List DL_List_t;
+
+/**
+ * Completion code returned by some of the linked list library functions.
+ * The constant names are self explanatory.
+ */
+
+enum {
+ LIST_SUCCESS = 0,
+ LIST_ERROR_COULD_NOT_ALLOC_MEM,
+ LIST_ERROR_INVALID_LIST,
+ LIST_ERROR_INVALID_PARAM,
+ LIST_ERROR_CURRENT_PTR_OFF_LIST,
+ LIST_ERROR_NO_MATCH_FOUND,
+ LIST_ERROR_UNKNOWN
+};
+typedef uint8_t ListResult_t;
+
+
+/**
+ * The list status indicates whether conditions of interest
+ *
+ * \li a) whether the list is empty
+ * \li b) whether the current pointer points to the head
+ * \li c) whether the current pointer points to the tail
+ * \li d) whether the current pointer does not point inside the list
+ * \li e) whether the list is valid (ie. list pointer is not NULL)
+ *
+ * Note: b) and c) can be true at the same time.
+ *
+ */
+
+enum {
+ LIST_STATUS_NOTHING_TO_REPORT = 0x00,
+ LIST_STATUS_PTR_TO_TAIL = 0x01, /* to be used as bit mask */
+ LIST_STATUS_PTR_TO_HEAD = 0x02, /* to be used as bit mask */
+ LIST_STATUS_PTR_OFF_LIST = 0x04, /* 2 LSB must be 0 */
+ LIST_STATUS_LIST_EMPTY = 0x08, /* 2 LSB must be 0 */
+ LIST_STATUS_INVALID_LIST = 0x80
+};
+typedef uint8_t ListStatus_t;
+
+#endif /* INCLUSION_GUARD_T_LIST_H */
diff --git a/host/xtest/adbg_case_declare.h b/host/xtest/adbg_case_declare.h
new file mode 100644
index 0000000..7a76393
--- /dev/null
+++ b/host/xtest/adbg_case_declare.h
@@ -0,0 +1,734 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef ADBG_CASE_DECLARE_H
+#define ADBG_CASE_DECLARE_H
+
+#define ADBG_CASE_DECLARE_AUTO_GENERATED_TESTS() \
+ ADBG_CASE_DECLARE(XTEST_TEE_7001);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7002);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7003);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7004);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7005);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7006);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7007);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7008);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7009);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7010);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7011);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7012);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7013);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7014);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7015);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7016);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7017);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7018);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7019);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7020);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7021);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7022);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7023);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7024);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7025);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7026);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7027);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7028);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7029);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7030);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7031);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7032);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7033);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7034);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7035);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7036);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7037);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7038);\
+ \
+ ADBG_CASE_DECLARE(XTEST_TEE_7501);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7502);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7503);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7504);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7505);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7506);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7507);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7508);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7509);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7510);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7511);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7512);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7513);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7514);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7515);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7516);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7517);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7518);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7519);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7520);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7521);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7522);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7523);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7524);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7525);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7526);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7527);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7528);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7529);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7530);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7531);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7532);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7533);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7534);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7535);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7536);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7537);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7538);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7539);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7540);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7541);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7542);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7543);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7544);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7545);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7546);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7547);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7548);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7549);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7550);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7551);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7552);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7553);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7554);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7555);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7556);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7557);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7558);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7559);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7560);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7561);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7562);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7563);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7564);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7565);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7566);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7567);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7568);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7569);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7570);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7571);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7572);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7573);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7574);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7575);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7576);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7577);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7578);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7579);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7580);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7581);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7582);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7583);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7584);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7585);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7586);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7587);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7588);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7589);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7590);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7591);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7592);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7593);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7594);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7595);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7596);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7597);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7598);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7599);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7600);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7601);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7602);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7603);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7604);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7605);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7606);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7607);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7608);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7609);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7610);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7611);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7612);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7613);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7614);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7615);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7616);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7617);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7618);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7619);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7620);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7621);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7622);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7623);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7624);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7625);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7626);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7627);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7628);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7629);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7630);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7631);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7632);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7633);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7634);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7635);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7636);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7637);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7638);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7639);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7640);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7641);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7642);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7643);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7644);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7645);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7646);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7647);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7648);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7649);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7650);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7651);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7652);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7653);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7654);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7655);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7656);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7657);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7658);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7659);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7660);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7661);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7662);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7663);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7664);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7665);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7666);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7667);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7668);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7669);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7670);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7671);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7672);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7673);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7674);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7675);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7676);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7677);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7678);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7679);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7680);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7681);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7682);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7683);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7684);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7685);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7686);\
+ ADBG_CASE_DECLARE(XTEST_TEE_7687);\
+ \
+ ADBG_CASE_DECLARE(XTEST_TEE_8001);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8002);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8003);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8004);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8005);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8006);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8007);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8008);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8009);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8010);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8011);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8012);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8013);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8014);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8015);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8016);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8017);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8018);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8019);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8020);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8021);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8022);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8023);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8024);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8025);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8026);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8027);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8028);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8029);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8030);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8031);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8032);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8033);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8034);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8035);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8036);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8037);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8038);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8039);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8040);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8041);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8042);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8043);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8044);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8045);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8046);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8047);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8048);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8049);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8050);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8051);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8052);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8053);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8054);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8055);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8056);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8057);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8058);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8059);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8060);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8061);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8062);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8063);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8064);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8065);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8066);\
+ \
+ ADBG_CASE_DECLARE(XTEST_TEE_8501);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8502);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8503);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8504);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8505);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8506);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8507);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8508);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8509);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8510);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8511);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8512);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8513);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8514);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8515);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8516);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8517);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8518);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8519);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8520);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8521);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8522);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8523);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8524);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8525);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8526);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8527);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8528);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8529);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8530);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8531);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8532);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8533);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8534);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8535);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8536);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8537);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8538);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8539);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8540);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8541);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8542);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8543);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8544);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8545);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8546);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8547);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8548);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8549);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8550);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8551);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8552);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8553);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8554);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8555);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8556);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8557);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8558);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8559);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8560);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8561);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8562);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8563);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8564);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8565);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8566);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8567);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8568);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8569);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8570);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8571);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8572);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8573);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8574);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8575);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8576);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8577);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8578);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8579);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8580);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8581);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8582);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8583);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8584);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8585);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8586);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8587);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8588);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8589);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8590);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8591);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8592);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8593);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8594);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8595);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8596);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8597);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8598);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8599);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8600);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8601);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8602);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8603);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8604);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8605);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8606);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8607);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8608);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8609);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8610);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8611);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8612);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8613);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8614);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8615);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8616);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8617);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8618);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8619);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8620);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8621);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8622);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8623);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8624);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8625);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8626);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8627);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8628);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8629);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8630);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8631);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8632);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8633);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8634);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8635);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8636);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8637);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8638);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8639);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8640);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8641);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8642);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8643);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8644);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8645);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8646);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8647);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8648);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8649);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8650);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8651);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8652);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8653);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8654);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8655);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8656);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8657);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8658);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8659);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8660);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8661);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8662);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8663);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8664);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8665);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8666);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8667);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8668);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8669);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8670);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8671);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8672);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8673);\
+ ADBG_CASE_DECLARE(XTEST_TEE_8674);\
+ \
+ ADBG_CASE_DECLARE(XTEST_TEE_9001);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9002);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9003);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9004);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9005);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9006);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9007);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9008);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9009);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9010);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9011);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9012);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9013);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9014);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9015);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9016);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9017);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9018);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9019);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9020);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9021);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9022);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9023);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9024);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9025);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9026);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9027);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9028);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9029);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9030);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9031);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9032);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9033);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9034);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9035);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9036);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9037);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9038);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9039);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9040);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9041);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9042);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9043);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9044);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9045);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9046);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9047);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9048);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9049);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9050);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9051);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9052);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9053);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9054);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9055);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9056);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9057);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9058);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9059);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9060);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9061);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9062);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9063);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9064);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9065);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9066);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9067);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9068);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9069);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9070);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9071);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9072);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9073);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9074);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9075);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9076);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9077);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9078);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9079);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9080);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9081);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9082);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9083);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9084);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9085);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9086);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9087);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9088);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9089);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9090);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9091);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9092);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9093);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9094);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9095);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9096);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9097);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9098);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9099);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9100);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9101);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9102);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9103);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9104);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9105);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9106);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9107);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9108);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9109);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9110);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9111);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9112);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9113);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9114);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9115);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9116);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9117);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9118);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9119);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9120);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9121);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9122);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9123);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9124);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9125);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9126);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9127);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9128);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9129);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9130);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9131);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9132);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9133);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9134);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9135);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9136);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9137);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9138);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9139);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9140);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9141);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9142);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9143);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9144);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9145);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9146);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9147);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9148);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9149);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9150);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9151);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9152);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9153);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9154);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9155);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9156);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9157);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9158);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9159);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9160);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9161);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9162);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9163);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9164);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9165);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9166);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9167);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9168);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9169);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9170);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9171);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9172);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9173);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9174);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9175);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9176);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9177);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9178);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9179);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9180);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9181);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9182);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9183);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9184);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9185);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9186);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9187);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9188);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9189);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9190);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9191);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9192);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9193);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9194);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9195);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9196);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9197);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9198);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9199);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9200);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9201);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9202);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9203);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9204);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9205);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9206);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9207);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9208);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9209);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9210);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9211);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9212);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9213);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9214);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9215);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9216);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9217);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9218);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9219);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9220);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9221);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9222);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9223);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9224);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9225);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9226);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9227);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9228);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9229);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9230);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9231);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9232);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9233);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9234);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9235);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9236);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9237);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9238);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9239);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9240);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9241);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9242);\
+ ADBG_CASE_DECLARE(XTEST_TEE_9243);\
+
+/* end of case declarations */
+
+
+#endif /*ADBG_CASE_DECLARE_H*/
diff --git a/host/xtest/adbg_entry_declare.h b/host/xtest/adbg_entry_declare.h
new file mode 100644
index 0000000..14892c1
--- /dev/null
+++ b/host/xtest/adbg_entry_declare.h
@@ -0,0 +1,733 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef ADBG_ENTRY_DECLARE_H
+#define ADBG_ENTRY_DECLARE_H
+
+#define ADBG_ENTRY_AUTO_GENERATED_TESTS() \
+ ADBG_SUITE_ENTRY(XTEST_TEE_7001, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7002, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7003, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7004, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7005, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7006, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7007, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7008, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7009, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7010, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7011, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7012, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7013, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7014, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7015, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7016, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7017, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7018, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7019, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7020, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7021, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7022, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7023, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7024, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7025, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7026, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7027, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7028, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7029, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7030, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7031, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7032, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7033, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7034, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7035, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7036, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7037, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7038, NULL)*/\
+ \
+ ADBG_SUITE_ENTRY(XTEST_TEE_7501, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7502, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7503, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7504, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7505, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7506, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7507, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7508, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7509, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7510, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7511, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7512, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7513, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7514, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7515, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7516, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7517, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7518, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7519, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7520, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7521, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7522, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7523, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7524, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7525, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7526, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7527, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7528, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7529, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7530, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7531, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7532, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7533, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7534, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7535, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7536, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7537, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7538, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7539, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7540, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7541, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7542, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7543, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7544, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7545, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7546, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7547, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7548, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7549, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7550, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7551, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7552, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7553, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7554, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7555, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7556, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7557, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7558, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7559, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7560, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7561, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7562, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7563, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7564, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7565, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7566, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7567, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7568, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7569, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7570, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7571, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7572, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7573, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7574, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7575, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7576, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7577, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7578, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7579, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7580, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7581, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7582, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7583, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7584, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7585, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7586, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7587, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7588, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7589, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7590, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7591, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7592, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7593, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7594, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7595, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7596, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7597, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7598, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7599, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7600, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7601, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7602, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7603, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7604, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7605, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7606, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7607, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7608, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7609, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7610, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7611, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7612, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7613, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7614, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7615, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7616, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7617, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7618, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7619, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7620, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7621, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7622, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7623, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7624, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7625, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7626, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7627, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7628, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7629, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7630, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7631, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7632, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7633, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7634, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7635, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7636, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7637, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7638, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7639, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7640, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7641, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7642, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7643, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7644, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7645, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7646, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7647, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7648, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7649, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7650, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7651, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7652, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7653, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7654, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7655, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7656, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7657, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7658, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7659, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7660, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7661, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7662, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7663, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7664, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7665, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7666, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7667, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7668, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7669, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7670, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7671, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7672, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7673, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7674, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7675, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7676, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7677, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7678, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7679, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7680, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7681, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7682, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7683, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7684, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7685, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_7686, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_7687, NULL)\
+ \
+ ADBG_SUITE_ENTRY(XTEST_TEE_8001, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8002, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8003, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8004, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8005, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8006, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8007, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8008, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8009, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8010, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8011, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8012, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8013, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8014, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8015, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8016, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8017, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8018, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8019, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8020, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8021, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8022, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8023, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8024, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_8025, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8026, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8027, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8028, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8029, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_8030, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8031, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8032, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8033, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8034, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8035, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8036, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8037, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8038, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8039, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8040, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8041, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8042, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8043, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8044, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8045, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8046, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8047, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8048, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8049, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8050, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8051, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8052, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8053, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8054, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8055, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8056, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8057, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8058, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8059, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8060, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8061, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8062, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8063, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8064, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8065, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_8066, NULL)*/\
+ \
+ ADBG_SUITE_ENTRY(XTEST_TEE_8501, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8502, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8503, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8504, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8505, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8506, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8507, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8508, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8509, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8510, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8511, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8512, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8513, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8514, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8515, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8516, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8517, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8518, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8519, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8520, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8521, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8522, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8523, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8524, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8525, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8526, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8527, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8528, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8529, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8530, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8531, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8532, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8533, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8534, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8535, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8536, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8537, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8538, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8539, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8540, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8541, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8542, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8543, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8544, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8545, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8546, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8547, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8548, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8549, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8550, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8551, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8552, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8553, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8554, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8555, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8556, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8557, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8558, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8559, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8560, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8561, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8562, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8563, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8564, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8565, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8566, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8567, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8568, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8569, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8570, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8571, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8572, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8573, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8574, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8575, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8576, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8577, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8578, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8579, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8580, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8581, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8582, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8583, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8584, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8585, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8586, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8587, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8588, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8589, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8590, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8591, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8592, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8593, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8594, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8595, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8596, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8597, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8598, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8599, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8600, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8601, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8602, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8603, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8604, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8605, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8606, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8607, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8608, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8609, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8610, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8611, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8612, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8613, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_8614, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8615, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8616, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8617, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8618, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8619, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8620, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8621, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8622, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8623, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8624, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8625, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8626, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8627, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8628, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8629, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8630, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8631, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8632, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8633, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8634, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8635, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8636, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8637, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8638, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8639, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8640, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8641, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8642, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_8643, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_8644, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8645, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8646, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8647, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8648, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8649, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8650, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8651, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8652, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8653, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8654, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8655, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8656, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8657, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8658, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8659, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8660, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8661, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8662, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8663, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8664, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8665, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8666, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8667, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8668, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8669, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8670, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8671, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_8672, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_8673, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_8674, NULL)*/\
+ \
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9001, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9002, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9003, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9004, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9005, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9006, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9007, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9008, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9009, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9010, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9011, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9012, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9013, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9014, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9015, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9016, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9017, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9018, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9019, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9020, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9021, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9022, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9023, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9024, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9025, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9026, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9027, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9028, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9029, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9030, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9031, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9032, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9033, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9034, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9035, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9036, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9037, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9038, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9039, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9040, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9041, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9042, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9043, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9044, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9045, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9046, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9047, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9048, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9049, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9050, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9051, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9052, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9053, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9054, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9055, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9056, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9057, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9058, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9059, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9060, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9061, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9062, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9063, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9064, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9065, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9066, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9067, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9068, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9069, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9070, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9071, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9072, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9073, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9074, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9075, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9076, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9077, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9078, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9079, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9080, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9081, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9082, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9083, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9084, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9085, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9086, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9087, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9088, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9089, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9090, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9091, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9092, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9093, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9094, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9095, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9096, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9097, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9098, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9099, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9100, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9101, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9102, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9103, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9104, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9105, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9106, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9107, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9108, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9109, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9110, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9111, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9112, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9113, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9114, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9115, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9116, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9117, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9118, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9119, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9120, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9121, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9122, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9123, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9124, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9125, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9126, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9127, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9128, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9129, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9130, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9131, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9132, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9133, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9134, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9135, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9136, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9137, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9138, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9139, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9140, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9141, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9142, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9143, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9144, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9145, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9146, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9147, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9148, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9149, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9150, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9151, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9152, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9153, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9154, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9155, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9156, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9157, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9158, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9159, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9160, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9161, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9162, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9163, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9164, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9165, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9166, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9167, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9168, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9169, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9170, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9171, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9172, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9173, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9174, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9175, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9176, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9177, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9178, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9179, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9180, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9181, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9182, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9183, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9184, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9185, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9186, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9187, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9188, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9189, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9190, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9191, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9192, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9193, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9194, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9195, NULL)*/\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9196, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9197, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9198, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9199, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9200, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9201, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9202, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9203, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9204, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9205, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9206, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9207, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9208, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9209, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9210, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9211, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9212, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9213, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9214, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9215, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9216, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9217, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9218, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9219, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9220, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9221, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9222, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9223, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9224, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9225, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9226, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9227, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9228, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9229, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9230, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9231, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9232, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9233, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9234, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9235, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9236, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9237, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9238, NULL)\
+ /*ADBG_SUITE_ENTRY(XTEST_TEE_9239, NULL)*/\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9240, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9241, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9242, NULL)\
+ ADBG_SUITE_ENTRY(XTEST_TEE_9243, NULL)\
+
+/* end of entry declarations */
+
+#endif /*ADBG_ENTRY_DECLARE_H*/
diff --git a/host/xtest/xml/include/xml_client_api.h b/host/xtest/xml/include/xml_client_api.h
new file mode 100644
index 0000000..b5edb97
--- /dev/null
+++ b/host/xtest/xml/include/xml_client_api.h
@@ -0,0 +1,372 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef XML_CLIENT_API_H_
+#define XML_CLIENT_API_H_
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include "tee_client_api.h"
+#ifdef USER_SPACE
+#include <pthread.h>
+#include <unistd.h>
+#endif
+
+#define CLIENT_APP01 NULL
+
+#define TEEC_UNDEFINED_ERROR 0xDEADDEAD
+
+#define TEEC_ORIGIN_ANY_NOT_TRUSTED_APP 0x00000005
+
+#define OFFSET0 0
+
+#ifdef USER_SPACE
+/*Test data defines*/
+static pthread_t THREAD02;
+#endif
+
+static TEEC_SharedMemory *SHARE_MEM01;
+static TEEC_SharedMemory *SHARE_MEM02;
+static TEEC_Session *SESSION01;
+static TEEC_Context *CONTEXT01;
+static TEEC_Operation *OPERATION01;
+static TEEC_Operation *OPERATION02;
+
+/* Return ORIGIN */
+static uint32_t ret_orig;
+
+static uint32_t BIG_SIZE = 1024;
+
+static uint32_t IGNORE = 0xFEFEFEFE;
+static uint32_t VALUE01 = 0x01234567;
+static uint32_t VALUE02 = 0xFEDCBA98;
+static uint32_t SIZE_OVER_MEMORY = 0xFFFFFFFE;
+static uint32_t SIZE_VALUE01 = sizeof(VALUE01);
+static uint32_t ZERO;
+
+#define INVALID_CONNECTION_METHODS 0x0A
+#define COMMAND_TTA_Check_Expected_ParamTypes COMMAND_TTA_Check_ParamTypes
+
+#define TEEC_MEM_INOUT 0x00000003
+
+/* "ItIsNotTotosTEEs" */
+const char *INVALID_NOT_EXISTING_TEE = "ItIsNotTotosTEEs\0";
+
+/** ALL_TEMPORARY_MEMORIES */
+uint8_t *TEMP_MEM01;
+uint8_t *TEMP_MEM02;
+
+/** ALL_TEEC_UUID
+ *
+ * These constants are the UUID of existing
+ * Trusted Applications
+ */
+/* "SMARTCSLTERRTOOS" */
+static TEEC_UUID UUID_TTA_answerErrorTo_OpenSession = {
+ 0x534D4152, 0x5443, 0x534C,
+ { 0x54, 0x45, 0x52, 0x52, 0x54, 0x4F, 0x4F, 0x53 }
+};
+/* "SMART-CSLT-TA-SU" */
+static TEEC_UUID UUID_TTA_answerSuccessTo_OpenSession_Invoke = {
+ 0x534D4152, 0x542D, 0x4353,
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x53, 0x55 }
+};
+/* "SMARTCSLTOS4PARM" */
+static TEEC_UUID UUID_TTA_check_OpenSession_with_4_parameters = {
+ 0x534D4152, 0x5443, 0x534C,
+ { 0x54, 0x4F, 0x53, 0x34, 0x50, 0x41, 0x52, 0x4D }
+};
+/* "SMART-CUNK-NO-WN" */
+static TEEC_UUID UUID_Unknown = {
+ 0x534D4152, 0x542D, 0x4355,
+ { 0x4E, 0x4B, 0x2D, 0x4E, 0x4F, 0x2D, 0x57, 0x4E }
+};
+
+/*Helper functions/macros*/
+#define IDENTIFIER_NOT_USED(x) { if (sizeof(&x)) {} }
+
+/* XML_VERIFY macro define.
+ *
+ * Use ADBG_EXPECT or ADBG_EXPECT_NOT depending on the expected return value.
+ *
+ * ADBG_EXPECT() -> IF(EXP == GOT) RETURN TRUE
+ * ADBG_EXPECT() -> IF(EXP != GOT) RETURN TRUE
+ */
+#define XML_VERIFY(c, exp, got) \
+ do { \
+ if (exp == TEEC_UNDEFINED_ERROR) \
+ ADBG_EXPECT_NOT(c, exp, got); \
+ else \
+ ADBG_EXPECT(c, exp, got); \
+ } while (0)
+
+/*Initialize context using TEEC_InitializeContext and
+ check the returned value.*/
+#define XML_InitializeContext(c, name, context, expected) \
+ XML_VERIFY(c, expected, TEEC_InitializeContext(name, context))
+
+/*Open session using TEEC_OpenSession and
+ check the returned value and/or returned origin.*/
+#define XML_OpenSession(c, context, session, destination, connectionMethod, \
+ connectionData, operation, returnOrigin, expected) \
+ do { \
+ XML_VERIFY(c, expected, \
+ TEEC_OpenSession(context, session, destination, \
+ connectionMethod, connectionData, \
+ operation, &ret_orig)); \
+ if ((returnOrigin != 0) && \
+ (returnOrigin != TEEC_ORIGIN_ANY_NOT_TRUSTED_APP)) \
+ ADBG_EXPECT(c, returnOrigin, ret_orig); \
+ else \
+ ADBG_EXPECT_NOT(c, returnOrigin, ret_orig); \
+ } while (0)
+
+#define OPERATION_TEEC_PARAM_TYPES(op, p0, p1, p2, p3) \
+ op->paramTypes = TEEC_PARAM_TYPES(p0, p1, p2, p3)
+
+/*dummy functions*/
+#define TEEC_SelectApp(a, b) /*do nothing for now*/
+#define TEEC_createThread(a, b) /*do nothing for now*/
+
+/*Allocates TEEC_SharedMemory inside of the TEE*/
+static TEEC_Result AllocateSharedMemory(TEEC_Context *ctx,
+ TEEC_SharedMemory *shm,
+ uint32_t size, uint32_t flags)
+{
+ shm->flags = flags;
+ shm->size = size;
+ return TEEC_AllocateSharedMemory(ctx, shm);
+}
+
+/*Registers the TEEC_SharedMemory to the TEE*/
+static TEEC_Result RegisterSharedMemory(TEEC_Context *ctx,
+ TEEC_SharedMemory *shm,
+ uint32_t size, uint32_t flags)
+{
+ shm->flags = flags;
+ shm->size = size;
+ shm->buffer = malloc(size);
+ return TEEC_RegisterSharedMemory(ctx, shm);
+}
+
+/*Allocates temporary memory area*/
+#define AllocateTempMemory(temp_mem, size) \
+ temp_mem = malloc(size)
+
+/*Releases temporary memory area*/
+#define ReleaseTempMemory(temp_mem) \
+ do { \
+ if (temp_mem != NULL) { \
+ free(temp_mem); \
+ temp_mem = NULL; \
+ } \
+ } while (0)
+
+
+/* Assigns a and b to the value parameter */
+static void TEEC_prepare_OperationEachParameter_value(TEEC_Operation *op,
+ size_t n, uint32_t a,
+ uint32_t b)
+{
+ if (IGNORE != a)
+ op->params[n].value.a = a;
+
+ if (IGNORE != b)
+ op->params[n].value.b = b;
+
+}
+
+/*Define TEEC_SharedMemory memory content.*/
+#define TEEC_defineMemoryContent_sharedMemory(sh_mem, val, size_val) \
+ memcpy(sh_mem->buffer, &val, size_val)
+
+/*Define temp memory content.*/
+#define TEEC_defineMemoryContent_tmpMemory(buf, val, size_val) \
+ memcpy(buf, &(val), size_val)
+
+#define INVOKE_REMEMBER_EXP_PARAM_TYPES(session, cmd, p0, p1, p2, p3, exp) \
+ do { \
+ memset(OPERATION01, 0x00, sizeof(TEEC_Operation)); \
+ OPERATION01->paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, \
+ TEEC_NONE, \
+ TEEC_NONE, \
+ TEEC_NONE); \
+ OPERATION01->params[0].value.a = \
+ TEEC_PARAM_TYPES((p0), (p1), (p2), (p3)); \
+ ADBG_EXPECT(c, exp, \
+ TEEC_InvokeCommand(session, cmd, OPERATION01, \
+ &ret_orig)); \
+ ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP, \
+ ret_orig); \
+ } while (0)
+
+/*Compares two memories and checks if their length and content is the same */
+#define TEEC_checkMemoryContent_sharedMemory(op, param_num, shrm, exp_buf, \
+ exp_blen) \
+ do { \
+ if ((exp_buf) == IGNORE) { \
+ ADBG_EXPECT((c), exp_blen, \
+ (op)->params[(param_num)].memref.size); \
+ } else { \
+ ADBG_EXPECT_COMPARE_POINTER((c), (shrm), ==, \
+ (op)->params[(param_num)].\
+ memref.parent); \
+ ADBG_EXPECT_BUFFER((c), &(exp_buf), (exp_blen), \
+ (shrm)->buffer, \
+ (op)->params[(param_num)].\
+ memref.size); \
+ } \
+ } while (0)
+
+/*
+ * Compares the content of the memory cells in OP with the expected value
+ * contained.
+ */
+#define TEEC_checkMemoryContent_tmpMemory(op, param_num, \
+ buf, exp_buf, exp_blen) \
+ do { \
+ if ((exp_buf) == 0) { \
+ ADBG_EXPECT((c), exp_blen, \
+ (op)->params[(param_num)].tmpref.size); \
+ } else { \
+ ADBG_EXPECT_COMPARE_POINTER((c), (buf), ==, \
+ (op)->params[(param_num)].\
+ tmpref.buffer); \
+ ADBG_EXPECT_BUFFER((c), &(exp_buf), (exp_blen), \
+ (buf), \
+ (op)->params[(param_num)].\
+ memref.size); \
+ } \
+ } while (0)
+
+/*
+ * Compares the content of the memory cells in OP with the expected value
+ * contained.
+ */
+#define TEEC_checkContent_Parameter_value(op, param_num, exp_a, exp_b) \
+ do { \
+ if (IGNORE != exp_a) \
+ ADBG_EXPECT((c), exp_a, \
+ (op)->params[(param_num)].value.a); \
+ if (IGNORE != exp_b) \
+ ADBG_EXPECT((c), exp_b, \
+ (op)->params[(param_num)].value.b); \
+ } while (0)
+
+/*Invoke command using TEEC_InvokeCommand and check the returned value.*/
+#define XML_InvokeCommand(c, session, cmd, operation, returnOrigin, expected) \
+ do { \
+ ADBG_EXPECT(c, expected, \
+ TEEC_InvokeCommand(session, cmd, operation, \
+ &ret_orig)); \
+ if (returnOrigin != 0) \
+ ADBG_EXPECT(c, (int)returnOrigin, ret_orig); \
+ } while (0)
+
+#ifdef USER_SPACE
+#define RequestCancellation(op) \
+ (void)ADBG_EXPECT(c, 0, \
+ pthread_create(&THREAD02, NULL, cancellation_thread, \
+ (void *)op)); \
+ (void)ADBG_EXPECT(c, 0, pthread_join(THREAD02, NULL));
+#else
+#define RequestCancellation(op) \
+ IDENTIFIER_NOT_USED(op)
+#endif
+
+struct ctx_thr {
+ ADBG_Case_t *c;
+ TEEC_Context *ctx;
+};
+
+static struct ctx_thr thr2_ctx;
+
+#ifdef USER_SPACE
+static void *context_thread(void *arg)
+{
+ /*
+ * Sleep 0.5 seconds before cancellation to make sure that the other
+ * thread is in RPC_WAIT.
+ */
+ XML_InitializeContext(((struct ctx_thr *)arg)->c, _device,
+ ((struct ctx_thr *)arg)->ctx, TEEC_SUCCESS);
+ TEEC_FinalizeContext(((struct ctx_thr *)arg)->ctx);
+
+ return NULL;
+}
+#endif
+
+#ifdef USER_SPACE
+#define ctx_init_finalize(t_ctx) \
+ (void)ADBG_EXPECT(c, 0, \
+ pthread_create(&THREAD02, NULL, context_thread, \
+ (void *)&t_ctx)); \
+ (void)ADBG_EXPECT(c, 0, pthread_join(THREAD02, NULL));
+#else
+#define ctx_init_finalize(t_ctx) \
+ IDENTIFIER_NOT_USED(t_ctx)
+#endif
+
+#ifdef XTEST_WITH_GP_TESTS
+/*
+ * Required by Global Platform test suite for v1.0
+ */
+static uint32_t BIG_VALUE = 1024; /* BIG_SIZE */
+static uint32_t SIZE_LESSER_THAN_SIZE_VALUE01 = sizeof(VALUE01) - 1;
+
+/* "SMART-CSLT-TA-ER" */
+static TEEC_UUID UUID_TTA_answerErrorTo_Invoke = {
+ 0x534D4152, 0x542D, 0x4353,
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x45, 0x52 }
+};
+
+/* "SMART-CSLT-TA-ST" */
+/* Used in GP Tests */
+static TEEC_UUID UUID_TTA_testingClientAPI = {
+ 0x534D4152, 0x542D, 0x4353,
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x53, 0x54 }
+};
+
+#ifdef USER_SPACE
+static void *cancellation_thread(void *arg)
+{
+ TEEC_RequestCancellation((TEEC_Operation *)arg);
+ return NULL;
+}
+#endif
+
+/* Assigns parent, offset and size to the memref parameter */
+static void TEEC_prepare_OperationEachParameter_memref(TEEC_Operation *op,
+ size_t n,
+ TEEC_SharedMemory *parent, unsigned offset,
+ unsigned size)
+{
+ op->params[n].memref.parent = parent;
+ op->params[n].memref.offset = offset;
+ op->params[n].memref.size = size;
+}
+
+/* Assigns buffer and size to the tmpref parameter */
+static void TEEC_prepare_OperationEachParameter_tmpref(TEEC_Operation *op,
+ size_t n,
+ uint8_t *buffer,
+ unsigned size)
+{
+ op->params[n].tmpref.buffer = buffer;
+ op->params[n].tmpref.size = size;
+}
+#endif
+
+#endif /* XML_CLIENT_API_H_ */
diff --git a/host/xtest/xml/include/xml_crypto_api.h b/host/xtest/xml/include/xml_crypto_api.h
new file mode 100644
index 0000000..4ba95c6
--- /dev/null
+++ b/host/xtest/xml/include/xml_crypto_api.h
@@ -0,0 +1,2581 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef XML_CRYPTO_API_H_
+#define XML_CRYPTO_API_H_
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "tee_client_api.h"
+#include "utee_defines.h"
+#include "xtest_test.h"
+
+#define BIT_CHANGE(a, b) ((a) ^= (1 << (b)))
+
+#define CRYPTO_INIT(b) \
+ b.buffer = NULL; \
+ b.size = 0;
+
+#define CRYPTO_MALLOC(b, size) \
+ b.size = size; \
+ b.buffer = malloc(size);
+
+#define CRYPTO_FREE(b) { \
+ if (b.buffer != NULL) { \
+ b.size = 0; \
+ free(b.buffer); \
+ b.buffer = NULL; \
+ } }
+
+/*Crypto_CMD redefines*/
+#define CMD_AsymmetricVerifyDigest CMD_AsymmetricVerifyDigestNoParam
+#define CMD_AsymmetricSignDigest CMD_AsymmetricSignDigestNoParam
+#define CMD_AsymmetricEncrypt CMD_AsymmetricEncryptNoParam
+#define CMD_AsymmetricDecrypt CMD_AsymmetricDecryptNoParam
+
+/*Missing TEE Error codes*/
+#define TEE_ERROR_TOO_SHORT_BUFFER TEE_ERROR_SHORT_BUFFER
+
+/*Other defines*/
+#define TEE_USAGE_NONE 0
+
+#define BIG_SIZE 1024
+uint32_t DS_BIG_SIZE = 16384;
+
+/*ALL_OBJECT_SIZES*/
+#define KEY_SIZE_TOO_LARGE 4096
+#define SIZE_AES_256 256
+#define SIZE_DES3_192 168
+#define SIZE_DES_64 56
+#define SIZE_DH_KEYPAIR_1024 1024
+#define SIZE_DSA_KEYPAIR_768 768
+#define SIZE_DSA_PUBLIC_KEY_768 768
+#define SIZE_GENERIC_SECRET_2048 2048
+#define SIZE_HMAC_MD5_256 256
+#define SIZE_HMAC_SHA1_256 256
+#define SIZE_HMAC_SHA224_256 256
+#define SIZE_HMAC_SHA256_512 512
+#define SIZE_HMAC_SHA384_512 512
+#define SIZE_HMAC_SHA512_512 512
+#define SIZE_RSA_KEYPAIR_2048 2048
+#define SIZE_RSA_PUBLIC_KEY_2048 2048
+#define SIZE_ZERO 0
+#define WRONG_SIZE 5
+
+/*ALL_TEE_TAG_LENGTH_FOR_AES*/
+#define AES_104_bits 104
+#define AES_112_bits 112
+#define AES_120_bits 120
+#define AES_128_bits 128
+#define AES_32_bits 32
+#define AES_48_bits 48
+#define AES_64_bits 64
+#define AES_96_bits 96
+
+/*attribute not defined*/
+#define TEE_ATTR_NONE 0
+
+static TEEC_SharedMemory *SHARE_MEM01;
+static TEEC_SharedMemory *SHARE_MEM02;
+static TEEC_SharedMemory *SHARE_MEM03;
+static TEEC_SharedMemory *SHARE_MEM04;
+static TEEC_SharedMemory *SHARE_MEM05;
+static TEEC_SharedMemory *SHARE_MEM06;
+static TEEC_Session *SESSION01;
+static TEEC_Session *SESSION02;
+static TEEC_Context *CONTEXT01;
+static TEEC_Context *CONTEXT02;
+static TEE_OperationHandle *OPERATION_HANDLE_01;
+static TEE_OperationHandle *OPERATION_HANDLE_02;
+static TEE_OperationHandle *OPERATION_HANDLE_INVALID;
+static TEE_ObjectHandle *OBJECT_HANDLE_01;
+static TEE_ObjectHandle *OBJECT_HANDLE_02;
+static TEE_ObjectHandle *OBJECT_HAN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, 0xdb,
+ 0x29, 0x2d, 0xbc, 0x45
+};
+static const uint8_t TEE_ATTR_DH_BASE_VALUE01[] = {
+ 0x1c, 0xe0, 0xf6, 0x69, 0x26, 0x46, 0x11, 0x97, 0xef, 0x45, 0xc4, 0x65,
+ 0x8b, 0x83, 0xb8, 0xab,
+ 0x04, 0xa9, 0x22, 0x42, 0x68, 0x50, 0x4d, 0x05, 0xb8, 0x19, 0x83, 0x99,
+ 0xdd, 0x71, 0x37, 0x18,
+ 0xcc, 0x1f, 0x24, 0x5d, 0x47, 0x6c, 0xcf, 0x61, 0xa2, 0xf9, 0x34, 0x93,
+ 0xf4, 0x1f, 0x55, 0x52,
+ 0x48, 0x65, 0x57, 0xe6, 0xd4, 0xca, 0xa8, 0x00, 0xd6, 0xd0, 0xdb, 0x3c,
+ 0xbf, 0x5a, 0x95, 0x4b,
+ 0x20, 0x8a, 0x4e, 0xba, 0xf7, 0xe6, 0x49, 0xfb, 0x61, 0x24, 0xd8, 0xa2,
+ 0x1e, 0xf2, 0xf2, 0x2b,
+ 0xaa, 0xae, 0x29, 0x21, 0x10, 0x19, 0x10, 0x51, 0x46, 0x47, 0x31, 0xb6,
+ 0xcc, 0x3c, 0x93, 0xdc,
+ 0x6e, 0x80, 0xba, 0x16, 0x0b, 0x66, 0x64, 0xa5, 0x6c, 0xfa, 0x96, 0xea,
+ 0xf1, 0xb2, 0x83, 0x39,
+ 0x8e, 0xb4, 0x61, 0x64, 0xe5, 0xe9, 0x43, 0x84, 0xee, 0x02, 0x24, 0xe7,
+ 0x1f, 0x03, 0x7c, 0x23
+};
+static const uint8_t TEE_ATTR_HMAC_SHA256_512_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0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};
+static const uint8_t TEE_ATTR_DSA_PRIVATE_VALUE_VALUE01[] = {
+ 0x70, 0x4a, 0x46, 0xc6, 0x25, 0x2a, 0x95, 0xa3, 0x9b, 0x40, 0xe0, 0x43,
+ 0x5a, 0x69, 0x1b, 0xad,
+ 0xae, 0x52, 0xa5, 0xc0
+};
+static const uint8_t TEE_ATTR_DSA_PUBLIC_VALUE_VALUE01[] = {
+ 0x52, 0x9d, 0xed, 0x98, 0xa2, 0x32, 0x09, 0x85, 0xfc, 0x84, 0xb6, 0x5a,
+ 0x9d, 0xc8, 0xd4, 0xfe,
+ 0x41, 0xad, 0xa6, 0xe3, 0x59, 0x3d, 0x70, 0x4f, 0x08, 0x98, 0xc1, 0x4e,
+ 0xc2, 0x46, 0x34, 0xdd,
+ 0xf5, 0xf1, 0xdb, 0x47, 0xcc, 0x49, 0x15, 0xfc, 0xe1, 0xe2, 0x67, 0x4d,
+ 0x2e, 0xcd, 0x98, 0xd5,
+ 0x8b, 0x59, 0x8e, 0x8d, 0xdf, 0xaf, 0xf3, 0x0e, 0x88, 0x26, 0xf5, 0x0a,
+ 0xab, 0x40, 0x27, 0xb5,
+ 0xaa, 0xb8, 0x87, 0xc1, 0x9a, 0xd9, 0x6d, 0x7e, 0x57, 0xde, 0x53, 0x90,
+ 0xad, 0x8e, 0x55, 0x57,
+ 0xb4, 0x1a, 0x80, 0x19, 0xc9, 0x0d, 0x80, 0x60, 0x71, 0x79, 0xb5, 0x4e,
+ 0xb0, 0xad, 0x4d, 0x23
+};
+static const uint8_t TEE_ATTR_DES3_192_VALUE01[] = {
+ 0xCD, 0xFE, 0x57, 0xB6, 0xB6, 0x2F, 0xAE, 0x6B, 0x04, 0x73, 0x40, 0xF1,
+ 0x02, 0xD6, 0xA4, 0x8C,
+ 0x89, 0x5D, 0xAD, 0xF2, 0x9D, 0x62, 0xEF, 0x25
+};
+static const uint8_t TEE_ATTR_RSA_PRIVATE_EXPONENT_VALUE01[] = {
+ 0xa5, 0x0d, 0xe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0xe4, 0x2b, 0x58, 0x79, 0xe6, 0xb4, 0x6b, 0x5e, 0x56, 0x0a, 0xb2, 0xdb,
+ 0x68, 0xed, 0x24, 0xd8,
+ 0x5e, 0x6f, 0x30, 0x59, 0x8d, 0x8c, 0xa3, 0x00, 0x68, 0xf5, 0x42, 0x95,
+ 0x1a, 0x0b, 0xa8, 0x1c,
+ 0xfb, 0xdf, 0x29, 0x81, 0x10, 0x32, 0x02, 0xcc, 0x51, 0xa4, 0x17, 0x14,
+ 0x3e, 0xef, 0x89, 0x41,
+ 0xde, 0xf8, 0x2d, 0x64, 0x69, 0x30, 0xe8, 0x8a, 0xad, 0x96, 0xf6, 0xf4,
+ 0x82, 0x83, 0x9a, 0x77,
+ 0xe7, 0xde, 0x12, 0x31, 0xf7, 0x15, 0xec, 0xce, 0xed, 0x83, 0x68, 0x88,
+ 0x84, 0xe5, 0x64, 0x81
+};
+static const uint8_t TEE_ATTR_DES_64_VALUE01[] = {
+ 0xCD, 0xFE, 0x57, 0xB6, 0xB6, 0x2F, 0xAE, 0x6B
+};
+static const uint8_t TEE_ATTR_HMAC_SHA1_256_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f
+};
+static const uint8_t TEE_ATTR_HMAC_MD5_256_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f
+};
+static const uint8_t TEE_ATTR_HMAC_SHA224_256_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f
+};
+static const uint8_t TEE_ATTR_HMAC_SHA384_512_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
+ 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
+ 0x3c, 0x3d, 0x3e, 0x3f
+};
+static const uint8_t TEE_ATTR_HMAC_SHA512_512_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
+ 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
+ 0x3c, 0x3d, 0x3e, 0x3f
+};
+
+/*ALL_CRYPTO_AAD_VALUES*/
+static const uint8_t AAD1_VALUE[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+};
+
+/*ALL_CRYPTO_AAD_LENGTHS*/
+#define AAD1_LENGTH 8
+#define NULL_LENGTH 0
+
+/*ALL_TEE_CRYPTO_INITIALISATION_VECTOR_VALUES*/
+static const uint8_t NONCE2_VALUE_AES_GCM[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88
+};
+static const uint8_t NONCE1_VALUE_AES_CCM[] = {
+ 0x00, 0x8D, 0x49, 0x3B, 0x30, 0xAE, 0x8B, 0x3C, 0x96, 0x96, 0x76, 0x6C,
+ 0xFA
+};
+
+/*ALL_TEE_CRYPTO_INITIALISATION_VECTOR_LENGTHS*/
+#define NONCE2_LENGTH_AES_GCM 12
+#define NONCE1_LENGTH_AES_CCM 13
+
+/*ALL_CRYPTO_DATA_VALUE*/
+static const uint8_t DATA_FOR_CRYPTO1[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
+ 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
+ 0x06, 0x07, 0x08, 0x09,
+ 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04,
+ 0x03, 0x02, 0x01, 0x00,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
+ 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
+ 0x06, 0x07, 0x08, 0x09,
+ 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04,
+ 0x03, 0x02, 0x01, 0x00
+};
+static const uint8_t DATA_FOR_CRYPTO1_PART1[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
+ 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
+ 0x06, 0x07, 0x08, 0x09
+};
+static const uint8_t DATA_FOR_CRYPTO1_PART2[] = {
+ 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04,
+ 0x03, 0x02, 0x01, 0x00,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
+ 0x0C, 0x0D, 0x0E, 0x0F
+};
+static const uint8_t DATA_FOR_CRYPTO1_PART3[] = {
+ 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
+ 0x06, 0x07, 0x08, 0x09,
+ 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04,
+ 0x03, 0x02, 0x01, 0x00
+};
+
+/*ALL_CRYPTO_DATA_LENGTH*/
+#define LENGTH_DATA_FOR_CRYPTO1 96
+#define LENGTH_DATA_FOR_CRYPTO1_PART1 32
+#define LENGTH_DATA_FOR_CRYPTO1_PART2 32
+#define LENGTH_DATA_FOR_CRYPTO1_PART3 32
+
+/*ALL_TEE_CRYPTO_INITIALISATION_VECTOR_VALUES*/
+static const uint8_t IV1_VALUE_64bits_DES_DES3[] = {
+ 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef
+};
+static const uint8_t IV2_VALUE_128bits_AES[] = {
+ 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78,
+ 0x90, 0xab, 0xcd, 0xef
+};
+static const uint8_t IV_INVALID_LENGTH_VALUE[] = {
+ 0x01, 0x02, 0x03, 0x04, 0x05
+};
+
+/*ALL_TEE_CRYPTO_INITIALISATION_VECTOR_LENGTHS*/
+#define IV_LENGTH_NULL 0
+#define IV_INVALID_LENGTH 5
+#define IV1_LENGTH_64bits_DES_DES3 8
+#define IV2_LENGTH_128bits_AES 16
+
+static const uint8_t *TEE_ATTR_VALUE_NONE;
+
+/*ALL_TEE_BUFFER_CASES*/
+#define OUTPUT_BUFFER_NORMAL 1
+#define OUTPUT_BUFFER_TOO_SHORT 2
+#define OUTPUT_OTHER_BUFFER_TOO_SHORT 3
+
+enum signature_validity {
+ INVALID_SIGNATURE = 0,
+ VALID_SIGNATURE
+};
+
+enum mac_validity {
+ INVALID_MAC = 0,
+ VALID_MAC
+};
+
+struct crypto_buffer {
+ uint8_t *buffer;
+ uint32_t size;
+};
+
+/*Saved in Invoke_Crypto_AllocateOperation*/
+struct crypto_op {
+ uint32_t algo;
+ uint32_t mode;
+ uint32_t obj_size;
+};
+struct crypto_op saved_alloc;
+
+/*Saved in Invoke_Crypto_InitObjectWithKeys*/
+struct key_val {
+ TEE_ObjectHandle obh;
+ uint32_t obj_type;
+ uint32_t obj_size;
+ struct crypto_buffer key;
+};
+struct key_val saved_key_vals;
+
+/*Saved in Invoke_Crypto_SetOperationKey*/
+struct obh_val {
+ TEE_OperationHandle oph;
+ TEE_ObjectHandle obh;
+};
+struct obh_val saved_obh1;
+
+/*Saved in Invoke_Crypto_SetOperationKey2*/
+struct obh_val2 {
+ TEE_OperationHandle oph;
+ TEE_ObjectHandle obh1;
+ TEE_ObjectHandle obh2;
+};
+struct obh_val2 saved_obh;
+
+/*saved by Invoke_Crypto_AEUpdateAAD*/
+struct crypto_buffer saved_aad_value;
+
+/*Saved in Invoke_Crypto_AEEncryptFinal*/
+struct crypto_buffer ae_encrypt_tag;
+
+/*Saved in Invoke_Crypto_AEUpdate_for_encryption*/
+struct crypto_buffer buffer_encrypted_chunks[4];
+
+/*Saved in Invoke_Crypto_AEUpdate_for_Decryption*/
+struct crypto_buffer buffer_decrypted_chunks[4];
+
+/*filled with data in Invoke_Crypto_AsymmetricEncrypt*/
+struct crypto_buffer buffer_asym_encrypted;
+
+/*saved by Invoke_Crypto_AEInit*/
+struct crypto_buffer saved_in_nonce;
+
+/*Saved in Invoke_Crypto_DeriveKey*/
+struct obh_val saved_derive;
+
+/*Saved in Invoke_Crypto_GenerateRandom*/
+struct crypto_buffer saved_random;
+
+/*Saved in Invoke_Crypto_DigestDoFinal*/
+struct crypto_buffer saved_digest;
+
+/*Saved in Invoke_Crypto_MACInit*/
+struct crypto_buffer saved_mac_iv;
+
+/*Saved in Invoke_Crypto_CipherInit*/
+struct crypto_buffer saved_cipher_iv;
+
+/*Saved in Invoke_Crypto_CipherUpdate*/
+struct crypto_buffer saved_cipher_update;
+
+
+TEEC_UUID UUID_TTA_testingInternalAPI_crypto = {
+ 0x534D4152, 0x5443, 0x534C,
+ { 0x54, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4F, 0x31 }
+};
+
+/* CRYPTO API HELPERS */
+#define TEEC_SelectApp(a, b) /*do nothing for now*/
+
+static void crypto_init(void)
+{
+ saved_obh.oph = 0;
+ saved_obh.obh1 = 0;
+ saved_obh.obh2 = 0;
+ saved_alloc.algo = 0;
+ saved_alloc.mode = 0;
+ saved_alloc.obj_size = 0;
+ saved_key_vals.obh = 0;
+ saved_key_vals.obj_size = 0;
+ saved_key_vals.obj_type = 0;
+ CRYPTO_INIT(saved_key_vals.key);
+ CRYPTO_INIT(saved_aad_value);
+ CRYPTO_INIT(ae_encrypt_tag);
+ /*4 chunks*/
+ CRYPTO_INIT(buffer_encrypted_chunks[0]);
+ CRYPTO_INIT(buffer_encrypted_chunks[1]);
+ CRYPTO_INIT(buffer_encrypted_chunks[2]);
+ CRYPTO_INIT(buffer_encrypted_chunks[3]);
+ /*4 chunks*/
+ CRYPTO_INIT(buffer_decrypted_chunks[0]);
+ CRYPTO_INIT(buffer_decrypted_chunks[1]);
+ CRYPTO_INIT(buffer_decrypted_chunks[2]);
+ CRYPTO_INIT(buffer_decrypted_chunks[3]);
+ CRYPTO_INIT(buffer_asym_encrypted);
+ CRYPTO_INIT(saved_in_nonce);
+ CRYPTO_INIT(saved_random);
+ CRYPTO_INIT(saved_digest);
+ CRYPTO_INIT(saved_cipher_iv);
+ CRYPTO_INIT(saved_cipher_update);
+}
+
+static void crypto_reset(void)
+{
+ saved_obh.oph = 0;
+ saved_obh.obh1 = 0;
+ saved_obh.obh2 = 0;
+ saved_alloc.algo = 0;
+ saved_alloc.mode = 0;
+ saved_alloc.obj_size = 0;
+ saved_key_vals.obh = 0;
+ saved_key_vals.obj_size = 0;
+ saved_key_vals.obj_type = 0;
+ CRYPTO_FREE(saved_key_vals.key);
+
+ CRYPTO_FREE(saved_aad_value);
+ CRYPTO_FREE(ae_encrypt_tag);
+ /*4 chunks*/
+ CRYPTO_FREE(buffer_encrypted_chunks[0]);
+ CRYPTO_FREE(buffer_encrypted_chunks[1]);
+ CRYPTO_FREE(buffer_encrypted_chunks[2]);
+ CRYPTO_FREE(buffer_encrypted_chunks[3]);
+ /*4 chunks*/
+ CRYPTO_FREE(buffer_decrypted_chunks[0]);
+ CRYPTO_FREE(buffer_decrypted_chunks[1]);
+ CRYPTO_FREE(buffer_decrypted_chunks[2]);
+ CRYPTO_FREE(buffer_decrypted_chunks[3]);
+ CRYPTO_FREE(buffer_asym_encrypted);
+ CRYPTO_FREE(saved_in_nonce);
+ CRYPTO_FREE(saved_random);
+ CRYPTO_FREE(saved_digest);
+ CRYPTO_FREE(saved_cipher_iv);
+ CRYPTO_FREE(saved_cipher_update);
+}
+
+/*Helper functions/macros*/
+
+#define ALLOCATE_SHARED_MEMORY(context, sharedMemory, sharedMemorySize, \
+ memoryType) \
+ res = AllocateSharedMemory(context, sharedMemory, sharedMemorySize, \
+ memoryType); \
+ if (res != TEEC_SUCCESS) { \
+ goto exit; \
+ } \
+ memset(sharedMemory->buffer, 0, sharedMemorySize);
+
+#define ALLOCATE_AND_FILL_SHARED_MEMORY(context, sharedMemory, \
+ sharedMemorySize, \
+ memoryType, copySize, data) \
+ res = AllocateSharedMemory(context, sharedMemory, sharedMemorySize, \
+ memoryType); \
+ if (res != TEEC_SUCCESS) { \
+ goto exit; \
+ } \
+ memset(sharedMemory->buffer, 0, sharedMemorySize); \
+ if (data != NULL) { \
+ memcpy(sharedMemory->buffer, data, copySize); \
+ }
+
+#define SET_SHARED_MEMORY_OPERATION_PARAMETER(parameterNumber, \
+ sharedMemoryOffset, \
+ sharedMemory, \
+ sharedMemorySize) \
+ op.params[parameterNumber].memref.offset = sharedMemoryOffset; \
+ op.params[parameterNumber].memref.size = sharedMemorySize; \
+ op.params[parameterNumber].memref.parent = sharedMemory;
+
+/*Allocates TEEC_SharedMemory inside of the TEE*/
+static TEEC_Result AllocateSharedMemory(TEEC_Context *ctx,
+ TEEC_SharedMemory *shm, uint32_t size,
+ uint32_t flags)
+{
+ shm->flags = flags;
+ shm->size = size;
+ return TEEC_AllocateSharedMemory(ctx, shm);
+}
+
+/**
+ * Writes 4 byte to @p *data_pp and increases
+ * @p *data_pp by 4 byte. The bytes are written
+ * in Big Endian Order.
+ */
+static void put_uint32_be(void **data_pp, uint32_t v)
+{
+ uint8_t *d = *(uint8_t **)data_pp;
+ uint8_t *v_p = (uint8_t *)&v;
+
+ d[3] = v_p[0];
+ d[2] = v_p[1];
+ d[1] = v_p[2];
+ d[0] = v_p[3];
+ *((uint8_t **)data_pp) += sizeof(uint32_t);
+}
+
+static TEEC_Result calculate_digest(ADBG_Case_t *c, TEEC_Session *s,
+ const void *data, const size_t data_length,
+ struct crypto_buffer *digest);
+
+static TEEC_Result sign_digest(ADBG_Case_t *c, TEEC_Session *s,
+ const struct crypto_buffer *in_dgst,
+ struct crypto_buffer *out_dgst);
+
+static bool verify_digest(ADBG_Case_t *c, TEEC_Session *s,
+ const struct crypto_buffer *in_sdgst);
+
+static TEEC_Result mac_compute_final(ADBG_Case_t *c, TEEC_Session *s,
+ const void *full_data,
+ const size_t fdata_length,
+ struct crypto_buffer *mac);
+
+static TEEC_Result cipher_do_final(ADBG_Case_t *c, TEEC_Session *s,
+ const void *full_data,
+ const size_t fdata_length,
+ struct crypto_buffer *cipher);
+
+static void collapse_crypto_buffers(struct crypto_buffer *in_buffer,
+ struct crypto_buffer *out_buffer)
+{
+ int id;
+ uint8_t *tmp;
+
+ out_buffer->size = 0;
+
+ for (id = 0; id < 4; id++)
+ out_buffer->size += in_buffer[id].size;
+
+ out_buffer->buffer = malloc(out_buffer->size);
+ tmp = out_buffer->buffer;
+
+ for (id = 0; id < 4; id++) {
+ if (in_buffer[id].buffer) {
+ memcpy(tmp, in_buffer[id].buffer, in_buffer[id].size);
+ tmp += in_buffer[id].size;
+ }
+ }
+}
+
+/*Invoke Crypto Commands Implementations*/
+/*CMD_AllocateOperation*/
+static TEEC_Result Invoke_Crypto_AllocateOperation(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id,
+ const uint32_t algo, const uint32_t mode,
+ const size_t obj_size1, const size_t obj_size2,
+ TEE_OperationHandle *oph)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = algo;
+ op.params[0].value.b = mode;
+ op.params[1].value.a = obj_size1 + obj_size2;
+ op.params[3].value.a = (uint32_t)*oph;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_VALUE_INPUT,
+ TEEC_NONE, TEEC_VALUE_INPUT);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Store this information about mode and algorithm
+ * in order to do cryptographic operation later
+ */
+ if (res == TEEC_SUCCESS) {
+ saved_alloc.algo = algo;
+ saved_alloc.mode = mode;
+ saved_alloc.obj_size = obj_size1 + obj_size2;
+ }
+
+ return res;
+}
+
+/*CMD_GetOperationInfo*/
+static TEEC_Result Invoke_Crypto_GetOperationInfo(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph, const uint32_t algo,
+ uint32_t op_class, TEE_OperationMode op_mod,
+ const size_t dgst_length, const size_t obj1_size,
+ const size_t obj2_size,
+ const size_t key_size, uint32_t key_usage,
+ bool two_keys, bool key_set, bool initialized)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)*oph;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INOUT, TEEC_VALUE_OUTPUT,
+ TEEC_VALUE_OUTPUT, TEEC_VALUE_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ ADBG_EXPECT(c, op.params[0].value.a, algo);
+ ADBG_EXPECT(c, op.params[0].value.b, op_class);
+ ADBG_EXPECT(c, op.params[1].value.a, (uint32_t)op_mod);
+ ADBG_EXPECT(c, op.params[1].value.b, dgst_length);
+ ADBG_EXPECT(c, op.params[2].value.a, obj1_size + obj2_size);
+ ADBG_EXPECT(c, op.params[2].value.b, key_size);
+ ADBG_EXPECT(c, op.params[3].value.a, key_usage);
+
+ if (two_keys && key_set && initialized) {
+ ADBG_EXPECT(c, op.params[3].value.b,
+ 0x00020000 | 0x00040000 | 0x00080000);
+ } else if (two_keys && key_set) {
+ ADBG_EXPECT(c, op.params[3].value.b,
+ 0x00020000 | 0x00040000);
+ } else if (two_keys && initialized) {
+ ADBG_EXPECT(c, op.params[3].value.b,
+ 0x00020000 | 0x00080000);
+ } else if (key_set && initialized) {
+ ADBG_EXPECT(c, op.params[3].value.b,
+ 0x00040000 | 0x00080000);
+ }
+ }
+
+ return res;
+}
+
+/*CMD_ResetOperation*/
+static TEEC_Result Invoke_Crypto_ResetOperation(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)*oph;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ return res;
+}
+
+/*CMD_FreeAllKeysAndOperations*/
+static TEEC_Result Invoke_Crypto_FreeAllKeysAndOperations(
+ ADBG_Case_t *c,
+ TEEC_Session *s,
+ uint32_t cmd_id,
+ TEE_OperationHandle *oph)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)*oph;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ return res;
+}
+
+/*CMD_InitObjectWithKeys*/
+static TEEC_Result Invoke_Crypto_InitObjectWithKeys(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, const uint32_t obj_type, const uint32_t obj_size,
+ const uint32_t attributeId_1, const void *attribValue_1,
+ const uint32_t attribSize_1,
+ const uint32_t attributeId_2, const void *attribValue_2,
+ const uint32_t attribSize_2,
+ const uint32_t attributeId_3, const void *attribValue_3,
+ const uint32_t attribSize_3,
+ const uint32_t attributeId_4, const void *attribValue_4,
+ const uint32_t attribSize_4,
+ const uint32_t attributeId_5, const void *attribValue_5,
+ const uint32_t attribSize_5,
+ TEE_ObjectHandle *obh)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ void *tmp_buf1 = NULL;
+ uint8_t *tmp_buf2 = NULL;
+ int tmp_offset = 0;
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT)
+
+ /* Serialize the data in format:
+ * SHARE_MEM01 = (uint32_t)attr_id1|(uint32_t)attr_val1_offset
+ * in SHARE_MEM02|(uint32_t)attr_val1_length
+ * Add 0 for all three if attr_idX = TEE_ATTR_NONE
+ */
+ /* Serialize the data in format:
+ * SHARE_MEM02 = attr_val1|attr_val2|attr_val3|attr_val4|attr_val5.
+ * Do not add anything if attr_valX == TEE_ATTR_VALUE_NONE.
+ */
+
+ tmp_buf1 = SHARE_MEM01->buffer;
+ tmp_buf2 = (uint8_t *)SHARE_MEM02->buffer;
+ put_uint32_be(&tmp_buf1, attributeId_1);
+
+ if (TEE_ATTR_NONE != attributeId_1) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_1);
+ memcpy(tmp_buf2, attribValue_1, (size_t)attribSize_1);
+ tmp_buf2 += attribSize_1;
+ tmp_offset += attribSize_1;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_2);
+
+ if (TEE_ATTR_NONE != attributeId_2) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_2);
+ memcpy(tmp_buf2, attribValue_2, (size_t)attribSize_2);
+ tmp_buf2 += attribSize_2;
+ tmp_offset += attribSize_2;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_3);
+
+ if (TEE_ATTR_NONE != attributeId_3) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_3);
+ memcpy(tmp_buf2, attribValue_3, (size_t)attribSize_3);
+ tmp_buf2 += attribSize_3;
+ tmp_offset += attribSize_3;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_4);
+
+ if (TEE_ATTR_NONE != attributeId_4) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_4);
+ memcpy(tmp_buf2, attribValue_4, (size_t)attribSize_4);
+ tmp_buf2 += attribSize_4;
+ tmp_offset += attribSize_4;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_5);
+
+ if (TEE_ATTR_NONE != attributeId_5) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_5);
+ memcpy(tmp_buf2, attribValue_5, (size_t)attribSize_5);
+ tmp_buf2 += attribSize_5;
+ tmp_offset += attribSize_5;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ op.params[0].value.a = obj_type;
+ op.params[0].value.b = obj_size;
+ /* 5 attributes
+ * 12 bytes = 4 attr_id + 4 attr_offset + 4 attr_length
+ */
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01, 60)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02, tmp_offset)
+ op.params[3].value.a = (uint32_t)*obh;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_VALUE_INPUT);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Store the key values associated with ObjectHandle in
+ * order to perform cryptographic computation later
+ */
+ if (res == TEEC_SUCCESS) {
+ saved_key_vals.obj_type = obj_type;
+ saved_key_vals.obj_size = obj_size;
+ saved_key_vals.obh = *obh;
+
+ CRYPTO_FREE(saved_key_vals.key);
+ saved_key_vals.key.size = tmp_offset;
+ saved_key_vals.key.buffer = malloc(tmp_offset);
+ memcpy(saved_key_vals.key.buffer, SHARE_MEM02->buffer,
+ tmp_offset);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+
+ return res;
+}
+
+/*CMD_SetOperationKey*/
+static TEEC_Result Invoke_Crypto_SetOperationKey(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph, TEE_ObjectHandle *obh)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)*oph;
+ op.params[0].value.b = (uint32_t)*obh;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* store the information about which key object handle are associated
+ * with Operation Handle in order to perform cryptographic
+ * computation later
+ */
+ if (res == TEEC_SUCCESS) {
+ saved_obh.oph = *oph;
+ saved_obh.obh1 = *obh;
+ saved_obh.obh2 = TEE_HANDLE_NULL;
+ }
+
+ return res;
+}
+
+/*CMD_SetOperationKey2*/
+static TEEC_Result Invoke_Crypto_SetOperationKey2(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ TEE_ObjectHandle *obh1, TEE_ObjectHandle *obh2)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)*oph;
+ op.params[0].value.b = (uint32_t)*obh1;
+ op.params[1].value.a = (uint32_t)*obh2;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_VALUE_INPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Store the information about which key object handles are associated
+ * with Operation Handle in order to perform cryptographic
+ * computation later
+ */
+ if (res == TEEC_SUCCESS) {
+ saved_obh.oph = *oph;
+ saved_obh.obh1 = *obh1;
+ saved_obh.obh2 = *obh2;
+ }
+
+ return res;
+}
+
+/*CMD_DeriveKey*/
+static TEEC_Result Invoke_Crypto_DeriveKey(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph, TEE_ObjectHandle *obh)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)*oph;
+ op.params[0].value.b = (uint32_t)*obh;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Save the fact that the object has been derived for later
+ * cryptographic computation
+ */
+ if (res == TEEC_SUCCESS) {
+ saved_derive.oph = *oph;
+ saved_derive.obh = *obh;
+ }
+
+ return res;
+}
+
+/*CMD_AEInit*/
+static TEEC_Result Invoke_Crypto_AEInit(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *nonce_val, const size_t nonce_length,
+ const size_t in_tag_len, const size_t in_aad_len,
+ const size_t in_payload_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, nonce_length,
+ TEEC_MEMREF_PARTIAL_INPUT, nonce_length,
+ nonce_val)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ op.params[0].value.b = in_tag_len;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ op.params[2].value.a = in_aad_len;
+ op.params[2].value.b = in_payload_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_VALUE_INPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Save the $IN_nonce$ for later computation of encryptedData
+ */
+ if (res == TEEC_SUCCESS) {
+ saved_in_nonce.buffer = malloc(nonce_length);
+ saved_in_nonce.size = nonce_length;
+ memcpy(saved_in_nonce.buffer, nonce_val, nonce_length);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+/*CMD_AEUpdate*/
+static TEEC_Result Invoke_Crypto_AEUpdate_for_encryption(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length,
+ const uint32_t case_buf, const uint32_t chunk_id)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ /*if $IN_caseBuffer$ = OUTPUT_BUFFER_TOO_SHORT(2)
+ then Param[3].memref.size=1 */
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Store the buffer from "shm2" in
+ * "buffer_encrypted_chunks[$IN_chunkNumber$]"
+ * which will be reused for the
+ * Invoke_Crypto_TEE_AEUpdate_for_decryption function
+ */
+ if (res == TEEC_SUCCESS) {
+ buffer_encrypted_chunks[chunk_id].size =
+ op.params[3].memref.size;
+ buffer_encrypted_chunks[chunk_id].buffer = malloc(
+ buffer_encrypted_chunks[chunk_id].size);
+ memcpy(buffer_encrypted_chunks[chunk_id].buffer,
+ SHARE_MEM02->buffer,
+ buffer_encrypted_chunks[chunk_id].size);
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+/*CMD_AEUpdate*/
+
+static TEEC_Result Invoke_Crypto_AEUpdate_for_decryption(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length,
+ const uint32_t case_buf, const uint32_t chunk_id)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ buffer_encrypted_chunks[chunk_id].size,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ buffer_encrypted_chunks[chunk_id].size,
+ buffer_encrypted_chunks[chunk_id].
+ buffer)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, partd_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01, partd_length)
+ /*if $IN_caseBuffer$ = OUTPUT_BUFFER_TOO_SHORT(2)
+ then Param[3].memref.size=1*/
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Save the buffer from "SharedMem2" into
+ * "buffer_decrypted_chunks[$IN_chunkNumber$]"
+ * in order to collapse all buffers returned for
+ * AEUpdate_for_decryption,
+ * which will be used in AEDecryptFinal
+ */
+ if (res == TEEC_SUCCESS) {
+ buffer_decrypted_chunks[chunk_id].size =
+ op.params[3].memref.size;
+ buffer_decrypted_chunks[chunk_id].buffer = malloc(
+ buffer_decrypted_chunks[chunk_id].size);
+ memcpy(buffer_decrypted_chunks[chunk_id].buffer,
+ SHARE_MEM02->buffer,
+ buffer_decrypted_chunks[chunk_id].size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_AEUpdateAAD*/
+static TEEC_Result Invoke_Crypto_AEUpdateAAD(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *aad_data, const size_t aad_length)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, aad_length,
+ TEEC_MEMREF_PARTIAL_INPUT, aad_length,
+ aad_data)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Save the $IN_AAD_Value$ for AAD for later cryptographic computation
+ */
+ if (res == TEEC_SUCCESS) {
+ saved_aad_value.buffer = malloc(aad_length);
+ saved_aad_value.size = aad_length;
+ memcpy(saved_aad_value.buffer, aad_data, aad_length);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+/*CMD_AEEncryptFinal*/
+static TEEC_Result Invoke_Crypto_AEEncryptFinal(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length,
+ const void *full_data, const size_t fdata_length,
+ uint32_t case_buf, uint32_t chunk_id)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_partd_size, initial_fdata_size;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, fdata_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, partd_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ switch (case_buf) {
+ case OUTPUT_BUFFER_TOO_SHORT:
+ /*if $IN_caseBuffer$ =
+ OUTPUT_BUFFER_TOO_SHORT(2) then Param[3].memref.size=1*/
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ break;
+ case OUTPUT_OTHER_BUFFER_TOO_SHORT:
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM03, 1)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ break;
+ case OUTPUT_BUFFER_NORMAL:
+ default:
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ break;
+ }
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_OUTPUT,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_partd_size = op.params[2].memref.size;
+ initial_fdata_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Store the buffer from "shm2" in
+ * "buffer_encrypted_chunks[$IN_chunkNumber$]"
+ * which will be reused for
+ * the Invoke_Crypto_TEE_AEDecryptFinal function
+ */
+ buffer_encrypted_chunks[chunk_id].size =
+ op.params[3].memref.size;
+ buffer_encrypted_chunks[chunk_id].buffer = malloc(
+ buffer_encrypted_chunks[chunk_id].size);
+ memcpy(buffer_encrypted_chunks[chunk_id].buffer,
+ SHARE_MEM02->buffer,
+ buffer_encrypted_chunks[chunk_id].size);
+
+ /* Store the tag from "SharedMem3" which will be reused for the
+ * Invoke_Crypto_TEE_AEDecryptFinal function
+ */
+ ae_encrypt_tag.size = op.params[2].memref.size;
+ ae_encrypt_tag.buffer = malloc(ae_encrypt_tag.size);
+ memcpy(ae_encrypt_tag.buffer, SHARE_MEM03->buffer,
+ ae_encrypt_tag.size);
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ if (initial_partd_size == op.params[2].memref.size)
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_fdata_size, <,
+ op.params[3].memref.size);
+ else
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_partd_size, <,
+ op.params[2].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+/*CMD_AEDecryptFinal*/
+static TEEC_Result Invoke_Crypto_AEDecryptFinal(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length,
+ const void *full_data, const size_t fdata_length,
+ const uint32_t case_buf, const enum mac_validity mac_case,
+ const uint32_t chunk_id)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ buffer_encrypted_chunks[chunk_id].size,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ buffer_encrypted_chunks[chunk_id].size,
+ buffer_encrypted_chunks[chunk_id].
+ buffer)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, partd_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ae_encrypt_tag.size,
+ TEEC_MEMREF_PARTIAL_INPUT)
+ /* Fill "SharedMem3" with the tag previously
+ * saved in Invoke_Crypto_AEEncryptFinal
+ * (with an error (one bit changed) if $IN_caseMac$ = INVALID_MAC)
+ */
+ if (ae_encrypt_tag.buffer != NULL) {
+ memcpy(SHARE_MEM03->buffer, ae_encrypt_tag.buffer,
+ ae_encrypt_tag.size);
+
+ if (mac_case == INVALID_MAC)
+ BIT_CHANGE(*(uint32_t *)SHARE_MEM03->buffer, 4);
+ }
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+ /*if $IN_caseBuffer$ = OUTPUT_BUFFER_TOO_SHORT(2)
+ then Param[3].memref.size=1*/
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Save the buffer from "SharedMem2" to
+ * "buffer_decrypted_chunks[$IN_chunkNumber$]"
+ */
+ buffer_decrypted_chunks[chunk_id].size =
+ op.params[3].memref.size;
+ buffer_decrypted_chunks[chunk_id].buffer = malloc(
+ buffer_decrypted_chunks[chunk_id].size);
+ memcpy(buffer_decrypted_chunks[chunk_id].buffer,
+ SHARE_MEM02->buffer,
+ buffer_decrypted_chunks[chunk_id].size);
+
+ /* Compare the data in clear $IN_fullDataValue$ and with
+ * collapsed buffers from table
+ * "buffer_decrypted_chunks" and check they are equals
+ */
+ struct crypto_buffer collapsed;
+ CRYPTO_INIT(collapsed);
+ collapse_crypto_buffers(buffer_decrypted_chunks, &collapsed);
+ ADBG_EXPECT_BUFFER(c, full_data, fdata_length, collapsed.buffer,
+ collapsed.size);
+ CRYPTO_FREE(collapsed);
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+/*CMD_GenerateRandom*/
+static TEEC_Result Invoke_Crypto_GenerateRandom(ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_NONE, TEEC_NONE, TEEC_NONE,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Check that the buffer shm1 is not empty
+ * + Check that this random value is
+ * different of a previous call of this command
+ */
+ if (res == TEEC_SUCCESS) {
+ if (ADBG_EXPECT_COMPARE_SIGNED(c, 0, !=,
+ op.params[3].memref.size)) {
+ if (saved_random.buffer != NULL) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, 0, !=,
+ memcmp(
+ SHARE_MEM01
+ ->
+ buffer,
+ saved_random
+ .
+ buffer,
+ op.
+ params[3].
+ memref.
+ size));
+ free(saved_random.buffer);
+ saved_random.size = 0;
+ }
+
+ saved_random.size = op.params[3].memref.size;
+ saved_random.buffer = malloc(saved_random.size);
+ memcpy(saved_random.buffer, SHARE_MEM01->buffer,
+ saved_random.size);
+ }
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+/*CMD_DigestUpdate*/
+static TEEC_Result Invoke_Crypto_DigestUpdate(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+/*CMD_DigestDoFinal*/
+static TEEC_Result Invoke_Crypto_DigestDoFinal(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length,
+ const void *full_data, const size_t fdata_length,
+ const uint32_t case_buf)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, fdata_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Compute the hash of $IN_fullDataValue$
+ * and compare it to "shm2"
+ */
+ struct crypto_buffer tmp_dgst;
+ CRYPTO_INIT(tmp_dgst);
+ ADBG_EXPECT_TEEC_SUCCESS(c, res =
+ calculate_digest(c, s,
+ full_data,
+ fdata_length,
+ &tmp_dgst));
+ ADBG_EXPECT_BUFFER(c, tmp_dgst.buffer, tmp_dgst.size,
+ SHARE_MEM02->buffer, tmp_dgst.size);
+
+ /* Store the Digest value which can be reused for a next call to
+ * TEE_AsymmetricSignDigest or TEE_AsymmetricVerifyDigest
+ */
+ CRYPTO_FREE(saved_digest);
+ saved_digest.size = op.params[3].memref.size;
+ saved_digest.buffer = malloc(saved_digest.size);
+ memcpy(saved_digest.buffer, SHARE_MEM02->buffer,
+ saved_digest.size);
+ CRYPTO_FREE(tmp_dgst);
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_AsymmetricSignDigest*/
+static TEEC_Result Invoke_Crypto_AsymmetricSignDigest(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *full_data, const size_t fdata_length, uint32_t case_buf)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ /* Fill SharedMem1 with the previously stored Digest
+ value after TEE_DigestDoFinal */
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, fdata_length,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ saved_digest.size, saved_digest.buffer)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, 512,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ saved_digest.size)
+ /*if $IN_caseBuffer$ = OUTPUT_BUFFER_TOO_SHORT(2)
+ then Param[3].memref.size=1*/
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Compute a Verify_Signature of the signature
+ * store under "SharedMem2"
+ */
+ struct crypto_buffer s_dgst;
+ CRYPTO_INIT(s_dgst);
+ s_dgst.size = op.params[3].memref.size;
+ s_dgst.buffer = malloc(s_dgst.size);
+ memcpy(s_dgst.buffer, SHARE_MEM02->buffer, s_dgst.size);
+ ADBG_EXPECT(c, true, verify_digest(c, s, &s_dgst));
+ CRYPTO_FREE(s_dgst);
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_AsymmetricVerifyDigest*/
+static TEEC_Result Invoke_Crypto_AsymmetricVerifyDigest(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *full_data, const size_t fdata_length,
+ const uint32_t valid_sig)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, fdata_length,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ saved_digest.size, saved_digest.buffer)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, 512,
+ TEEC_MEMREF_PARTIAL_INPUT)
+
+ struct crypto_buffer signed_dgst;
+ CRYPTO_INIT(signed_dgst);
+ res = sign_digest(c, s, &saved_digest, &signed_dgst);
+
+ /* Fill "SharedMem2" with the valid computed signature based on
+ * the previously stored Digest value after TEE_DigestDoFinal
+ */
+ if (signed_dgst.buffer != NULL) {
+ memcpy(SHARE_MEM02->buffer, signed_dgst.buffer,
+ signed_dgst.size);
+
+ if (valid_sig != VALID_SIGNATURE) {
+ /*make it invalid*/
+ BIT_CHANGE(*(uint32_t *)SHARE_MEM02->buffer, 4);
+ }
+ }
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ saved_digest.size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ signed_dgst.size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_MEMREF_PARTIAL_INPUT);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ CRYPTO_FREE(signed_dgst);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_AsymmetricEncrypt*/
+static TEEC_Result Invoke_Crypto_AsymmetricEncrypt(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *full_data, const size_t fdata_length, uint32_t case_buf)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ /* Fill SharedMem1 with full_data */
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, fdata_length,
+ TEEC_MEMREF_PARTIAL_INPUT, fdata_length,
+ full_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, 512,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ /*if $IN_caseBuffer$ = OUTPUT_BUFFER_TOO_SHORT(2)
+ then Param[3].memref.size=1*/
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Check that "SharedMem2" is not empty
+ * Store the value from "SharedMem2" to a
+ * "buffer_asym_encrypted",
+ * which will be reused in Invoke_Crypto_AsymmetricDecrypt
+ */
+ if (ADBG_EXPECT_COMPARE_SIGNED(c, 0, !=,
+ op.params[3].memref.size)) {
+ buffer_asym_encrypted.size = op.params[3].memref.size;
+ buffer_asym_encrypted.buffer = malloc(
+ buffer_asym_encrypted.size);
+ memcpy(buffer_asym_encrypted.buffer,
+ SHARE_MEM02->buffer, buffer_asym_encrypted.size);
+ }
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_AsymmetricDecrypt*/
+static TEEC_Result Invoke_Crypto_AsymmetricDecrypt(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *full_data, const size_t fdata_length, uint32_t case_buf)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ /* Fill SharedMem1 with buffer_asym_encrypted */
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, fdata_length,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ buffer_asym_encrypted.size,
+ buffer_asym_encrypted.buffer)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, 512,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ buffer_asym_encrypted.size)
+ /*if $IN_caseBuffer$ = OUTPUT_BUFFER_TOO_SHORT(2)
+ then Param[3].memref.size=1*/
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Compare the clear data in
+ * $IN_fullDataValue$ with "SharedMem2"
+ * and check they are equal
+ */
+ ADBG_EXPECT_BUFFER(c, full_data, fdata_length,
+ SHARE_MEM02->buffer,
+ op.params[3].memref.size);
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_CopyOperation*/
+static TEEC_Result Invoke_Crypto_CopyOperation(
+ ADBG_Case_t *c, TEEC_Session *s, const uint32_t cmd_id,
+ TEE_OperationHandle *dst_oph, TEE_OperationHandle *src_oph)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)*dst_oph;
+ op.params[0].value.b = (uint32_t)*src_oph;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ return res;
+}
+
+/*CMD_MACInit*/
+static TEEC_Result Invoke_Crypto_MACInit(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *iv, const size_t iv_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM06, iv_len,
+ TEEC_MEMREF_PARTIAL_INPUT, iv_len, iv)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM06, iv_len)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* save the $IN_InitialisationVector$ for
+ * later computation of encryptedData
+ */
+ if (iv_len != 0) {
+ CRYPTO_FREE(saved_mac_iv);
+ saved_mac_iv.size = iv_len;
+ saved_mac_iv.buffer = malloc(iv_len);
+ memcpy(saved_mac_iv.buffer, iv, iv_len);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM06);
+ return res;
+}
+
+/*CMD_MACUpdate*/
+static TEEC_Result Invoke_Crypto_MACUpdate(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+/*CMD_MACCompareFinal*/
+static TEEC_Result Invoke_Crypto_MACCompareFinal(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length,
+ const void *full_data, const size_t fdata_length,
+ enum mac_validity mac_case)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ /* Fill SharedMem1 with part_data */
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, fdata_length,
+ TEEC_MEMREF_PARTIAL_INPUT)
+
+ /* Fill SharedMem2 with valid computed MAC of full_data */
+ struct crypto_buffer mac;
+ CRYPTO_INIT(mac);
+ res = mac_compute_final(c, s, full_data, fdata_length, &mac);
+
+ if (mac.buffer != NULL) {
+ memcpy(SHARE_MEM02->buffer, mac.buffer, mac.size);
+
+ if (mac_case != VALID_MAC) {
+ /* change one bit from the valid
+ MAC to make it invalid. */
+ BIT_CHANGE(*(uint32_t *)SHARE_MEM02->buffer, 4);
+ }
+ }
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02, mac.size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+exit:
+ CRYPTO_FREE(mac);
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_MACComputeFinal*/
+static TEEC_Result Invoke_Crypto_MACComputeFinal(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length,
+ const void *full_data, const size_t fdata_length, uint32_t case_buf)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ /* Fill SharedMem1 with part_data */
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, fdata_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ /* Compute the MAC of $IN_fullDataValue$ and
+ compare it to "SharedMem2" */
+ if (res == TEEC_SUCCESS) {
+ struct crypto_buffer tmp_mac;
+ CRYPTO_INIT(tmp_mac);
+ ADBG_EXPECT_TEEC_SUCCESS(c, res =
+ mac_compute_final(c, s,
+ full_data,
+ fdata_length,
+ &tmp_mac));
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ ADBG_EXPECT_COMPARE_SIGNED(c, 0, ==,
+ memcmp(SHARE_MEM02->buffer,
+ tmp_mac.buffer,
+ op.params[3].memref.size));
+ CRYPTO_FREE(tmp_mac);
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_CipherInit*/
+static TEEC_Result Invoke_Crypto_CipherInit(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *iv, const size_t iv_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, iv_len,
+ TEEC_MEMREF_PARTIAL_INPUT, iv_len, iv)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Save the $IN_InitialisationVector$ for later
+ * computation of encryptedData
+ */
+ if (iv != NULL) {
+ CRYPTO_FREE(saved_cipher_iv);
+ saved_cipher_iv.size = iv_len;
+ saved_cipher_iv.buffer = malloc(iv_len);
+ memcpy(saved_cipher_iv.buffer, iv, iv_len);
+ }
+ }
+
+exit:
+ CRYPTO_FREE(saved_cipher_update);
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+
+ return res;
+}
+/*CMD_CipherUpdate*/
+static TEEC_Result Invoke_Crypto_CipherUpdate(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, uint32_t partd_length,
+ uint32_t case_buf)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, partd_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ /*if $IN_caseBuffer$ = OUTPUT_BUFFER_TOO_SHORT(2)
+ then Param[3].memref.size=1*/
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Save the buffer returned in "SharedMem2" in order
+ * to collapse all buffers returned for CipherUpdate,
+ * which will be used in CipherDoFinal
+ */
+ if (op.params[3].memref.size != 0) {
+ void *tmp = realloc(saved_cipher_update.buffer,
+ saved_cipher_update.size +
+ op.params[3].memref.size);
+ saved_cipher_update.buffer = tmp;
+ memcpy(
+ saved_cipher_update.buffer +
+ saved_cipher_update.size, SHARE_MEM02->buffer,
+ op.params[3].memref.size);
+ saved_cipher_update.size += op.params[3].memref.size;
+ }
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_CipherDoFinal*/
+static TEEC_Result Invoke_Crypto_CipherDoFinal(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph,
+ const void *part_data, const size_t partd_length,
+ const void *full_data, const size_t fulld_length, uint32_t case_buf)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ size_t initial_size;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, partd_length,
+ TEEC_MEMREF_PARTIAL_INPUT, partd_length,
+ part_data)
+ /* used fulld_length instead of partd_length as
+ described in the Adaptation layer specification.*/
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, fulld_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)*oph;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ /*if $IN_caseBuffer$ = OUTPUT_BUFFER_TOO_SHORT(2)
+ then Param[3].memref.size=1*/
+ if (case_buf == OUTPUT_BUFFER_TOO_SHORT) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02, 1)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+ initial_size = op.params[3].memref.size;
+
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ /* Append the buffer returned in "SharedMem2"
+ * to the previously buffers
+ * returned for CipherUpdate => "collapsed_buffers"
+ */
+ if (op.params[3].memref.size != 0) {
+ void *tmp = realloc(saved_cipher_update.buffer,
+ saved_cipher_update.size +
+ op.params[3].memref.size);
+ saved_cipher_update.buffer = tmp;
+ memcpy(
+ saved_cipher_update.buffer +
+ saved_cipher_update.size, SHARE_MEM02->buffer,
+ op.params[3].memref.size);
+ saved_cipher_update.size += op.params[3].memref.size;
+ }
+
+ /* Compute the ciphered data of
+ * $IN_fullDataValue$ and compare it
+ * to "collapsed_buffers"
+ */
+ struct crypto_buffer full_ciphered_data;
+ CRYPTO_INIT(full_ciphered_data);
+ ADBG_EXPECT_TEEC_SUCCESS(c, res =
+ cipher_do_final(c, s,
+ full_data,
+ fulld_length,
+ &
+ full_ciphered_data));
+
+ if (res == TEEC_SUCCESS) {
+ ADBG_EXPECT_BUFFER(c, full_ciphered_data.buffer,
+ full_ciphered_data.size,
+ saved_cipher_update.buffer,
+ saved_cipher_update.size);
+ } else if (res == TEEC_ERROR_SHORT_BUFFER) {
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, initial_size, <,
+ op.params[3].memref.size);
+ }
+
+ CRYPTO_FREE(full_ciphered_data);
+ CRYPTO_FREE(saved_cipher_update);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+/*CMD_FreeOperation*/
+static TEEC_Result Invoke_Crypto_FreeOperation(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const uint32_t cmd_id, TEE_OperationHandle *oph)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)*oph;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+ res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);
+
+ return res;
+}
+
+static TEEC_Result calculate_digest(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const void *data, const size_t data_length,
+ struct crypto_buffer *digest)
+{
+ TEEC_Result res = TEEC_ERROR_GENERIC;
+ TEE_OperationHandle op1 = (TEE_OperationHandle)3;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ res = Invoke_Crypto_AllocateOperation(c, s, CMD_AllocateOperation,
+ saved_alloc.algo, TEE_MODE_DIGEST,
+ saved_alloc.obj_size, 0, &op1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ /*CMD_DigestDoFinal*/
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM04, data_length,
+ TEEC_MEMREF_PARTIAL_INPUT, data_length,
+ data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM05, data_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)op1;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM04,
+ SHARE_MEM04->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM05,
+ SHARE_MEM05->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, CMD_DigestDoFinal, &op, &ret_orig);
+
+ if (SHARE_MEM05->size != 0 && res == TEEC_SUCCESS) {
+ digest->size = op.params[3].memref.size;
+ digest->buffer = malloc(op.params[3].memref.size);
+ memcpy(digest->buffer, SHARE_MEM05->buffer,
+ op.params[3].memref.size);
+ }
+
+exit:
+ Invoke_Crypto_FreeOperation(c, s, CMD_FreeOperation, &op1);
+ TEEC_ReleaseSharedMemory(SHARE_MEM04);
+ TEEC_ReleaseSharedMemory(SHARE_MEM05);
+ return res;
+}
+
+static TEEC_Result sign_digest(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const struct crypto_buffer *in_dgst, struct crypto_buffer *out_dgst)
+{
+ TEEC_Result res = TEEC_ERROR_GENERIC;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ TEE_OperationHandle op1 = (TEE_OperationHandle)3;
+ uint32_t ret_orig;
+
+ res = Invoke_Crypto_AllocateOperation(c, s, CMD_AllocateOperation,
+ saved_alloc.algo, TEE_MODE_SIGN,
+ saved_alloc.obj_size, 0, &op1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ if (saved_obh.obh2 != TEE_HANDLE_NULL) {
+ res = Invoke_Crypto_SetOperationKey2(c, s, CMD_SetOperationKey2,
+ &op1, &saved_obh.obh1,
+ &saved_obh.obh2);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ } else if (saved_obh.obh1 != TEE_HANDLE_NULL) {
+ res = Invoke_Crypto_SetOperationKey(c, s, CMD_SetOperationKey,
+ &op1, &saved_obh.obh1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ }
+
+ /*CMD_AsymmetricSignDigest*/
+ /* Fill SharedMem1 with the previously stored
+ Digest value after TEE_DigestDoFinal*/
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM04, 512,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ in_dgst->size, in_dgst->buffer)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM05, 512,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)op1;
+ if (in_dgst->size != 0) {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM04,
+ in_dgst->size)
+ } else {
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM04,
+ SHARE_MEM04->size)
+ }
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM05,
+ SHARE_MEM05->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, CMD_AsymmetricSignDigest, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ out_dgst->size = op.params[3].memref.size;
+ out_dgst->buffer = malloc(out_dgst->size);
+ memcpy(out_dgst->buffer, SHARE_MEM05->buffer, out_dgst->size);
+ }
+
+exit:
+ Invoke_Crypto_FreeOperation(c, s, CMD_FreeOperation, &op1);
+ TEEC_ReleaseSharedMemory(SHARE_MEM04);
+ TEEC_ReleaseSharedMemory(SHARE_MEM05);
+ return res;
+}
+
+static bool verify_digest(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const struct crypto_buffer *in_sdgst)
+{
+ TEEC_Result res;
+ bool is_valid = false;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ TEE_OperationHandle op1 = (TEE_OperationHandle)3;
+ uint32_t ret_orig;
+
+ res = Invoke_Crypto_AllocateOperation(c, s, CMD_AllocateOperation,
+ saved_alloc.algo, TEE_MODE_VERIFY,
+ saved_alloc.obj_size, 0, &op1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ if (saved_obh.obh2 != TEE_HANDLE_NULL) {
+ res = Invoke_Crypto_SetOperationKey2(c, s, CMD_SetOperationKey2,
+ &op1, &saved_obh.obh1,
+ &saved_obh.obh2);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ } else if (saved_obh.obh1 != TEE_HANDLE_NULL) {
+ res = Invoke_Crypto_SetOperationKey(c, s, CMD_SetOperationKey,
+ &op1, &saved_obh.obh1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ }
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM04, 512,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ saved_digest.size, saved_digest.buffer)
+ /* Fill "SharedMem2" with signature based on the previously
+ stored Digest value after TEE_DigestDoFinal */
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM05, 512,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ in_sdgst->size, in_sdgst->buffer)
+
+ op.params[0].value.a = (uint32_t)op1;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM04,
+ saved_digest.size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM05, in_sdgst->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_MEMREF_PARTIAL_INPUT);
+
+ res = TEEC_InvokeCommand(s, CMD_AsymmetricVerifyDigest, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS)
+ is_valid = true;
+
+exit:
+ Invoke_Crypto_FreeOperation(c, s, CMD_FreeOperation, &op1);
+ TEEC_ReleaseSharedMemory(SHARE_MEM04);
+ TEEC_ReleaseSharedMemory(SHARE_MEM05);
+ return is_valid;
+}
+
+static TEEC_Result mac_compute_final(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const void *full_data, const size_t fdata_length,
+ struct crypto_buffer *mac)
+{
+ TEEC_Result res = TEEC_ERROR_GENERIC;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ TEE_OperationHandle op1 = (TEE_OperationHandle)3;
+ uint32_t ret_orig;
+
+ res = Invoke_Crypto_AllocateOperation(c, s, CMD_AllocateOperation,
+ saved_alloc.algo, TEE_MODE_MAC,
+ saved_alloc.obj_size, 0, &op1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ if (saved_obh.obh2 != TEE_HANDLE_NULL) {
+ res = Invoke_Crypto_SetOperationKey2(c, s, CMD_SetOperationKey2,
+ &op1, &saved_obh.obh1,
+ &saved_obh.obh2);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ } else if (saved_obh.obh1 != TEE_HANDLE_NULL) {
+ res = Invoke_Crypto_SetOperationKey(c, s, CMD_SetOperationKey,
+ &op1, &saved_obh.obh1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+ }
+
+ res = Invoke_Crypto_MACInit(c, s, CMD_MACInit, &op1,
+ saved_mac_iv.buffer, saved_mac_iv.size);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ /* CMD_MACComputeFinal */
+ /* Fill SharedMem1 with full_data */
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM04, fdata_length,
+ TEEC_MEMREF_PARTIAL_INPUT, fdata_length,
+ full_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM05, fdata_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)op1;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM04,
+ SHARE_MEM04->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM05,
+ SHARE_MEM05->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, CMD_MACComputeFinal, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ mac->size = op.params[3].memref.size;
+ mac->buffer = malloc(mac->size);
+ memcpy(mac->buffer, SHARE_MEM05->buffer, mac->size);
+ }
+
+exit:
+ Invoke_Crypto_FreeOperation(c, s, CMD_FreeOperation, &op1);
+ TEEC_ReleaseSharedMemory(SHARE_MEM04);
+ TEEC_ReleaseSharedMemory(SHARE_MEM05);
+ return res;
+}
+
+static TEEC_Result cipher_do_final(
+ ADBG_Case_t *c, TEEC_Session *s,
+ const void *full_data, const size_t fdata_length,
+ struct crypto_buffer *cipher)
+{
+ TEEC_Result res = TEEC_ERROR_GENERIC;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ TEE_OperationHandle op1 = (TEE_OperationHandle)3;
+ uint32_t ret_orig;
+
+ res = Invoke_Crypto_AllocateOperation(c, s, CMD_AllocateOperation,
+ saved_alloc.algo,
+ TEE_MODE_ENCRYPT,
+ saved_alloc.obj_size, 0, &op1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ if (saved_obh.obh2 != TEE_HANDLE_NULL) {
+ res = Invoke_Crypto_SetOperationKey2(c, s, CMD_SetOperationKey2,
+ &op1, &saved_obh.obh1,
+ &saved_obh.obh2);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ } else if (saved_obh.obh1 != TEE_HANDLE_NULL) {
+ res = Invoke_Crypto_SetOperationKey(c, s, CMD_SetOperationKey,
+ &op1, &saved_obh.obh1);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ }
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM04, fdata_length,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ saved_cipher_iv.size,
+ saved_cipher_iv.buffer)
+
+ op.params[0].value.a = (uint32_t)op1;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM04,
+ saved_cipher_iv.size)
+
+ op.params[1].memref.offset = 0;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, CMD_CipherInit, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ TEEC_ReleaseSharedMemory(SHARE_MEM04);
+
+ /* CMD_CipherDoFinal */
+ /* Fill SharedMem1 with full_data */
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM04, fdata_length,
+ TEEC_MEMREF_PARTIAL_INPUT, fdata_length,
+ full_data)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM05, fdata_length,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = (uint32_t)op1;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM04,
+ SHARE_MEM04->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM05,
+ SHARE_MEM05->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_NONE, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, CMD_CipherDoFinal, &op, &ret_orig);
+
+ if (res == TEEC_SUCCESS) {
+ cipher->size = op.params[3].memref.size;
+ cipher->buffer = malloc(cipher->size);
+ memcpy(cipher->buffer, SHARE_MEM05->buffer, cipher->size);
+ }
+
+exit:
+ Invoke_Crypto_FreeOperation(c, s, CMD_FreeOperation, &op1);
+ TEEC_ReleaseSharedMemory(SHARE_MEM04);
+ TEEC_ReleaseSharedMemory(SHARE_MEM05);
+ return res;
+}
+
+#endif /* XML_CRYPTO_API_H_ */
diff --git a/host/xtest/xml/include/xml_datastorage_api.h b/host/xtest/xml/include/xml_datastorage_api.h
new file mode 100644
index 0000000..2039cfa
--- /dev/null
+++ b/host/xtest/xml/include/xml_datastorage_api.h
@@ -0,0 +1,1356 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef XML_DATASTORAGE_API_H_
+#define XML_DATASTORAGE_API_H_
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+#ifdef USER_SPACE
+#include <pthread.h>
+#include <unistd.h>
+#endif
+
+#include "tee_client_api.h"
+#undef TA_UUID
+#include "TTA_DS_protocol.h"
+
+#define Invoke_FreeTransientObjectPanic Invoke_Simple_Function
+#define Invoke_RenamePersistentObject_Success Invoke_Simple_Function
+#define Invoke_CloseObjectPanic Invoke_Simple_Function
+#define Invoke_CreatePersistentObject_AccessConflict Invoke_Simple_Function
+#define Invoke_CloseFreeAndResetObjectSuccessHandleNull Invoke_Simple_Function
+#define Invoke_GetObjectInfoPanic Invoke_Simple_Function
+#define Invoke_OpenPersistentObject_Conflict Invoke_Simple_Function
+#define Invoke_FreeCloseAndDeletePersistentObjectSuccessHandleNull \
+ Invoke_Simple_Function
+#define Invoke_ResetPersistentObjectEnumeratorPanic Invoke_Simple_Function
+#define Invoke_GetNextPersistentObjectPanic Invoke_Simple_Function
+#define Invoke_RestrictObjectUsagePanic Invoke_Simple_Function
+#define Invoke_GetObjectValueAttributePanic Invoke_Simple_Function
+#define Invoke_FreePersistentObjectEnumeratorPanic Invoke_Simple_Function
+#define Invoke_StartPersistentObjectEnumeratorPanic Invoke_Simple_Function
+#define Invoke_ResetTransientObjectPanic Invoke_Simple_Function
+#define Invoke_RenamePersistentObject_AccessConflict Invoke_Simple_Function
+#define Invoke_OpenPersistentObjectPanic Invoke_Simple_Function
+#define Invoke_CreatePersistentObject_ItemNotFound Invoke_Simple_Function
+
+#define Invoke_CreatePersistentObject_Success Invoke_Simple_Function_SubTestCase
+#define Invoke_CreatePersistentObjectPanic Invoke_Simple_Function_SubTestCase
+#define Invoke_OpenPersistentObject_ItemNotFound \
+ Invoke_Simple_Function_SubTestCase
+#define Invoke_ReadObjectDataPanic Invoke_Simple_Function_SubTestCase
+#define Invoke_OpenPersistentObject_Success Invoke_Simple_Function_SubTestCase
+#define Invoke_RenamePersistentObjectPanic Invoke_Simple_Function_SubTestCase
+#define Invoke_TruncateObjectDataPanic Invoke_Simple_Function_SubTestCase
+#define Invoke_CloseAndDeletePersistentObjectPanic \
+ Invoke_Simple_Function_SubTestCase
+#define Invoke_SeekObjectDataPanic Invoke_Simple_Function_SubTestCase
+#define Invoke_WriteObjectDataPanic Invoke_Simple_Function_SubTestCase
+
+#define Invoke_AllocateTransientChain Invoke_Simple_Function_Object
+#define Invoke_GetBufferAttribute_object_uninitialized \
+ Invoke_Simple_Function_Object
+
+#define CLIENT_APP01 NULL
+
+#define TEEC_UNDEFINED_ERROR 0xDEADDEAD
+
+#define TEEC_ORIGIN_ANY_NOT_TRUSTED_APP 0x00000005
+
+#define OFFSET_0 0
+#define OFFSET_HIGH 900
+#define OFFSET_LOW 300
+
+#define INITIAL_DATA_SIZE 1024
+#define LARGER_THAN_INITIAL 1500
+#define SHORTER_THAN_INITIAL 500
+
+#define KEY_SIZE_TOO_LARGE 4096
+#define SIZE_AES_256 256
+#define SIZE_DES3_192 168
+#define SIZE_DES_64 56
+#define SIZE_DH_KEYPAIR_1024 1024
+#define SIZE_DSA_KEYPAIR_768 768
+#define SIZE_DSA_PUBLIC_KEY_768 768
+#define SIZE_GENERIC_SECRET_2048 2048
+#define SIZE_HMAC_MD5_256 256
+#define SIZE_HMAC_SHA1_256 256
+#define SIZE_HMAC_SHA224_256 256
+#define SIZE_HMAC_SHA256_512 512
+#define SIZE_HMAC_SHA384_512 512
+#define SIZE_HMAC_SHA512_512 512
+#define SIZE_RSA_KEYPAIR_2048 2048
+/* #define SIZE_RSA_PUBLIC_KEY_2048 2048 */
+#define SIZE_ZERO 0
+#define WRONG_SIZE 5
+
+#define TEE_ERROR_TOO_SHORT_BUFFER TEE_ERROR_SHORT_BUFFER
+
+#define TEE_ATTR_NONE (uint32_t)0
+
+#define NOMINAL_CASE 0
+
+#define BUFFER_ATTRIBUTE 0
+#define VALUE_ATTRIBUTE 1
+
+#ifdef USER_SPACE
+/* Test data defines */
+static pthread_t THREAD01_DEFAULT;
+#endif
+
+/* Return ORIGIN */
+static uint32_t ret_orig;
+
+static TEEC_SharedMemory *SHARE_MEM01;
+static TEEC_SharedMemory *SHARE_MEM02;
+static TEEC_SharedMemory *SHARE_MEM03;
+static TEEC_SharedMemory *SHARE_MEM04;
+static TEEC_Session *SESSION01;
+static TEEC_Session *SESSION02;
+static TEEC_Context *CONTEXT01;
+static TEEC_Context *CONTEXT02;
+static TEEC_Operation *OPERATION01;
+static TEEC_Operation *OPERATION02;
+
+static uint32_t BIG_SIZE = 1024;
+static uint32_t DS_BIG_SIZE = 16384;
+
+static uint8_t BUFFER01[] = {
+ 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 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2d, 0x98, 0x10, 0xa3,
+ 0x09, 0x14, 0xdf, 0xf4,
+};
+
+static const uint8_t TEE_ATTR_DES3_192_VALUE01[] = {
+ 0xCD, 0xFE, 0x57, 0xB6, 0xB6, 0x2F, 0xAE, 0x6B, 0x04, 0x73, 0x40, 0xF1,
+ 0x02, 0xD6, 0xA4, 0x8C,
+ 0x89, 0x5D, 0xAD, 0xF2, 0x9D, 0x62, 0xEF, 0x25,
+};
+
+static uint8_t TEE_ATTR_DES_64_VALUE01[] = {
+ 0xCD, 0xFE, 0x57, 0xB6, 0xB6, 0x2F, 0xAE, 0x6B,
+};
+
+static uint8_t TEE_ATTR_DH_BASE_VALUE01[] = {
+ 0x1c, 0xe0, 0xf6, 0x69, 0x26, 0x46, 0x11, 0x97, 0xef, 0x45, 0xc4, 0x65,
+ 0x8b, 0x83, 0xb8, 0xab,
+ 0x04, 0xa9, 0x22, 0x42, 0x68, 0x50, 0x4d, 0x05, 0xb8, 0x19, 0x83, 0x99,
+ 0xdd, 0x71, 0x37, 0x18,
+ 0xcc, 0x1f, 0x24, 0x5d, 0x47, 0x6c, 0xcf, 0x61, 0xa2, 0xf9, 0x34, 0x93,
+ 0xf4, 0x1f, 0x55, 0x52,
+ 0x48, 0x65, 0x57, 0xe6, 0xd4, 0xca, 0xa8, 0x00, 0xd6, 0xd0, 0xdb, 0x3c,
+ 0xbf, 0x5a, 0x95, 0x4b,
+ 0x20, 0x8a, 0x4e, 0xba, 0xf7, 0xe6, 0x49, 0xfb, 0x61, 0x24, 0xd8, 0xa2,
+ 0x1e, 0xf2, 0xf2, 0x2b,
+ 0xaa, 0xae, 0x29, 0x21, 0x10, 0x19, 0x10, 0x51, 0x46, 0x47, 0x31, 0xb6,
+ 0xcc, 0x3c, 0x93, 0xdc,
+ 0x6e, 0x80, 0xba, 0x16, 0x0b, 0x66, 0x64, 0xa5, 0x6c, 0xfa, 0x96, 0xea,
+ 0xf1, 0xb2, 0x83, 0x39,
+ 0x8e, 0xb4, 0x61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 0x45, 0x1c,
+ 0xa3, 0xa6, 0xd5, 0x37,
+ 0x77, 0x75, 0x5b, 0xc1, 0x37, 0x0a, 0xce, 0xfe, 0x2b, 0x8f, 0x13, 0xa9,
+ 0x14, 0x2c, 0x5b, 0x44,
+ 0x15, 0x78, 0x86, 0x30, 0xd6, 0x95, 0xb1, 0x92, 0x20, 0x63, 0xa3, 0xcf,
+ 0x9d, 0xef, 0x65, 0x61,
+ 0x27, 0x4d, 0x24, 0x01, 0xe7, 0xa1, 0x45, 0xf2, 0xd8, 0xb9, 0x3a, 0x45,
+ 0x17, 0xf4, 0x19, 0xd0,
+ 0x5e, 0xf8, 0xcb, 0x35, 0x59, 0x37, 0x9d, 0x04, 0x20, 0xa3, 0xbf, 0x02,
+ 0xad, 0xfe, 0xa8, 0x60,
+ 0xb2, 0xc3, 0xee, 0x85, 0x58, 0x90, 0xf3, 0xb5, 0x57, 0x2b, 0xb4, 0xef,
+ 0xd7, 0x8f, 0x37, 0x68,
+ 0x78, 0x7c, 0x71, 0x52, 0x9d, 0x5e, 0x0a, 0x61, 0x4f, 0x09, 0x89, 0x92,
+ 0x39, 0xf7, 0x4b, 0x01,
+};
+
+static uint8_t TEE_ATTR_DH_SUBPRIME_VALUE01[] = { 0 };
+/* static uint8_t *TEE_ATTR_DH_SUBPRIME_VALUE01=NULL; */
+
+static uint8_t TEE_ATTR_HMAC_MD5_256_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f,
+};
+
+static uint8_t TEE_ATTR_HMAC_SHA1_256_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f,
+};
+
+static uint8_t TEE_ATTR_HMAC_SHA224_256_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f,
+};
+
+static uint8_t TEE_ATTR_HMAC_SHA256_512_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
+ 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
+ 0x3c, 0x3d, 0x3e, 0x3f,
+};
+
+static uint8_t TEE_ATTR_HMAC_SHA384_512_VALUE01[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x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39, 0xfa,
+ 0xeb, 0xfc, 0x59, 0x8a, 0x32, 0xe1, 0x74, 0xcb, 0x8a, 0x68, 0x03, 0x57,
+ 0xf8, 0x62, 0xf2, 0x0b,
+ 0x6e, 0x84, 0x32, 0xa5, 0x30, 0x65, 0x2f, 0x1c, 0x21, 0x39, 0xae, 0x1f,
+ 0xaf, 0x76, 0x8b, 0x83,
+};
+
+static uint8_t TEE_ATTR_DSA_PRIME_VALUE_WRONG01[] = {
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x2b, 0x7e, 0x53, 0x26,
+ 0xda, 0x43, 0x9d, 0xc1,
+ 0x47, 0x4c, 0x1a, 0xd1, 0x6f, 0x2f, 0x85, 0xe9, 0x2c, 0xea, 0x89, 0xfc,
+ 0xdc, 0x74, 0x66, 0x11,
+ 0xcf, 0x30, 0xdd, 0xc8, 0x5e, 0x33, 0xf5, 0x83, 0xc1, 0x9d, 0x10, 0xbc,
+ 0x1a, 0xc3, 0x93, 0x22,
+ 0x26, 0x24, 0x6f, 0xa7, 0xb9, 0xe0, 0xdd, 0x25, 0x77, 0xb5, 0xf4, 0x27,
+ 0x59, 0x4c, 0x39, 0xfa,
+ 0xeb, 0xfc, 0x59, 0x8a, 0x32, 0xe1, 0x74, 0xcb, 0x8a, 0x68, 0x03, 0x57,
+ 0xf8, 0x62, 0xf2, 0x0b,
+ 0x6e, 0x84, 0x32, 0xa5, 0x30, 0x65, 0x2f, 0x1c, 0x21, 0x39, 0xae, 0x1f,
+ 0xaf, 0x76, 0x8b, 0x83,
+};
+
+static uint8_t TEE_ATTR_DSA_SUBPRIME_VALUE01[] = {
+ 0x87, 0x44, 0xe4, 0xdd, 0xc6, 0xd0, 0x19, 0xa5, 0xea, 0xc2, 0xb1, 0x5a,
+ 0x15, 0xd7, 0xe1, 0xc7,
+ 0xf6, 0x63, 0x35, 0xf7,
+};
+
+static uint8_t TEE_ATTR_GENERIC_SECRET_2048_VALUE01[] = {
+ 0x00, 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 0x62, 0xa5, 0x9f, 0x26,
+};
+
+static uint8_t TEE_ATTR_DSA_PRIVATE_VALUE_VALUE01[] = {
+ 0x70, 0x4a, 0x46, 0xc6, 0x25, 0x2a, 0x95, 0xa3, 0x9b, 0x40, 0xe0, 0x43,
+ 0x5a, 0x69, 0x1b, 0xad,
+ 0xae, 0x52, 0xa5, 0xc0,
+};
+
+static uint8_t TEE_ATTR_DSA_PUBLIC_VALUE_VALUE01[] = {
+ 0x52, 0x9d, 0xed, 0x98, 0xa2, 0x32, 0x09, 0x85, 0xfc, 0x84, 0xb6, 0x5a,
+ 0x9d, 0xc8, 0xd4, 0xfe,
+ 0x41, 0xad, 0xa6, 0xe3, 0x59, 0x3d, 0x70, 0x4f, 0x08, 0x98, 0xc1, 0x4e,
+ 0xc2, 0x46, 0x34, 0xdd,
+ 0xf5, 0xf1, 0xdb, 0x47, 0xcc, 0x49, 0x15, 0xfc, 0xe1, 0xe2, 0x67, 0x4d,
+ 0x2e, 0xcd, 0x98, 0xd5,
+ 0x8b, 0x59, 0x8e, 0x8d, 0xdf, 0xaf, 0xf3, 0x0e, 0x88, 0x26, 0xf5, 0x0a,
+ 0xab, 0x40, 0x27, 0xb5,
+ 0xaa, 0xb8, 0x87, 0xc1, 0x9a, 0xd9, 0x6d, 0x7e, 0x57, 0xde, 0x53, 0x90,
+ 0xad, 0x8e, 0x55, 0x57,
+ 0xb4, 0x1a, 0x80, 0x19, 0xc9, 0x0d, 0x80, 0x60, 0x71, 0x79, 0xb5, 0x4e,
+ 0xb0, 0xad, 0x4d, 0x23,
+};
+
+static const uint8_t *TEE_ATTR_VALUE_NONE;
+
+static uint32_t TEE_ATTR_RSA_PUBLIC_EXPONENT_VALUE01[] = { 0x10001 };
+
+/** ALL_TEEC_UUID
+ *
+ * These constants are the UUID of existing
+ * Trusted Applications
+ */
+/* "SMARTCSLTDATAST1" */
+static TEEC_UUID UUID_TTA_testingInternalAPI_dataStorage = {
+ 0x534D4152, 0x5443, 0x534C,
+ { 0x54, 0x44, 0x41, 0x54, 0x41, 0x53, 0x54, 0x31 }
+};
+
+/* Helper functions/macros */
+
+#define ALLOCATE_SHARED_MEMORY(context, sharedMemory, sharedMemorySize, \
+ memoryType) \
+ res = AllocateSharedMemory(context, sharedMemory, sharedMemorySize, \
+ memoryType); \
+ if (res != TEEC_SUCCESS) { \
+ goto exit; \
+ } \
+ memset(sharedMemory->buffer, 0, sharedMemorySize);
+
+#define ALLOCATE_AND_FILL_SHARED_MEMORY(context, sharedMemory, \
+ sharedMemorySize, \
+ memoryType, copySize, data) \
+ res = AllocateSharedMemory(context, sharedMemory, sharedMemorySize, \
+ memoryType); \
+ if (res != TEEC_SUCCESS) { \
+ goto exit; \
+ } \
+ if (data != NULL) { \
+ memcpy(sharedMemory->buffer, data, copySize); \
+ }
+
+#define SET_SHARED_MEMORY_OPERATION_PARAMETER(parameterNumber, \
+ sharedMemoryOffset, \
+ sharedMemory, \
+ sharedMemorySize) \
+ op.params[parameterNumber].memref.offset = sharedMemoryOffset; \
+ op.params[parameterNumber].memref.size = sharedMemorySize; \
+ op.params[parameterNumber].memref.parent = sharedMemory;
+
+/* XML_VERIFY macro define.
+ *
+ * Use ADBG_EXPECT or ADBG_EXPECT_NOT depending on the
+ * expected return value.
+ *
+ * ADBG_EXPECT() -> IF(EXP == GOT) RETURN TRUE
+ * ADBG_EXPECT() -> IF(EXP != GOT) RETURN TRUE
+ */
+#define XML_VERIFY(c, exp, got) \
+ do { \
+ if (exp == TEEC_UNDEFINED_ERROR) \
+ ADBG_EXPECT_NOT(c, exp, got); \
+ else \
+ ADBG_EXPECT(c, exp, got); \
+ } while (0)
+
+/* Initialize context using TEEC_InitializeContext and
+ check the returned value. */
+#define XML_InitializeContext(c, name, context, expected) \
+ XML_VERIFY(c, expected, TEEC_InitializeContext(name, context))
+
+/* Open session using TEEC_OpenSession and
+ check the returned value and/or returned origin. */
+#define XML_OpenSession(c, context, session, destination, connectionMethod, \
+ connectionData, operation, returnOrigin, expected) \
+ do { \
+ XML_VERIFY(c, expected, \
+ TEEC_OpenSession(context, session, destination, \
+ connectionMethod, connectionData, \
+ operation, &ret_orig)); \
+ if ((returnOrigin != 0) && \
+ ((int)returnOrigin != TEEC_ORIGIN_ANY_NOT_TRUSTED_APP)) \
+ ADBG_EXPECT(c, (int)returnOrigin, ret_orig); \
+ else \
+ ADBG_EXPECT_NOT(c, (int)returnOrigin, ret_orig); \
+ } while (0)
+
+/*dummy functions*/
+#define TEEC_SelectApp(a, b) /*do nothing for now*/
+
+/*Allocates TEEC_SharedMemory inside of the TEE*/
+static TEEC_Result AllocateSharedMemory(TEEC_Context *ctx,
+ TEEC_SharedMemory *shm, uint32_t size,
+ uint32_t flags)
+{
+ shm->flags = flags;
+ shm->size = size;
+ return TEEC_AllocateSharedMemory(ctx, shm);
+}
+
+/**
+ * Writes 4 byte to @p *data_pp and increases
+ * @p *data_pp by 4 byte. The bytes are written
+ * in Big Endian Order.
+ */
+static void put_uint32_be(void **data_pp, uint32_t v)
+{
+ uint8_t *d = *(uint8_t **)data_pp;
+ uint8_t *v_p = (uint8_t *)&v;
+
+ d[3] = v_p[0];
+ d[2] = v_p[1];
+ d[1] = v_p[2];
+ d[0] = v_p[3];
+ *(uint8_t **)data_pp += sizeof(uint32_t);
+}
+
+/**
+ * Reads 4 byte from the @p *data_pp
+ * as they are written in Big Endian Order.
+ */
+static uint32_t get_uint32_be(void **data_pp)
+{
+ const uint8_t *d = *(const uint8_t **)data_pp;
+
+ *(const uint8_t **)data_pp += sizeof(uint32_t);
+ return ((d[0] << 8 | d[1]) << 8 | d[2]) << 8 | d[3];
+}
+
+static TEEC_Result Invoke_Simple_Function(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_Simple_Function_SubTestCase(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t subTestCase)
+{
+ TEEC_Result res = TEEC_SUCCESS;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = subTestCase;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_Simple_Function_Object(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t objectType, uint32_t objectSize)
+{
+ TEEC_Result res = TEEC_SUCCESS;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = objectType;
+ op.params[0].value.b = objectSize;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_SeekWriteReadObjectData(
+ ADBG_Case_t *c, uint32_t cmdId, TEEC_Session *sess, TEE_Whence seekMode,
+ uint32_t offset, uint32_t initOffset)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint8_t *buf0 = NULL, *tmp = NULL;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ sizeof(BUFFER01), BUFFER01)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = seekMode;
+ op.params[0].value.b = offset;
+ op.params[1].value.a = initOffset;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ if (op.params[3].memref.size != op.params[2].memref.size) {
+ if (op.params[3].memref.size < op.params[2].memref.size) {
+ res = TEE_ERROR_SHORT_BUFFER;
+ goto exit;
+ }
+
+ tmp = (uint8_t *)op.params[3].memref.parent->buffer +
+ op.params[3].memref.size - sizeof(BUFFER01);
+ buf0 =
+ (uint8_t *)malloc(op.params[3].memref.size -
+ sizeof(BUFFER01));
+ memset(buf0, 0, op.params[3].memref.size - sizeof(BUFFER01));
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp, BUFFER01,
+ sizeof(BUFFER01)));
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(buf0,
+ op.params[3].memref.
+ parent->buffer,
+ (op.params[3].memref.
+ size -
+ sizeof(BUFFER01))));
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ free(buf0);
+ return res;
+}
+
+static TEEC_Result Invoke_InitObjectAndAttributes(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t subTestCase, uint32_t objectType, uint32_t objectSize,
+ uint32_t attributeId_1, const void *attribValue_1,
+ uint32_t attribSize_1,
+ uint32_t attributeId_2, const void *attribValue_2,
+ uint32_t attribSize_2,
+ uint32_t attributeId_3, const void *attribValue_3,
+ uint32_t attribSize_3,
+ uint32_t attributeId_4, const void *attribValue_4,
+ uint32_t attribSize_4,
+ uint32_t attributeId_5, const void *attribValue_5,
+ uint32_t attribSize_5)
+{
+ TEEC_Result res = TEEC_SUCCESS;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ void *tmp_buf1 = NULL;
+ uint8_t *tmp_buf2 = NULL;
+ uint32_t tmp_offset = 0;
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT)
+
+ tmp_buf1 = SHARE_MEM01->buffer;
+ tmp_buf2 = (uint8_t *)SHARE_MEM02->buffer;
+ put_uint32_be(&tmp_buf1, attributeId_1);
+
+ if (TEE_ATTR_NONE != attributeId_1) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_1);
+ memcpy(tmp_buf2, attribValue_1, (size_t)attribSize_1);
+ tmp_buf2 += attribSize_1;
+ tmp_offset += attribSize_1;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_2);
+
+ if (TEE_ATTR_NONE != attributeId_2) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_2);
+ memcpy(tmp_buf2, attribValue_2, (size_t)attribSize_2);
+ tmp_buf2 += attribSize_2;
+ tmp_offset += attribSize_2;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_3);
+
+ if (TEE_ATTR_NONE != attributeId_3) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_3);
+ memcpy(tmp_buf2, attribValue_3, (size_t)attribSize_3);
+ tmp_buf2 += attribSize_3;
+ tmp_offset += attribSize_3;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_4);
+
+ if (TEE_ATTR_NONE != attributeId_4) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_4);
+ memcpy(tmp_buf2, attribValue_4, (size_t)attribSize_4);
+ tmp_buf2 += attribSize_4;
+ tmp_offset += attribSize_4;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_5);
+
+ if (TEE_ATTR_NONE != attributeId_5) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_5);
+ memcpy(tmp_buf2, attribValue_5, (size_t)attribSize_5);
+ tmp_buf2 += attribSize_5;
+ tmp_offset += attribSize_5;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ op.params[0].value.a = objectType;
+ op.params[0].value.b = objectSize;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01, 60)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02, tmp_offset)
+ op.params[3].value.a = subTestCase;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_VALUE_INPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+static TEEC_Result Invoke_StartNGetPersistentObjectEnumerator_itemNotFound(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId)
+{
+ TEEC_Result res = TEEC_SUCCESS;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_OUTPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[0].value.a, ==, 0);
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[0].value.b, ==, 0);
+
+ return res;
+}
+
+static TEEC_Result Invoke_GetRSAAttributes(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t attributeType, uint32_t attributeId)
+{
+ TEEC_Result res = TEEC_SUCCESS;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ void *tmp_buf;
+ uint32_t tmp_int1;
+ uint32_t tmp_int2;
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM04, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INOUT)
+
+ tmp_buf = SHARE_MEM04->buffer;
+ put_uint32_be(&tmp_buf, attributeType);
+ put_uint32_be(&tmp_buf, attributeId);
+
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(0, 0, SHARE_MEM04,
+ SHARE_MEM04->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_MEMREF_PARTIAL_INOUT, TEEC_MEMREF_PARTIAL_OUTPUT,
+ TEEC_MEMREF_PARTIAL_OUTPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if ((res != TEEC_SUCCESS) || (VALUE_ATTRIBUTE == attributeType))
+ goto exit;
+
+ tmp_buf = SHARE_MEM04->buffer;
+ tmp_int1 = get_uint32_be(&tmp_buf);
+ tmp_int2 = TEE_ATTR_RSA_PRIME1;
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, tmp_int1, !=, tmp_int2);
+
+ tmp_buf = SHARE_MEM01->buffer;
+ tmp_int1 = get_uint32_be(&tmp_buf);
+ tmp_int2 = TEE_ATTR_RSA_PRIME2;
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, tmp_int1, !=, tmp_int2);
+
+ tmp_buf = SHARE_MEM02->buffer;
+ tmp_int1 = get_uint32_be(&tmp_buf);
+ tmp_int2 = TEE_ATTR_RSA_PRIVATE_EXPONENT;
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, tmp_int1, !=, tmp_int2);
+
+ tmp_buf = SHARE_MEM03->buffer;
+ tmp_int1 = get_uint32_be(&tmp_buf);
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, tmp_int1, !=, attributeId);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ TEEC_ReleaseSharedMemory(SHARE_MEM04);
+ return res;
+}
+
+static TEEC_Result Invoke_GenerateKey(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t subTestCase,
+ uint32_t objectType, uint32_t objectSize, uint32_t keySize,
+ uint32_t attributeId_1, const void *attribValue_1,
+ uint32_t attribSize_1,
+ uint32_t attributeId_2, const void *attribValue_2,
+ uint32_t attribSize_2,
+ uint32_t attributeId_3, const void *attribValue_3,
+ uint32_t attribSize_3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ void *tmp_buf1 = NULL;
+ uint8_t *tmp_buf2 = NULL;
+ int tmp_offset = 0;
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT)
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT)
+
+ tmp_buf1 = SHARE_MEM01->buffer;
+ tmp_buf2 = (uint8_t *)SHARE_MEM02->buffer;
+ put_uint32_be(&tmp_buf1, attributeId_1);
+
+ if (TEE_ATTR_NONE != attributeId_1) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_1);
+ memcpy(tmp_buf2, attribValue_1, (size_t)attribSize_1);
+ tmp_buf2 += attribSize_1;
+ tmp_offset += attribSize_1;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_2);
+
+ if (TEE_ATTR_NONE != attributeId_2) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_2);
+ memcpy(tmp_buf2, attribValue_2, (size_t)attribSize_2);
+ tmp_buf2 += attribSize_2;
+ tmp_offset += attribSize_2;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ put_uint32_be(&tmp_buf1, attributeId_3);
+
+ if (TEE_ATTR_NONE != attributeId_3) {
+ put_uint32_be(&tmp_buf1, tmp_offset);
+ put_uint32_be(&tmp_buf1, attribSize_3);
+ memcpy(tmp_buf2, attribValue_3, (size_t)attribSize_3);
+ tmp_buf2 += attribSize_3;
+ tmp_offset += attribSize_3;
+ } else {
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ put_uint32_be(&tmp_buf1, TEE_ATTR_NONE);
+ }
+
+ op.params[0].value.a = objectType;
+ op.params[0].value.b = objectSize;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01, 36)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02, tmp_offset)
+ op.params[3].value.a = subTestCase;
+ op.params[3].value.b = keySize;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_VALUE_INPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+static TEEC_Result Invoke_ReadObjectData(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t readSize, void *initialBuffer, uint32_t initialBufferSize)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = readSize;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (readSize <= initialBufferSize) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(SHARE_MEM01->buffer,
+ initialBuffer,
+ readSize));
+ } else {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(SHARE_MEM01->buffer,
+ initialBuffer,
+ initialBufferSize));
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_InitValueAttribute(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t attributeID)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = attributeID;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_GetDHAttributes(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t attributeType, uint32_t attributeId)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ sizeof(TEE_ATTR_DH_PRIME_VALUE01),
+ TEE_ATTR_DH_PRIME_VALUE01)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT,
+ sizeof(TEE_ATTR_DH_BASE_VALUE01),
+ TEE_ATTR_DH_BASE_VALUE01)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = attributeType;
+ op.params[0].value.b = attributeId;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ sizeof(TEE_ATTR_DH_PRIME_VALUE01))
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ sizeof(TEE_ATTR_DH_BASE_VALUE01))
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (VALUE_ATTRIBUTE == attributeType) {
+ /* Check if attributeId is coherent
+ with TEE_ATTR_DH_PRIME_VALUE01 and
+ TEE_ATTR_DH_BASE_VALUE01 */
+ } else if ((BUFFER_ATTRIBUTE == attributeType) ||
+ (res == TEEC_SUCCESS)) {
+ /* Check if attributeId (SHARE_MEM03) is coherent
+ with TEE_ATTR_DH_PRIME_VALUE01 and
+ TEE_ATTR_DH_BASE_VALUE01 */
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_EnumeratorOnPersistentObjects(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_OUTPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (res != TEEC_SUCCESS)
+ return res;
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ (op.params[0].value.b -
+ op.params[0].value.a), ==, 3);
+
+ return res;
+}
+
+static TEEC_Result Invoke_TruncateReadObjectData(
+ ADBG_Case_t *c, uint32_t cmdId, TEEC_Session *sess,
+ uint32_t numberOfBytes, uint32_t expectedReturn)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint8_t *buf0 = NULL;
+
+ if (numberOfBytes > INITIAL_DATA_SIZE) {
+ buf0 = (uint8_t *)malloc(numberOfBytes - INITIAL_DATA_SIZE);
+ memset(buf0, 0, numberOfBytes - INITIAL_DATA_SIZE);
+ }
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, DS_BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ op.params[0].value.a = numberOfBytes;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (!ADBG_EXPECT_COMPARE_SIGNED(c, res, ==, expectedReturn))
+ goto exit;
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, SHARE_MEM01->size, !=,
+ numberOfBytes);
+
+ if (numberOfBytes <= INITIAL_DATA_SIZE) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(SHARE_MEM01->buffer,
+ INITIAL_DATA,
+ numberOfBytes));
+ } else {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(SHARE_MEM01->buffer,
+ INITIAL_DATA,
+ INITIAL_DATA_SIZE));
+ uint8_t *tmp_buf = (uint8_t *)SHARE_MEM01->buffer +
+ INITIAL_DATA_SIZE;
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp_buf, buf0,
+ numberOfBytes -
+ INITIAL_DATA_SIZE));
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+
+ free(buf0);
+
+ return res;
+}
+
+#endif /* XML_DATASTORAGE_API_H_ */
diff --git a/host/xtest/xml/include/xml_internal_api.h b/host/xtest/xml/include/xml_internal_api.h
new file mode 100644
index 0000000..af2260c
--- /dev/null
+++ b/host/xtest/xml/include/xml_internal_api.h
@@ -0,0 +1,783 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef XML_INTERNAL_API_H_
+#define XML_INTERNAL_API_H_
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#ifdef USER_SPACE
+#include <pthread.h>
+#include <unistd.h>
+#endif
+
+#include <sys/types.h>
+#include "tee_client_api.h"
+#undef TA_UUID
+#include "TTA_TCF.h"
+
+
+#define Invoke_MaskUnmaskCancellations Invoke_Simple_Function
+#define Invoke_ProcessTAInvoke_Payload_Value Invoke_Simple_Function
+#define Invoke_ProcessTAInvoke_Payload_Value_In_Out Invoke_Simple_Function
+#define Invoke_ProcessTAInvoke_Payload_Memref Invoke_Simple_Function
+
+#define Invoke_GetPropertyAsBool_withoutEnum Invoke_GetPropertyAsXXX_withoutEnum
+#define Invoke_GetPropertyAsU32_withoutEnum Invoke_GetPropertyAsXXX_withoutEnum
+#define Invoke_GetPropertyAsUUID_withoutEnum Invoke_GetPropertyAsXXX_withoutEnum
+#define Invoke_GetPropertyAsIdentity_withoutEnum \
+ Invoke_GetPropertyAsXXX_withoutEnum
+#define Invoke_GetPropertyAsBinaryBlock_withoutEnum \
+ Invoke_GetPropertyAsXXX_withoutEnum
+#define Invoke_GetPropertyAsString_withoutEnum \
+ Invoke_GetPropertyAsXXX_withoutEnum
+
+#define Invoke_GetPropertyAsXXXX_fromEnum Invoke_StartPropertyEnumerator
+
+#define Invoke_FreePropertyEnumerator Invoke_ResetPropertyEnumerator
+#define Invoke_GetNextProperty_enumNotStarted Invoke_ResetPropertyEnumerator
+
+#define Invoke_ProcessTAInvoke_DeadErrorSuccess \
+ Invoke_ProcessInvokeTAOpenSession
+
+#define CLIENT_APP01 NULL
+
+#define TEEC_UNDEFINED_ERROR 0xDEADDEAD
+
+#define TEEC_ORIGIN_ANY_NOT_TRUSTED_APP 0x00000005
+/* same as TEE_ORIGIN_NOT_TRUSTED_APP */
+
+#define SIZE_ZERO 0
+
+#define TEE_ERROR_TOO_SHORT_BUFFER TEE_ERROR_SHORT_BUFFER
+
+#ifdef USER_SPACE
+/* Test data defines */
+static pthread_t THREAD01_DEFAULT;
+static pthread_t THREAD02;
+#endif
+
+static TEEC_SharedMemory *SHARE_MEM01;
+static TEEC_SharedMemory *SHARE_MEM02;
+static TEEC_Session *SESSION01;
+static TEEC_Session *SESSION02;
+/* Requires 2 sessions as we are opeing
+ multiple sessions at the same time */
+static TEEC_Context *CONTEXT01;
+static TEEC_Context *CONTEXT02;
+static TEEC_Operation *OPERATION01;
+
+/* Return ORIGIN */
+static uint32_t ret_orig;
+
+static uint32_t BIG_SIZE = 1024;
+
+char *NO_DATA;
+unsigned int ENUMERATOR1;
+
+#define ANY_OWNER_NOT_SET 0
+#define ANY_OWNER_SET_ACCESS_READ (TEE_MEMORY_ACCESS_ANY_OWNER | \
+ TEE_MEMORY_ACCESS_READ)
+#define ANY_OWNER_SET_ACCESS_WRITE (TEE_MEMORY_ACCESS_ANY_OWNER | \
+ TEE_MEMORY_ACCESS_WRITE)
+#define ANY_OWNER_SET_ACCESS_READ_WRITE (TEE_MEMORY_ACCESS_ANY_OWNER | \
+ TEE_MEMORY_ACCESS_READ | \
+ TEE_MEMORY_ACCESS_WRITE)
+
+#define SMALL_SIZE 0xA
+
+#define CMD_TEE_GetInstanceData 0x00000101
+#define CMD_TEE_SetInstanceData 0x00000102
+#define CMD_TEE_GetPropertyAsU32_withoutEnum 0x00000020
+
+#define NORMAL_SIZE_BUFFER 1
+#define TOO_SHORT_BUFFER 0
+#define CASE_NOT_NULL 1
+#define CASE_NULL 0
+#define CASE_BUFFER1_DIFFERS_FIRST 1
+#define CASE_BUFFER2_DIFFERS_FIRST 2
+#define CASE_EQUAL 0
+#define CASE_ERROR_ICA2 3
+#define CASE_PAYLOAD_VALUE 4
+#define CASE_SUCCESS_ICA2 2
+#define CASE_TARGET_DEAD_ICA2 1
+#define CASE_CANCEL_TIMEOUT 2
+#define CASE_ITEM_NOT_FOUND 3
+#define CASE_SUCCESS 0
+#define CASE_TARGET_BUSY 4
+#define CASE_TARGET_DEAD 1
+#define RESULT_EQUAL 0
+#define RESULT_INTEGER_GREATER_THAN_ZERO 1
+#define RESULT_INTEGER_LOWER_THAN_ZERO 2
+
+#define HINT_ZERO 0
+#define SIZE_OVER_MEMORY 0xFFFFFFFE
+
+#define TEE_ORIGIN_NOT_TRUSTED_APP 5
+/* same as TEEC_ORIGIN_ANY_NOT_TRUSTED_APP */
+#define TEE_PROPSET_IMPLEMENTATION TEE_PROPSET_TEE_IMPLEMENTATION
+
+static char VALUE_PREDEFINED_STRING[] = "this is a test string\0";
+static char VALUE_PREDEFINED_U32[] = "48059\0";
+static char VALUE_PREDEFINED_UUID[] = "534D4152-542D-4353-4C54-2D54412D3031\0";
+static char VALUE_PREDEFINED_IDENTITY[] =
+ "F0000000:534D4152-542D-4353-4C54-2D54412D3031\0";
+
+static char *VALUE_NONE;
+static char VALUE_PREDEFINED_BINARY_BLOCK[] =
+ "VGhpcyBpcyBhIHRleHQgYmluYXJ5IGJsb2Nr\0";
+static char VALUE_PREDEFINED_BOOLEAN[] = "true\0";
+
+static uint8_t CHAR1[] = { 0x10 };
+/* static uint8_t CHAR2[]={0xAA}; */
+
+static char GPD_CLIENT_identity[] = "gpd.client.identity\0";
+static char GPD_TA_appID[] = "gpd.ta.appID\0";
+static char GPD_TA_dataSize[] = "gpd.ta.dataSize\0";
+static char GPD_TA_instanceKeepAlive[] = "gpd.ta.instanceKeepAlive\0";
+static char GPD_TA_multiSession[] = "gpd.ta.multiSession\0";
+static char GPD_TA_singleInstance[] = "gpd.ta.singleInstance\0";
+static char GPD_TA_stackSize[] = "gpd.ta.stackSize\0";
+static char GPD_TEE_ARITH_maxBigIntSize[] = "gpd.tee.arith.maxBigIntSize\0";
+static char GPD_TEE_SYSTEM_TIME_protectionLevel[] =
+ "gpd.tee.systemTime.protectionLevel\0";
+static char GPD_TEE_TA_PERSISTENT_TIME_protectionLevel[] =
+ "gpd.tee.TAPersistentTime.protectionLevel\0";
+static char GPD_TEE_apiversion[] = "gpd.tee.apiversion\0";
+static char GPD_TEE_description[] = "gpd.tee.description\0";
+static char GPD_TEE_deviceID[] = "gpd.tee.deviceID\0";
+static char PROPERTY_NAME_NOT_VALID_ENCODING[] = "gpd.\t\n\r\0";
+static char PROPERTY_NAME_UNKNOWN[] = "unknown\0";
+static char SMC_TA_testuuid[] = "smc.ta.testuuid\0";
+static char SMC_TA_testbinaryblock[] = "smc.ta.testbinaryblock\0";
+static char SMC_TA_testbooltrue[] = "smc.ta.testbooltrue\0";
+static char SMC_TA_testidentity[] = "smc.ta.testidentity\0";
+static char SMC_TA_teststring[] = "smc.ta.teststring\0";
+static char SMC_TA_testu32[] = "smc.ta.testu32\0";
+static char STRING_SAMPLE_SIZE_4_CHAR[] = "TEE\0";
+
+
+/** ALL_TEEC_UUID
+ *
+ * These constants are the UUID of existing
+ * Trusted Applications
+ */
+/* "SMART-CSLT-TA-01" */
+static TEEC_UUID UUID_TTA_testingInternalAPI_TrustedCoreFramework = {
+ 0x534D4152, 0x542D, 0x4353,
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x30, 0x31 }
+};
+/* "SMARTCSLTATCFICA" */
+/* Changed endians from the adaptation layer specification description */
+static TEEC_UUID UUID_TTA_testingInternalAPI_TrustedCoreFramework_ICA = {
+ 0x52414D53, 0x4354, 0x4C53,
+ { 0x54, 0x41, 0x54, 0x43, 0x46, 0x49, 0x43, 0x41 }
+};
+/* "SMARTCSLTTCFICA2" */
+/* Changed endians from the adaptation layer specification description */
+static TEEC_UUID UUID_TTA_testingInternalAPI_TrustedCoreFramework_ICA2 = {
+ 0x52414D53, 0x4354, 0x4C53,
+ { 0x54, 0x54, 0x43, 0x46, 0x49, 0x43, 0x41, 0x32 }
+};
+/* "SMARTCSLMLTINSTC" */
+static TEEC_UUID
+ UUID_TTA_testingInternalAPI_TrustedCoreFramework_MultipleInstanceTA = {
+ 0x534D4152, 0x5443, 0x534C,
+ { 0x4D, 0x4C, 0x54, 0x49, 0x4E, 0x53, 0x54, 0x43 }
+};
+/* "SMARTCSLSGLINSTC" */
+static TEEC_UUID
+ UUID_TTA_testingInternalAPI_TrustedCoreFramework_SingleInstanceTA = {
+ 0x534D4152, 0x5443, 0x534C,
+ { 0x53, 0x47, 0x4C, 0x49, 0x4E, 0x53, 0x54, 0x43 }
+};
+/* "SMART-CUNK-NO-WN" */
+static TEEC_UUID UUID_Unknown = {
+ 0x534D4152, 0x542D, 0x4355,
+ { 0x4E, 0x4B, 0x2D, 0x4E, 0x4F, 0x2D, 0x57, 0x4E }
+};
+
+
+/* Helper functions/macros */
+
+#define IDENTIFIER_NOT_USED(x) { if (sizeof(&x)) {} }
+
+#define ALLOCATE_SHARED_MEMORY(context, sharedMemory, \
+ sharedMemorySize, \
+ memoryType) \
+ res = AllocateSharedMemory(context, sharedMemory, \
+ sharedMemorySize, \
+ memoryType); \
+ if (res != TEEC_SUCCESS) { \
+ goto exit; \
+ } \
+ memset(sharedMemory->buffer, 0, sharedMemorySize);
+
+#define ALLOCATE_AND_FILL_SHARED_MEMORY(context, sharedMemory, \
+ sharedMemorySize, \
+ memoryType, copySize, data) \
+ res = AllocateSharedMemory(context, sharedMemory, sharedMemorySize, \
+ memoryType); \
+ if (res != TEEC_SUCCESS) { \
+ goto exit; \
+ } \
+ if (data != NULL) { \
+ memcpy(sharedMemory->buffer, data, copySize); \
+ }
+
+#define SET_SHARED_MEMORY_OPERATION_PARAMETER(parameterNumber, \
+ sharedMemoryOffset, \
+ sharedMemory, \
+ sharedMemorySize) \
+ op.params[parameterNumber].memref.offset = sharedMemoryOffset; \
+ op.params[parameterNumber].memref.size = sharedMemorySize; \
+ op.params[parameterNumber].memref.parent = sharedMemory;
+
+/* XML_VERIFY macro define.
+ *
+ * Use ADBG_EXPECT or ADBG_EXPECT_NOT depending on the expected return value.
+ *
+ * ADBG_EXPECT() -> IF(EXP == GOT) RETURN TRUE
+ * ADBG_EXPECT() -> IF(EXP != GOT) RETURN TRUE
+ */
+#define XML_VERIFY(c, exp, got) \
+ do { \
+ if (exp == TEEC_UNDEFINED_ERROR) \
+ ADBG_EXPECT_NOT(c, exp, got); \
+ else \
+ ADBG_EXPECT(c, exp, got); \
+ } while (0)
+
+/* Initialize context using TEEC_InitializeContext and
+ check the returned value. */
+#define XML_InitializeContext(c, name, context, expected) \
+ XML_VERIFY(c, expected, TEEC_InitializeContext(name, context))
+
+/*Open session using TEEC_OpenSession and check
+ the returned value and/or returned origin.*/
+#define XML_OpenSession(c, context, session, destination, connectionMethod, \
+ connectionData, operation, returnOrigin, expected) \
+ do { \
+ XML_VERIFY(c, expected, \
+ TEEC_OpenSession(context, session, destination, \
+ connectionMethod, connectionData, \
+ operation, &ret_orig)); \
+ if ((returnOrigin != 0) && \
+ ((int)returnOrigin != TEEC_ORIGIN_ANY_NOT_TRUSTED_APP)) \
+ ADBG_EXPECT(c, (int)returnOrigin, ret_orig); \
+ else \
+ ADBG_EXPECT_NOT(c, (int)returnOrigin, ret_orig); \
+ } while (0)
+
+#define OPERATION_TEEC_PARAM_TYPES(op, p0, p1, p2, p3) \
+ op->paramTypes = TEEC_PARAM_TYPES(p0, p1, p2, p3)
+
+/*dummy functions*/
+#define TEEC_SelectApp(a, b) /* do nothing for now */
+#define TEEC_createThread(a, b) /* do nothing for now */
+
+#ifdef USER_SPACE
+static void *cancellation_thread(void *arg)
+{
+ TEEC_RequestCancellation((TEEC_Operation *)arg);
+ return NULL;
+}
+#endif
+
+#ifdef USER_SPACE
+#define RequestCancellation(op) \
+ (void)ADBG_EXPECT(c, 0, \
+ pthread_create(&THREAD02, NULL, cancellation_thread, \
+ (void *)op)); \
+ (void)ADBG_EXPECT(c, 0, pthread_join(THREAD02, NULL));
+#else
+#define RequestCancellation(op) \
+ IDENTIFIER_NOT_USED(op)
+#endif
+
+/* Allocates TEEC_SharedMemory inside of the TEE */
+static TEEC_Result AllocateSharedMemory(TEEC_Context *ctx,
+ TEEC_SharedMemory *shm, uint32_t size,
+ uint32_t flags)
+{
+ shm->flags = flags;
+ shm->size = size;
+ return TEEC_AllocateSharedMemory(ctx, shm);
+}
+
+static TEEC_Result Invoke_Simple_Function(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_MemFill(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t memoryFillSize, uint8_t *charFill)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = memoryFillSize;
+ op.params[1].value.a = *charFill;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_GetPropertyAsXXX_withoutEnum(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ TEE_PropSetHandle propSet, char *name, uint32_t kindBuffer,
+ char *expectedValue)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t nameLen = 0;
+ uint32_t expectedValueLen = 0;
+
+ nameLen = strlen(name) + 1;
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT, nameLen,
+ name)
+
+ if (kindBuffer == TOO_SHORT_BUFFER) {
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, 1,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ } else {
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ }
+
+ op.params[0].value.a = (uint32_t)propSet;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01, nameLen)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_OUTPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ if (expectedValue != VALUE_NONE) {
+ expectedValueLen = strlen(expectedValue) + 1;
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(op.params[2].memref.
+ parent->buffer,
+ expectedValue,
+ expectedValueLen));
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+static TEEC_Result Invoke_MemCompare(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t memorySize, uint32_t Case, uint32_t compareResult)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t outValue = 0;
+
+ op.params[0].value.a = memorySize;
+ op.params[1].value.a = Case;
+ op.params[2].value.a = outValue;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_VALUE_INPUT, TEEC_VALUE_OUTPUT,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ if (compareResult == RESULT_EQUAL) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[2].value.a, ==,
+ 0);
+ } else if (compareResult == RESULT_INTEGER_GREATER_THAN_ZERO) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ (int32_t)op.params[2].value.a,
+ >, 0);
+ } else if (compareResult == RESULT_INTEGER_LOWER_THAN_ZERO) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ (int32_t)op.params[2].value.a,
+ <, 0);
+ }
+
+exit:
+ return res;
+}
+
+static TEEC_Result Invoke_SetInstanceData(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, char *data)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT, sizeof(data),
+ data)
+
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(0, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_GetInstanceData(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, char *expectedData,
+ uint32_t expectedDataSize)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(0, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_MEMREF_PARTIAL_OUTPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ if (res != TEE_ERROR_GENERIC) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[0].memref.size,
+ ==, expectedDataSize);
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(SHARE_MEM01->buffer,
+ expectedData,
+ expectedDataSize));
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_ProcessInvokeTAOpenSession(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t TACmd, TEEC_UUID *UUID, uint32_t returnOrigin)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_INPUT, 16, UUID)
+
+ op.params[0].value.a = TACmd;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01, 16)
+ op.params[2].value.a = returnOrigin;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT, TEEC_VALUE_OUTPUT,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (TEE_ORIGIN_NOT_TRUSTED_APP == returnOrigin) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[2].value.a, !=,
+ TEE_ORIGIN_TRUSTED_APP);
+ } else {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[2].value.a, ==,
+ returnOrigin);
+ }
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_CheckMemoryAccessRight(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t memoryParamType, uint32_t memoryAccessFlags)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ memoryParamType)
+
+ op.params[0].value.a = memoryAccessFlags;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, memoryParamType, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_MemMove(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, uint32_t memorySize)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = memorySize;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_AllocatePropertyEnumerator(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t *enumerator)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = 0;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_OUTPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ *enumerator = op.params[0].value.a;
+ /* (void)ADBG_EXPECT_COMPARE_SIGNED(
+ c, op.params[0].value.a, == , enumerator); */
+
+exit:
+ return res;
+}
+
+static TEEC_Result Invoke_StartPropertyEnumerator(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, uint32_t enumerator,
+ TEE_PropSetHandle propSet)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = enumerator;
+ op.params[1].value.a = (uint32_t)propSet;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_ResetPropertyEnumerator(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, uint32_t enumerator)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = enumerator;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_GetPropertyName(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t enumerator, char *propertyName, uint32_t kindBuffer)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t strLen = 0;
+
+ if (kindBuffer == TOO_SHORT_BUFFER) {
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, 1,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ } else {
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+ }
+
+ op.params[0].value.a = enumerator;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ strLen = strlen(propertyName) + 1;
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[1].memref.size, ==,
+ strLen);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(SHARE_MEM01->buffer,
+ propertyName, strLen));
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_Malloc(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t memorySize, uint32_t hint)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = memorySize;
+ op.params[1].value.a = hint;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_Panic(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ if (res != TEEC_SUCCESS)
+ goto exit;
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, org, ==, TEE_ORIGIN_TEE);
+
+exit:
+ return res;
+}
+
+static TEEC_Result Invoke_Realloc(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t oldMemorySize, uint32_t newMemorySize)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = oldMemorySize;
+ op.params[1].value.a = newMemorySize;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_Free(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, uint32_t Case)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = Case;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_GetCancellationFlag_RequestedCancel(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ TEEC_Operation *operation)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+#endif /* XML_INTERNAL_API_H_ */
diff --git a/host/xtest/xml/include/xml_timearithm_api.h b/host/xtest/xml/include/xml_timearithm_api.h
new file mode 100644
index 0000000..cae9d33
--- /dev/null
+++ b/host/xtest/xml/include/xml_timearithm_api.h
@@ -0,0 +1,1858 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef XML_TIMEARITHM_API_H_
+#define XML_TIMEARITHM_API_H_
+
+#include <openssl/bn.h>
+
+#define Invoke_GetSystemTime Invoke_Simple_Function
+#define Invoke_GetREETime Invoke_Simple_Function
+#define Invoke_SetTAPersistentTime_and_GetTAPersistentTime_Overflow \
+ Invoke_Simple_Function
+#define Invoke_SetTAPersistentTime_and_GetTAPersistentTime \
+ Invoke_Simple_Function
+#define Invoke_BigIntConvertToOctetStringOverflow Invoke_Simple_Function
+#define Invoke_BigIntConvertFromOctetStringOverflow Invoke_Simple_Function
+#define Invoke_GetTAPersistentTime_NotSet_and_SetTAPersistentTime \
+ Invoke_Simple_Function
+#define Test_Tool_Erase_Persistent_Time Invoke_Simple_Function
+
+#define Invoke_BigIntMod Invoke_BigIntDiv_Remain
+
+#define Invoke_BigIntSquareMod Invoke_BigIntMulMod
+
+static TEEC_SharedMemory *SHARE_MEM01;
+static TEEC_SharedMemory *SHARE_MEM02;
+static TEEC_SharedMemory *SHARE_MEM03;
+static TEEC_Session *SESSION01;
+static TEEC_Context *CONTEXT01;
+static TEEC_Context *CONTEXT02;
+static TEEC_Operation *OPERATION01;
+
+#define CMD_TEE_SetTAPersistentTime_and_GetTAPersistentTime_Overflow \
+ CMD_TEE_SetTAPersistentTime_and_GetTAPersistentTimeOverflow
+
+#define CLIENT_APP01 NULL
+
+#define TEEC_UNDEFINED_ERROR 0xDEADDEAD
+
+#define TEEC_ORIGIN_ANY_NOT_TRUSTED_APP 0x00000005
+/* same as TEE_ORIGIN_NOT_TRUSTED_APP */
+
+/* Return ORIGIN */
+static uint32_t ret_orig;
+
+#ifdef USER_SPACE
+/*Test data defines*/
+static pthread_t THREAD01_DEFAULT;
+static pthread_t THREAD02;
+#endif
+
+#define BIT0_MASK 1
+#define BIT1_MASK 2
+#define BIT2_MASK 4
+
+#define NEGATIVE 0
+#define POSITIVE 1
+
+#define RESULT_NOT_A_PRIME 0
+#define RESULT_PRIME 1
+
+#define RESULT_EQUAL 0
+#define RESULT_INTEGER_GREATER_THAN_ZERO 1
+#define RESULT_INTEGER_LOWER_THAN_ZERO 2
+
+#define CASE_WAIT_CANCELLED 1
+#define CASE_WAIT_SUCCESS 2
+
+static uint32_t CONFIDENCE_LEVEL_80 = 80;
+
+static uint8_t BIG_VALUE1_SIZE_64_BITS[] = {
+ 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+};
+
+
+static uint8_t BIG_VALUE2_SIZE_64_BITS[] = {
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+static uint8_t BIG_VALUE3_SIZE_32_BITS[] = {
+ 0x0F, 0xFF, 0xFF, 0xFF,
+};
+
+static uint8_t BIG_VALUE4_SIZE_32_BITS[] = {
+ 0x01, 0x00, 0x00, 0x00,
+};
+
+static uint8_t BIG_VALUE5_SIZE_2048_BITS[] = {
+ 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0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 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+};
+
+static uint8_t BIG_VALUE6_SIZE_2048_BITS[] = {
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
+
+static uint8_t BIG_VALUE7_SIZE_1024_BITS[] = {
+ 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+};
+
+static uint8_t BIG_VALUE10_SIZE_32_BITS_PRIME_WITH_VALUE3[] = {
+ 0x0E, 0xFF, 0xFF, 0xFF,
+};
+
+static uint8_t BIG_VALUE13_SIZE_32_BITS_PRIME[] = {
+ 0x00, 0x00, 0x0D, 0x69,
+};
+
+static uint8_t BIG_VALUE14_SIZE_32_BITS_NOT_PRIME[] = {
+ 0x00, 0x00, 0x0D, 0x68,
+};
+
+static uint8_t BIG_VALUE15_SIZE_32_BITS[] = {
+ 0x00, 0x00, 0x00, 0x03,
+};
+
+static uint8_t BIG_VALUE16_SIZE_64_BITS[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+};
+
+static uint8_t BIG_VALUE17_SIZE_1024_BITS[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x03,
+};
+
+static uint8_t BIG_VALUE18_SIZE_2048_BITS[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x03,
+};
+
+static uint8_t BIG_VALUE19_SIZE_32_BITS_PRIME_WITH_VALUE_3[] = {
+ 0x00, 0x00, 0x00, 0x04,
+};
+
+static uint8_t BIG_VALUE20_SIZE_2048_BITS_PRIME_WITH_VALUE5[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x04,
+};
+
+static uint8_t BIG_VALUE_ONE_SIZE_64_BITS[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+};
+
+static uint8_t BIG_VALUE_ZERO_SIZE_32_BITS[] = {
+ 0x00, 0x00, 0x00, 0x00,
+};
+
+static uint8_t BIG_VALUE_ZERO_SIZE_64_BITS[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+static uint8_t BIG_VALUE_ZERO_SIZE_2048_BITS[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
+
+static uint8_t VALUE1_32_BITS[] = {
+ 0x01, 0x23, 0x45, 0x67,
+};
+
+
+/** ALL_TEEC_UUID
+ *
+ * These constants are the UUID of existing
+ * Trusted Applications
+ */
+/* "SMARTCLSARITHMET" */
+static TEEC_UUID UUID_TTA_testingInternalAPI_Arithmetique = {
+ 0x534D4152, 0x5443, 0x4C53,
+ { 0x41, 0x52, 0x49, 0x54, 0x48, 0x4D, 0x45, 0x54 }
+};
+/* "SMARTCSL_TIMEAPI" */
+static TEEC_UUID UUID_TTA_testingInternalAPI_Time = {
+ 0x534D4152, 0x5443, 0x534C,
+ { 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x41, 0x50, 0x49 }
+};
+
+/*Helper functions/macros*/
+#define IDENTIFIER_NOT_USED(x) { if (sizeof(&x)) {} }
+
+#define ALLOCATE_SHARED_MEMORY(context, sharedMemory, sharedMemorySize, \
+ memoryType) \
+ res = AllocateSharedMemory(context, sharedMemory, sharedMemorySize, \
+ memoryType); \
+ if (res != TEEC_SUCCESS) { \
+ goto exit; \
+ } \
+ memset(sharedMemory->buffer, 0, sharedMemorySize);
+
+#define ALLOCATE_AND_FILL_SHARED_MEMORY(context, sharedMemory, \
+ sharedMemorySize, \
+ memoryType, data) \
+ res = AllocateSharedMemory(context, sharedMemory, sharedMemorySize, \
+ memoryType); \
+ if (res != TEEC_SUCCESS) { \
+ goto exit; \
+ } \
+ if (data != NULL) { \
+ memcpy(sharedMemory->buffer, data, sharedMemorySize); \
+ }
+
+#define SET_SHARED_MEMORY_OPERATION_PARAMETER(parameterNumber, \
+ sharedMemoryOffset, \
+ sharedMemory, \
+ sharedMemorySize) \
+ op.params[parameterNumber].memref.offset = sharedMemoryOffset; \
+ op.params[parameterNumber].memref.size = sharedMemorySize; \
+ op.params[parameterNumber].memref.parent = sharedMemory;
+
+#define BN_DECLARE_AND_INIT() \
+ BN_CTX *ctx = NULL; \
+ BIGNUM *a = NULL, *b = NULL, *s = NULL, *d = NULL, \
+ *m = NULL, *l = NULL, \
+ *r = NULL; \
+ ctx = BN_CTX_new(); \
+ if (ctx == NULL) { \
+ goto exit; \
+ } \
+ a = BN_new(); \
+ b = BN_new(); \
+ s = BN_new(); \
+ d = BN_new(); \
+ m = BN_new(); \
+ l = BN_new(); \
+ r = BN_new();
+
+#define BN_FREE() \
+ BN_free(a); \
+ BN_free(b); \
+ BN_free(s); \
+ BN_free(d); \
+ BN_free(m); \
+ BN_free(l); \
+ BN_free(r); \
+ if (ctx) { \
+ BN_CTX_free(ctx); \
+ }
+
+/* XML_VERIFY macro define.
+ *
+ * Use ADBG_EXPECT or ADBG_EXPECT_NOT depending on the expected return value.
+ *
+ * ADBG_EXPECT() -> IF(EXP == GOT) RETURN TRUE
+ * ADBG_EXPECT() -> IF(EXP != GOT) RETURN TRUE
+ */
+#define XML_VERIFY(c, exp, got) \
+ do { \
+ if (exp == TEEC_UNDEFINED_ERROR) \
+ ADBG_EXPECT_NOT(c, exp, got); \
+ else \
+ ADBG_EXPECT(c, exp, got); \
+ } while (0)
+
+/* Initialize context using TEEC_InitializeContext and
+ check the returned value. */
+#define XML_InitializeContext(c, name, context, expected) \
+ XML_VERIFY(c, expected, TEEC_InitializeContext(name, context))
+
+/* Open session using TEEC_OpenSession and
+ check the returned value and/or returned origin. */
+#define XML_OpenSession(c, context, session, destination, connectionMethod, \
+ connectionData, operation, returnOrigin, expected) \
+ do { \
+ XML_VERIFY(c, expected, \
+ TEEC_OpenSession(context, session, destination, \
+ connectionMethod, connectionData, \
+ operation, &ret_orig)); \
+ if ((returnOrigin != 0) && \
+ ((int)returnOrigin != TEEC_ORIGIN_ANY_NOT_TRUSTED_APP)) \
+ ADBG_EXPECT(c, (int)returnOrigin, ret_orig); \
+ else \
+ ADBG_EXPECT_NOT(c, (int)returnOrigin, ret_orig); \
+ } while (0)
+
+#define OPERATION_TEEC_PARAM_TYPES(op, p0, p1, p2, p3) \
+ do { \
+ op->paramTypes = TEEC_PARAM_TYPES(p0, p1, p2, p3); \
+ } while (0)
+
+
+/*dummy functions*/
+#define TEEC_SelectApp(a, b) /*do nothing for now*/
+#define TEEC_createThread(a, b) /*do nothing for now*/
+
+#ifdef USER_SPACE
+static void *cancellation_thread(void *arg)
+{
+ TEEC_RequestCancellation((TEEC_Operation *)arg);
+ return NULL;
+}
+#endif
+
+#ifdef USER_SPACE
+#define RequestCancellation(op) \
+ (void)ADBG_EXPECT(c, 0, \
+ pthread_create(&THREAD02, NULL, cancellation_thread, \
+ (void *)op)); \
+ (void)ADBG_EXPECT(c, 0, pthread_join(THREAD02, NULL));
+#else
+#define RequestCancellation(op) \
+ IDENTIFIER_NOT_USED(op)
+#endif
+
+/*Allocates TEEC_SharedMemory inside of the TEE*/
+static TEEC_Result AllocateSharedMemory(TEEC_Context *ctx,
+ TEEC_SharedMemory *shm, uint32_t size,
+ uint32_t flags)
+{
+ shm->flags = flags;
+ shm->size = size;
+ return TEEC_AllocateSharedMemory(ctx, shm);
+}
+
+static TEEC_Result Invoke_Simple_Function(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntCmpS32(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t expectedComparisonResult)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ op.params[3].value.a = expectedComparisonResult;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_VALUE_INPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntShiftRight(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint32_t bits)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0, sign_cmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM02, ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+
+ op.params[0].value.a = tmp;
+ op.params[0].value.b = (uint32_t)bits;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_OUTPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM02->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM02->size);
+
+ if (!BN_bin2bn(SHARE_MEM01->buffer, SHARE_MEM01->size, a))
+ goto exit;
+
+ if (!BN_rshift(b, a, (int)bits))
+ goto exit;
+
+ BN_bn2bin(b, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM02->buffer,
+ SHARE_MEM02->size));
+
+ tmp = op.params[0].value.b;
+ if (tmp & BIT0_MASK)
+ sign_cmp = POSITIVE;
+ else
+ sign_cmp = NEGATIVE;
+
+ /* This is not implemented according to the Adaptation layer
+ * specification document.
+ * In case when the number of bits to be shifted right is equal
+ * or bigger then the actual size of the buffer,
+ * the returned buffer (big number) will be zero and the returned
+ * sign will be positive, so the returned
+ * sign check should be performed against the POSITIVE sign
+ * instead of the original (input) number sign.
+ */
+ if (size_N1 > bits) {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, sign_cmp, ==, sign1);
+ } else {
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, sign_cmp, ==,
+ (uint32_t)POSITIVE);
+ }
+
+exit:
+ BN_FREE()
+ free(tmp1);
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntDiv_Remain(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_div(d, m, a, b, ctx))
+ goto exit;
+
+ BN_bn2bin(m, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntDiv_Quotient(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_div(d, m, a, b, ctx))
+ goto exit;
+
+ BN_bn2bin(d, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntAdd(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_add(d, a, b))
+ goto exit;
+
+ BN_bn2bin(d, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntIsProbablePrime(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t confidenceLevel, uint32_t expectedProbabilityResult)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+
+ op.params[0].value.a = tmp;
+ op.params[0].value.b = confidenceLevel;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ op.params[3].value.a = expectedProbabilityResult;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_VALUE_INPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntConvert_and_ComputeFMM(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3, uint32_t sign3, uint8_t *value3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM03,
+ ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value3)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+ if (sign3)
+ tmp = tmp | BIT2_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_INPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntAddMod(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+ if (res != TEE_SUCCESS)
+ goto exit;
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_add(s, a, a))
+ goto exit;
+
+ if (!BN_div(d, m, s, b, ctx))
+ goto exit;
+
+ BN_bn2bin(m, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntSubMod(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+ if (res != TEE_SUCCESS)
+ goto exit;
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_sub(s, a, a))
+ goto exit;
+
+ if (!BN_div(d, m, s, b, ctx))
+ goto exit;
+
+ BN_bn2bin(m, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntGetBit(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t BitIndex, bool expectedBooleanResult)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+
+ op.params[0].value.a = tmp;
+ op.params[0].value.b = BitIndex;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_VALUE_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[3].value.a, ==,
+ expectedBooleanResult);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntMulMod(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+ if (res != TEE_SUCCESS)
+ goto exit;
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_sqr(s, a, ctx))
+ goto exit;
+
+ if (!BN_div(d, m, s, b, ctx))
+ goto exit;
+
+ BN_bn2bin(m, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_Wait(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, uint32_t Case)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = Case;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntComputeExtendedGcd(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntGetBitCount(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t ExpectedBitCount)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_VALUE_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c, op.params[3].value.a, ==,
+ ExpectedBitCount);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntSub(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_sub(s, a, b))
+ goto exit;
+
+ BN_bn2bin(s, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntNeg(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL, *tmp2 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ tmp2 = (uint8_t *)malloc(SHARE_MEM01->size);
+ if (tmp2 == NULL)
+ goto exit;
+ memset(tmp2, 0, SHARE_MEM01->size);
+
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+ if (!BN_bin2bn(tmp2, SHARE_MEM01->size, b))
+ goto exit;
+
+ if (!BN_sub(s, b, a))
+ goto exit;
+
+ BN_bn2bin(s, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntCmp(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t ExpectedComparisonResult)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ op.params[3].value.a = ExpectedComparisonResult;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_VALUE_INPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntInit(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, uint32_t size_N)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = size_N;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntConvertFromS32AndToS32(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t sign, uint8_t *shortVal)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ if (sign)
+ tmp = tmp | BIT0_MASK;
+
+ op.params[0].value.a = (uint32_t)(*shortVal);
+ op.params[0].value.b = tmp;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntMul(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_mul(s, a, b, ctx))
+ goto exit;
+
+ BN_bn2bin(s, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntInvMod(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL, *tmp2 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+ if (res != TEE_SUCCESS)
+ goto exit;
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ tmp2 = (uint8_t *)malloc(SHARE_MEM01->size);
+ if (tmp2 == NULL)
+ goto exit;
+
+ memset(tmp2, 0, SHARE_MEM01->size);
+ tmp2[0] = 1;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM02->buffer), SHARE_MEM02->size,
+ b))
+ goto exit;
+
+ if (!BN_bin2bn(tmp2, SHARE_MEM01->size, l))
+ goto exit;
+
+ if (!BN_div(d, m, l, a, ctx))
+ goto exit;
+
+ if (!BN_div(s, m, d, b, ctx))
+ goto exit;
+
+ BN_bn2bin(m, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ if (tmp2)
+ free(tmp2);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntSquare(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N3)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+ uint8_t *tmp1 = NULL;
+
+ BN_DECLARE_AND_INIT()
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_SHARED_MEMORY(CONTEXT01, SHARE_MEM03, ((size_N3 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_OUTPUT)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(3, 0, SHARE_MEM03,
+ SHARE_MEM03->size)
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INOUT, TEEC_MEMREF_PARTIAL_INPUT, TEEC_NONE,
+ TEEC_MEMREF_PARTIAL_OUTPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ tmp1 = (uint8_t *)malloc(SHARE_MEM03->size);
+ if (tmp1 == NULL)
+ goto exit;
+
+ memset(tmp1, 0, SHARE_MEM03->size);
+
+ if (!BN_bin2bn((uint8_t *)(SHARE_MEM01->buffer), SHARE_MEM01->size,
+ a))
+ goto exit;
+
+ if (!BN_sqr(s, a, ctx))
+ goto exit;
+
+ BN_bn2bin(s, tmp1);
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, ==,
+ memcmp(tmp1, SHARE_MEM03->buffer,
+ SHARE_MEM03->size));
+
+exit:
+ if (tmp1)
+ free(tmp1);
+
+ BN_FREE()
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM03);
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntConvertToS32Overflow(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId, uint32_t size_N)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+
+ op.params[0].value.a = size_N;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+ return res;
+}
+
+static TEEC_Result Invoke_BigIntRelativePrime(
+ ADBG_Case_t *c, TEEC_Session *sess, uint32_t cmdId,
+ uint32_t size_N1, uint32_t sign1, uint8_t *value1,
+ uint32_t size_N2, uint32_t sign2, uint8_t *value2,
+ bool expectedBooleanResult)
+{
+ TEEC_Result res = TEE_ERROR_NOT_SUPPORTED;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t org;
+ uint32_t tmp = 0;
+
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM01,
+ ((size_N1 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value1)
+ ALLOCATE_AND_FILL_SHARED_MEMORY(CONTEXT01, SHARE_MEM02,
+ ((size_N2 + 7) / 8),
+ TEEC_MEMREF_PARTIAL_INPUT, value2)
+
+ if (sign1)
+ tmp = tmp | BIT0_MASK;
+ if (sign2)
+ tmp = tmp | BIT1_MASK;
+
+ op.params[0].value.a = tmp;
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(1, 0, SHARE_MEM01,
+ SHARE_MEM01->size)
+ SET_SHARED_MEMORY_OPERATION_PARAMETER(2, 0, SHARE_MEM02,
+ SHARE_MEM02->size)
+ op.params[3].value.a = (uint32_t)expectedBooleanResult;
+
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_MEMREF_PARTIAL_INPUT,
+ TEEC_MEMREF_PARTIAL_INPUT, TEEC_VALUE_INPUT);
+
+ res = TEEC_InvokeCommand(sess, cmdId, &op, &org);
+
+exit:
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_ReleaseSharedMemory(SHARE_MEM02);
+ return res;
+}
+
+#endif /* XML_TIMEARITHM_API_H_ */
diff --git a/host/xtest/xtest_1000.c b/host/xtest/xtest_1000.c
new file mode 100644
index 0000000..575188d
--- /dev/null
+++ b/host/xtest/xtest_1000.c
@@ -0,0 +1,839 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#ifdef USER_SPACE
+#include <pthread.h>
+#include <unistd.h>
+#endif
+
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+
+#include <ta_crypt.h>
+#include <ta_os_test.h>
+#include <ta_create_fail_test.h>
+#include <ta_rpc_test.h>
+#include <ta_sims_test.h>
+
+static void xtest_tee_test_1001(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1004(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1005(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1006(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1007(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1008(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1009(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1010(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1011(ADBG_Case_t *Case_p);
+static void xtest_tee_test_1012(ADBG_Case_t *Case_p);
+
+ADBG_CASE_DEFINE(XTEST_TEE_1001, xtest_tee_test_1001,
+ /* Title */
+ "Registering TAs",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1004, xtest_tee_test_1004,
+ /* Title */
+ "Test User Crypt TA",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1005, xtest_tee_test_1005,
+ /* Title */
+ "Many sessions",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1006, xtest_tee_test_1006,
+ /* Title */
+ "Test Basic OS features",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1007, xtest_tee_test_1007,
+ /* Title */
+ "Test Panic",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1008, xtest_tee_test_1008,
+ /* Title */
+ "TEE internal client API",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1009, xtest_tee_test_1009,
+ /* Title */
+ "TEE Wait",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1010, xtest_tee_test_1010,
+ /* Title */
+ "Invalid memory access",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1011, xtest_tee_test_1011,
+ /* Title */
+ "Test RPC features with User Crypt TA",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_1012, xtest_tee_test_1012,
+ /* Title */
+ "Test Single Instance Multi Session features with SIMS TA",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+struct xtest_crypto_session {
+ ADBG_Case_t *c;
+ TEEC_Session *session;
+ uint32_t cmd_id_sha256;
+ uint32_t cmd_id_aes256ecb_encrypt;
+ uint32_t cmd_id_aes256ecb_decrypt;
+};
+
+static void xtest_crypto_test(struct xtest_crypto_session *cs)
+{
+ uint32_t ret_orig;
+ uint8_t crypt_out[16];
+ uint8_t crypt_in[16] = { 22, 17 };
+
+ crypt_in[15] = 60;
+
+ Do_ADBG_BeginSubCase(cs->c, "AES encrypt");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+
+ op.params[0].tmpref.buffer = crypt_in;
+ op.params[0].tmpref.size = sizeof(crypt_in);
+ op.params[1].tmpref.buffer = crypt_out;
+ op.params[1].tmpref.size = sizeof(crypt_out);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ TEEC_InvokeCommand(cs->session,
+ cs->
+ cmd_id_aes256ecb_encrypt,
+ &op,
+ &ret_orig));
+ }
+ Do_ADBG_EndSubCase(cs->c, "AES encrypt");
+
+ Do_ADBG_BeginSubCase(cs->c, "AES decrypt");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint8_t out[16];
+
+ op.params[0].tmpref.buffer = crypt_out;
+ op.params[0].tmpref.size = sizeof(crypt_out);
+ op.params[1].tmpref.buffer = out;
+ op.params[1].tmpref.size = sizeof(out);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ TEEC_InvokeCommand(cs->session,
+ cs->
+ cmd_id_aes256ecb_decrypt,
+ &op,
+ &ret_orig));
+
+ if (!ADBG_EXPECT(cs->c, 0,
+ memcmp(crypt_in, out, sizeof(crypt_in)))) {
+ Do_ADBG_Log("crypt_in:");
+ Do_ADBG_HexLog(crypt_in, sizeof(crypt_in), 16);
+ Do_ADBG_Log("out:");
+ Do_ADBG_HexLog(out, sizeof(out), 16);
+ }
+ }
+ Do_ADBG_EndSubCase(cs->c, "AES decrypt");
+
+ Do_ADBG_BeginSubCase(cs->c, "SHA-256 test, 3 bytes input");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ static const uint8_t sha256_in[] = { 'a', 'b', 'c' };
+ static const uint8_t sha256_out[] = {
+ 0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
+ 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
+ 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
+ 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad
+ };
+ uint8_t out[32] = { 0 };
+
+ op.params[0].tmpref.buffer = (void *)sha256_in;
+ op.params[0].tmpref.size = sizeof(sha256_in);
+ op.params[1].tmpref.buffer = out;
+ op.params[1].tmpref.size = sizeof(out);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ TEEC_InvokeCommand(cs->session,
+ cs->
+ cmd_id_sha256,
+ &op,
+ &ret_orig));
+
+ if (!ADBG_EXPECT(cs->c, 0, memcmp(sha256_out, out,
+ sizeof(sha256_out)))) {
+ Do_ADBG_Log("sha256_out:");
+ Do_ADBG_HexLog(sha256_out, sizeof(sha256_out), 16);
+ Do_ADBG_Log("out:");
+ Do_ADBG_HexLog(out, sizeof(out), 16);
+ }
+ }
+ Do_ADBG_EndSubCase(cs->c, "SHA-256 test, 3 bytes input");
+
+ Do_ADBG_BeginSubCase(cs->c,
+ "AES-256 ECB encrypt test, 32 bytes input, with fixed key");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ static const uint8_t in[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
+ };
+ static const uint8_t exp_out[] = {
+ 0x5A, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
+ 0xF0, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
+ 0xE9, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
+ 0xF0, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x8E
+ };
+ uint8_t out[sizeof(exp_out)];
+
+ op.params[0].tmpref.buffer = (void *)in;
+ op.params[0].tmpref.size = sizeof(in);
+ op.params[1].tmpref.buffer = out;
+ op.params[1].tmpref.size = sizeof(out);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ TEEC_InvokeCommand(cs->session,
+ cs->
+ cmd_id_aes256ecb_encrypt,
+ &op,
+ &ret_orig));
+
+ if (!ADBG_EXPECT(cs->c, 0,
+ memcmp(exp_out, out, sizeof(exp_out)))) {
+ Do_ADBG_Log("exp_out:");
+ Do_ADBG_HexLog(exp_out, sizeof(exp_out), 16);
+ Do_ADBG_Log("out:");
+ Do_ADBG_HexLog(out, sizeof(out), 16);
+ }
+ }
+ Do_ADBG_EndSubCase(cs->c,
+ "AES-256 ECB encrypt test, 32 bytes input, with fixed key");
+
+ Do_ADBG_BeginSubCase(cs->c,
+ "AES-256 ECB decrypt test, 32 bytes input, with fixed key");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ static const uint8_t in[] = {
+ 0x5A, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
+ 0xF0, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
+ 0xE9, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
+ 0xF0, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x8E
+ };
+ static const uint8_t exp_out[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
+ };
+ uint8_t out[sizeof(exp_out)];
+
+ op.params[0].tmpref.buffer = (void *)in;
+ op.params[0].tmpref.size = sizeof(in);
+ op.params[1].tmpref.buffer = out;
+ op.params[1].tmpref.size = sizeof(out);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ TEEC_InvokeCommand(cs->session,
+ cs->
+ cmd_id_aes256ecb_decrypt,
+ &op,
+ &ret_orig));
+
+ if (!ADBG_EXPECT(cs->c, 0,
+ memcmp(exp_out, out, sizeof(exp_out)))) {
+ Do_ADBG_Log("exp_out:");
+ Do_ADBG_HexLog(exp_out, sizeof(exp_out), 16);
+ Do_ADBG_Log("out:");
+ Do_ADBG_HexLog(out, sizeof(out), 16);
+ }
+ }
+ Do_ADBG_EndSubCase(cs->c,
+ "AES-256 ECB decrypt test, 32 bytes input, with fixed key");
+}
+
+static void xtest_tee_test_1001(ADBG_Case_t *c)
+{
+#ifdef USER_SPACE
+ (void)c;
+#else
+#define REG_TA(name) \
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c, \
+ TEEC_RegisterTA(name, name ## _size))
+
+ REG_TA(crypt_user_ta);
+ REG_TA(os_test_ta);
+ REG_TA(create_fail_test_ta);
+ REG_TA(rpc_test_ta);
+ REG_TA(sims_test_ta);
+
+ TEEC_UnregisterTA(crypt_user_ta);
+ TEEC_UnregisterTA(os_test_ta);
+ TEEC_UnregisterTA(create_fail_test_ta);
+ TEEC_UnregisterTA(rpc_test_ta);
+ TEEC_UnregisterTA(sims_test_ta);
+
+ REG_TA(crypt_user_ta);
+ REG_TA(os_test_ta);
+ REG_TA(create_fail_test_ta);
+ REG_TA(rpc_test_ta);
+ REG_TA(sims_test_ta);
+ REG_TA(storage_ta);
+
+ REG_TA(gp_tta_testing_client_api_ta);
+ REG_TA(gp_tta_answer_success_to_open_session_invoke_ta);
+ REG_TA(gp_tta_answer_error_to_invoke_ta);
+ REG_TA(gp_tta_answer_error_to_open_session_ta);
+ REG_TA(gp_tta_check_open_session_with_4_parameters_ta);
+ REG_TA(gp_tta_time_ta);
+ REG_TA(gp_tta_ds_ta);
+ REG_TA(gp_tta_tcf_ta);
+ REG_TA(gp_tta_crypto_ta);
+ REG_TA(gp_tta_arithm_ta);
+ REG_TA(gp_tta_ica_ta);
+ REG_TA(gp_tta_ica2_ta);
+ REG_TA(gp_tta_tcf_singleinstance_ta);
+ REG_TA(gp_tta_tcf_multipleinstance_ta);
+#endif /*!USER_SPACE*/
+}
+
+static void xtest_tee_test_1004(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+ struct xtest_crypto_session cs = { c, &session, TA_CRYPT_CMD_SHA256,
+ TA_CRYPT_CMD_AES256ECB_ENC,
+ TA_CRYPT_CMD_AES256ECB_DEC };
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, xtest_teec_open_session(
+ &session, &crypt_user_ta_uuid,
+ NULL, &ret_orig)))
+ return;
+
+ /* Run the "complete crypto test suite" */
+ xtest_crypto_test(&cs);
+
+ TEEC_CloseSession(&session);
+}
+
+#ifndef TEEC_ERROR_TARGET_DEAD
+/* To be removed when we have TEEC_ERROR_TARGET_DEAD from tee_client_api.h */
+#define TEEC_ERROR_TARGET_DEAD 0xFFFF3024
+#endif
+
+static void xtest_tee_test_invalid_mem_access(ADBG_Case_t *c, uint32_t n)
+{
+ TEEC_Session session = { 0 };
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &os_test_ta_uuid, NULL,
+ &ret_orig));
+
+ op.params[0].value.a = n;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
+ TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_RESULT(c,
+ TEEC_ERROR_TARGET_DEAD,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_BAD_MEM_ACCESS, &op,
+ &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_RESULT(c, TEEC_ERROR_TARGET_DEAD,
+ TEEC_InvokeCommand(&session,
+ TA_OS_TEST_CMD_BAD_MEM_ACCESS,
+ &op,
+ &ret_orig));
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TEE, ret_orig);
+
+ TEEC_CloseSession(&session);
+}
+
+static void xtest_tee_test_1005(ADBG_Case_t *c)
+{
+ uint32_t ret_orig;
+#define MAX_SESSIONS 3
+ TEEC_Session sessions[MAX_SESSIONS];
+ int i;
+
+ for (i = 0; i < MAX_SESSIONS; i++) {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sessions[i], &os_test_ta_uuid,
+ NULL, &ret_orig)))
+ break;
+ }
+
+ for (; --i >= 0; )
+ TEEC_CloseSession(&sessions[i]);
+}
+
+static void xtest_tee_test_1006(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint8_t buf[32];
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &os_test_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ op.params[0].tmpref.buffer = buf;
+ op.params[0].tmpref.size = sizeof(buf);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_BASIC, &op,
+ &ret_orig));
+
+ TEEC_CloseSession(&session);
+}
+
+static void xtest_tee_test_1007(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &os_test_ta_uuid, NULL,
+ &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_RESULT(c,
+ TEEC_ERROR_TARGET_DEAD,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_PANIC, NULL,
+ &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TEE, ret_orig);
+
+ (void)ADBG_EXPECT_TEEC_RESULT(c,
+ TEEC_ERROR_TARGET_DEAD,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_INIT, NULL,
+ &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TEE, ret_orig);
+
+ TEEC_CloseSession(&session);
+}
+
+static void xtest_tee_test_1008(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ TEEC_Session session_crypt = { 0 };
+ uint32_t ret_orig;
+
+ Do_ADBG_BeginSubCase(c, "Invoke command");
+ {
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session_crypt,
+ &crypt_user_ta_uuid, NULL,
+ &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &os_test_ta_uuid,
+ NULL, &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_CLIENT,
+ NULL, &ret_orig));
+
+ TEEC_CloseSession(&session);
+ TEEC_CloseSession(&session_crypt);
+ }
+ Do_ADBG_EndSubCase(c, "Invoke command");
+
+ Do_ADBG_BeginSubCase(c, "Invoke command with timeout");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+
+ op.params[0].value.a = 2000;
+ op.paramTypes = TEEC_PARAM_TYPES(
+ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session,
+ &os_test_ta_uuid,
+ NULL,
+ &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session,
+ TA_OS_TEST_CMD_CLIENT_WITH_TIMEOUT,
+ &op, &ret_orig));
+
+ TEEC_CloseSession(&session);
+ }
+ Do_ADBG_EndSubCase(c, "Invoke command with timeout");
+
+ Do_ADBG_BeginSubCase(c, "Create session fail");
+ {
+ (void)ADBG_EXPECT_TEEC_RESULT(c, TEEC_ERROR_GENERIC,
+ xtest_teec_open_session(&session_crypt,
+ &create_fail_test_ta_uuid, NULL,
+ &ret_orig));
+ size_t n;
+
+ /*
+ * Run this several times to see that there's no memory leakage.
+ */
+ for (n = 0; n < 100; n++) {
+ Do_ADBG_Log("n = %zu", n);
+ (void)ADBG_EXPECT_TEEC_RESULT(c, TEEC_ERROR_GENERIC,
+ xtest_teec_open_session(&session_crypt,
+ &create_fail_test_ta_uuid,
+ NULL, &ret_orig));
+ }
+ }
+ Do_ADBG_EndSubCase(c, "Create session fail");
+}
+
+#ifdef USER_SPACE
+static void *cancellation_thread(void *arg)
+{
+ /*
+ * Sleep 0.5 seconds before cancellation to make sure that the other
+ * thread is in RPC_WAIT.
+ */
+ (void)usleep(500000);
+ TEEC_RequestCancellation(arg);
+ return NULL;
+}
+#endif
+
+static void xtest_tee_test_1009(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+
+ Do_ADBG_BeginSubCase(c, "TEE Wait 0.1s");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &os_test_ta_uuid,
+ NULL, &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+
+ op.params[0].value.a = 100;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_WAIT, &op,
+ &ret_orig));
+ TEEC_CloseSession(&session);
+ }
+ Do_ADBG_EndSubCase(c, "TEE Wait 0.1s");
+
+ Do_ADBG_BeginSubCase(c, "TEE Wait 0.5s");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &os_test_ta_uuid,
+ NULL, &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+
+ op.params[0].value.a = 500;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_WAIT, &op,
+ &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ TEEC_CloseSession(&session);
+ }
+ Do_ADBG_EndSubCase(c, "TEE Wait 0.5s");
+
+#ifdef USER_SPACE
+ Do_ADBG_BeginSubCase(c, "TEE Wait 2s cancel");
+ {
+ pthread_t thr;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &os_test_ta_uuid,
+ NULL, &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+
+ op.params[0].value.a = 2000;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT(c, 0,
+ pthread_create(&thr, NULL, cancellation_thread, &op));
+
+ (void)ADBG_EXPECT_TEEC_RESULT(c, TEEC_ERROR_CANCEL,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_WAIT, &op,
+ &ret_orig));
+
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ (void)ADBG_EXPECT(c, 0, pthread_join(thr, NULL));
+ TEEC_CloseSession(&session);
+ }
+ Do_ADBG_EndSubCase(c, "TEE Wait 2s cancel");
+#endif
+
+ Do_ADBG_BeginSubCase(c, "TEE Wait 2s");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &os_test_ta_uuid,
+ NULL, &ret_orig));
+
+ op.params[0].value.a = 2000;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session, TA_OS_TEST_CMD_WAIT, &op,
+ &ret_orig));
+
+ TEEC_CloseSession(&session);
+ }
+ Do_ADBG_EndSubCase(c, "TEE Wait 2s");
+}
+
+static void xtest_tee_test_1010(ADBG_Case_t *c)
+{
+ unsigned n;
+
+ for (n = 1; n <= 5; n++) {
+ Do_ADBG_BeginSubCase(c, "Invalid memory access %u", n);
+ xtest_tee_test_invalid_mem_access(c, n);
+ Do_ADBG_EndSubCase(c, "Invalid memory access %u", n);
+ }
+}
+
+static void xtest_tee_test_1011(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+ struct xtest_crypto_session cs = {
+ c, &session, TA_RPC_CMD_CRYPT_SHA256,
+ TA_RPC_CMD_CRYPT_AES256ECB_ENC,
+ TA_RPC_CMD_CRYPT_AES256ECB_DEC
+ };
+ TEEC_UUID uuid = rpc_test_ta_uuid;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &uuid, NULL, &ret_orig)))
+ return;
+
+ /*
+ * Run the "complete crypto test suite" using RPC
+ */
+ xtest_crypto_test(&cs);
+ TEEC_CloseSession(&session);
+}
+
+/*
+ * Note that this test is failing when
+ * - running twice in a raw
+ * - and the user TA is statically linked
+ * This is because the counter is not reseted when opening the first session
+ * in case the TA is statically linked
+ */
+static void xtest_tee_test_1012(ADBG_Case_t *c)
+{
+ TEEC_Session session1 = { 0 };
+ TEEC_Session session2 = { 0 };
+ uint32_t ret_orig;
+ TEEC_UUID uuid = sims_test_ta_uuid;
+
+ Do_ADBG_BeginSubCase(c, "Single Instance Multi Session");
+ {
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ static const uint8_t in[] = {
+ 0x5A, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
+ 0xF0, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
+ 0xE9, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
+ 0xF0, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x8E
+ };
+ uint8_t out[32] = { 0 };
+ int i;
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session1, &uuid, NULL,
+ &ret_orig));
+
+ op.params[0].value.a = 0;
+ op.params[1].tmpref.buffer = (void *)in;
+ op.params[1].tmpref.size = sizeof(in);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session1, TA_SIMS_CMD_WRITE, &op,
+ &ret_orig));
+
+ for (i = 1; i < 1000; i++) {
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session2, &uuid, NULL,
+ &ret_orig));
+
+ op.params[0].value.a = 0;
+ op.params[1].tmpref.buffer = out;
+ op.params[1].tmpref.size = sizeof(out);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session2, TA_SIMS_CMD_READ,
+ &op, &ret_orig));
+
+ if (!ADBG_EXPECT_BUFFER(c, in, sizeof(in), out,
+ sizeof(out))) {
+ Do_ADBG_Log("in:");
+ Do_ADBG_HexLog(in, sizeof(in), 16);
+ Do_ADBG_Log("out:");
+ Do_ADBG_HexLog(out, sizeof(out), 16);
+ }
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_OUTPUT,
+ TEEC_NONE, TEEC_NONE,
+ TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session1,
+ TA_SIMS_CMD_GET_COUNTER,
+ &op, &ret_orig));
+
+ (void)ADBG_EXPECT(c, 0, op.params[0].value.a);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session2,
+ TA_SIMS_CMD_GET_COUNTER, &op,
+ &ret_orig));
+
+ (void)ADBG_EXPECT(c, i, op.params[0].value.a);
+ TEEC_CloseSession(&session2);
+ }
+
+ memset(out, 0, sizeof(out));
+ op.params[0].value.a = 0;
+ op.params[1].tmpref.buffer = out;
+ op.params[1].tmpref.size = sizeof(out);
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ (void)ADBG_EXPECT_TEEC_SUCCESS(c,
+ TEEC_InvokeCommand(&session1, TA_SIMS_CMD_READ, &op,
+ &ret_orig));
+
+ if (!ADBG_EXPECT(c, 0, memcmp(in, out, sizeof(in)))) {
+ Do_ADBG_Log("in:");
+ Do_ADBG_HexLog(in, sizeof(in), 16);
+ Do_ADBG_Log("out:");
+ Do_ADBG_HexLog(out, sizeof(out), 16);
+ }
+
+ TEEC_CloseSession(&session1);
+ }
+}
diff --git a/host/xtest/xtest_10000.c b/host/xtest/xtest_10000.c
new file mode 100644
index 0000000..f402490
--- /dev/null
+++ b/host/xtest/xtest_10000.c
@@ -0,0 +1,843 @@
+/*
+ * Copyright (c) 2014, Linaro Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+
+#include <tee_api_types.h>
+#include <tee_api_defines_extensions.h>
+#include <utee_defines.h>
+#include <string.h>
+#include <enc_fs_key_manager_test.h>
+
+#define WITH_HKDF 1
+#define WITH_CONCAT_KDF 1
+#define WITH_PBKDF2 1
+
+static void xtest_tee_test_10001(ADBG_Case_t *c);
+static void xtest_tee_test_10002(ADBG_Case_t *c);
+static void xtest_tee_test_10003(ADBG_Case_t *c);
+
+ADBG_CASE_DEFINE(XTEST_TEE_10001, xtest_tee_test_10001,
+ /* Title */
+ "Test TEE Internal API key derivation extensions",
+ /* Short description */
+ "Test non-standard cryptographic key derivation algorithms",
+ /* Requirement IDs */
+ "Linaro CARD-1661",
+ /* How to implement */
+ "Invoke key derivation functions with standard test vectors"
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_10002, xtest_tee_test_10002,
+ /* Title */
+ "Secure Storage Key Manager API Self Test",
+ /* Short description */
+ "Test secure storage key manager functionality",
+ /* Requirement IDs */
+ "Linaro SWG-176",
+ /* How to implement */
+ "Invoke key manager self test function in test TA"
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_10003, xtest_tee_test_10003,
+ /* Title */
+ "ECC Self Test",
+ /* Short description */
+ "Test ECC API",
+ /* Requirement IDs */
+ "",
+ /* How to implement */
+ "Invoke ECC self test function in test TA"
+ );
+
+/*
+ * HKDF test data from RFC 5869
+ */
+
+/* A.1 SHA-256 */
+
+static const uint8_t hkdf_a1_ikm[] = {
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
+};
+
+static const uint8_t hkdf_a1_salt[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c
+};
+
+static const uint8_t hkdf_a1_info[] = {
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf8, 0xf9
+};
+
+static const uint8_t hkdf_a1_okm[] = {
+ 0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a,
+ 0x90, 0x43, 0x4f, 0x64, 0xd0, 0x36, 0x2f, 0x2a,
+ 0x2d, 0x2d, 0x0a, 0x90, 0xcf, 0x1a, 0x5a, 0x4c,
+ 0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4, 0xc5, 0xbf,
+ 0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18,
+ 0x58, 0x65
+};
+
+/* A.2 SHA-256 */
+static const uint8_t hkdf_a2_ikm[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x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eb, 0xec, 0xed, 0xee, 0xef,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
+};
+
+static const uint8_t hkdf_a2_okm[] = {
+ 0xb1, 0x1e, 0x39, 0x8d, 0xc8, 0x03, 0x27, 0xa1,
+ 0xc8, 0xe7, 0xf7, 0x8c, 0x59, 0x6a, 0x49, 0x34,
+ 0x4f, 0x01, 0x2e, 0xda, 0x2d, 0x4e, 0xfa, 0xd8,
+ 0xa0, 0x50, 0xcc, 0x4c, 0x19, 0xaf, 0xa9, 0x7c,
+ 0x59, 0x04, 0x5a, 0x99, 0xca, 0xc7, 0x82, 0x72,
+ 0x71, 0xcb, 0x41, 0xc6, 0x5e, 0x59, 0x0e, 0x09,
+ 0xda, 0x32, 0x75, 0x60, 0x0c, 0x2f, 0x09, 0xb8,
+ 0x36, 0x77, 0x93, 0xa9, 0xac, 0xa3, 0xdb, 0x71,
+ 0xcc, 0x30, 0xc5, 0x81, 0x79, 0xec, 0x3e, 0x87,
+ 0xc1, 0x4c, 0x01, 0xd5, 0xc1, 0xf3, 0x43, 0x4f,
+ 0x1d, 0x87
+};
+
+/* A.3 SHA-256 */
+#define hkdf_a3_ikm hkdf_a1_ikm
+static const uint8_t hkdf_a3_salt[] = {};
+
+static const uint8_t hkdf_a3_info[] = {};
+
+static const uint8_t hkdf_a3_okm[] = {
+ 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f,
+ 0x71, 0x5f, 0x80, 0x2a, 0x06, 0x3c, 0x5a, 0x31,
+ 0xb8, 0xa1, 0x1f, 0x5c, 0x5e, 0xe1, 0x87, 0x9e,
+ 0xc3, 0x45, 0x4e, 0x5f, 0x3c, 0x73, 0x8d, 0x2d,
+ 0x9d, 0x20, 0x13, 0x95, 0xfa, 0xa4, 0xb6, 0x1a,
+ 0x96, 0xc8
+};
+
+/* A.4 SHA-1 */
+static const uint8_t hkdf_a4_ikm[] = {
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+ 0x0b, 0x0b, 0x0b
+};
+
+static const uint8_t hkdf_a4_salt[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c
+};
+
+static const uint8_t hkdf_a4_info[] = {
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf8, 0xf9
+};
+
+static const uint8_t hkdf_a4_okm[] = {
+ 0x08, 0x5a, 0x01, 0xea, 0x1b, 0x10, 0xf3, 0x69,
+ 0x33, 0x06, 0x8b, 0x56, 0xef, 0xa5, 0xad, 0x81,
+ 0xa4, 0xf1, 0x4b, 0x82, 0x2f, 0x5b, 0x09, 0x15,
+ 0x68, 0xa9, 0xcd, 0xd4, 0xf1, 0x55, 0xfd, 0xa2,
+ 0xc2, 0x2e, 0x42, 0x24, 0x78, 0xd3, 0x05, 0xf3,
+ 0xf8, 0x96
+};
+
+/* A.5 SHA-1 */
+#define hkdf_a5_ikm hkdf_a2_ikm
+#define hkdf_a5_salt hkdf_a2_salt
+#define hkdf_a5_info hkdf_a2_info
+static const uint8_t hkdf_a5_okm[] = {
+ 0x0b, 0xd7, 0x70, 0xa7, 0x4d, 0x11, 0x60, 0xf7,
+ 0xc9, 0xf1, 0x2c, 0xd5, 0x91, 0x2a, 0x06, 0xeb,
+ 0xff, 0x6a, 0xdc, 0xae, 0x89, 0x9d, 0x92, 0x19,
+ 0x1f, 0xe4, 0x30, 0x56, 0x73, 0xba, 0x2f, 0xfe,
+ 0x8f, 0xa3, 0xf1, 0xa4, 0xe5, 0xad, 0x79, 0xf3,
+ 0xf3, 0x34, 0xb3, 0xb2, 0x02, 0xb2, 0x17, 0x3c,
+ 0x48, 0x6e, 0xa3, 0x7c, 0xe3, 0xd3, 0x97, 0xed,
+ 0x03, 0x4c, 0x7f, 0x9d, 0xfe, 0xb1, 0x5c, 0x5e,
+ 0x92, 0x73, 0x36, 0xd0, 0x44, 0x1f, 0x4c, 0x43,
+ 0x00, 0xe2, 0xcf, 0xf0, 0xd0, 0x90, 0x0b, 0x52,
+ 0xd3, 0xb4
+};
+
+/* A.6 SHA-1 */
+#define hkdf_a6_ikm hkdf_a1_ikm
+static const uint8_t hkdf_a6_salt[] = {};
+
+static const uint8_t hkdf_a6_info[] = {};
+
+static const uint8_t hkdf_a6_okm[] = {
+ 0x0a, 0xc1, 0xaf, 0x70, 0x02, 0xb3, 0xd7, 0x61,
+ 0xd1, 0xe5, 0x52, 0x98, 0xda, 0x9d, 0x05, 0x06,
+ 0xb9, 0xae, 0x52, 0x05, 0x72, 0x20, 0xa3, 0x06,
+ 0xe0, 0x7b, 0x6b, 0x87, 0xe8, 0xdf, 0x21, 0xd0,
+ 0xea, 0x00, 0x03, 0x3d, 0xe0, 0x39, 0x84, 0xd3,
+ 0x49, 0x18
+};
+
+/* A.7 SHA-1 */
+static const uint8_t hkdf_a7_ikm[] = {
+ 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
+ 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
+ 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c
+};
+
+static const uint8_t hkdf_a7_salt[] = {};
+
+static const uint8_t hkdf_a7_info[] = {};
+
+static const uint8_t hkdf_a7_okm[] = {
+ 0x2c, 0x91, 0x11, 0x72, 0x04, 0xd7, 0x45, 0xf3,
+ 0x50, 0x0d, 0x63, 0x6a, 0x62, 0xf6, 0x4f, 0x0a,
+ 0xb3, 0xba, 0xe5, 0x48, 0xaa, 0x53, 0xd4, 0x23,
+ 0xb0, 0xd1, 0xf2, 0x7e, 0xbb, 0xa6, 0xf5, 0xe5,
+ 0x67, 0x3a, 0x08, 0x1d, 0x70, 0xcc, 0xe7, 0xac,
+ 0xfc, 0x48
+};
+
+/*
+ * Concat KDF (NIST SP 800-56A R1)
+ *
+ * Test vector from:
+ * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-37
+ * appendix C
+ */
+static const uint8_t concat_kdf_1_z[] = {
+ 158, 86, 217, 29, 129, 113, 53, 211,
+ 114, 131, 66, 131, 191, 132, 38, 156,
+ 251, 49, 110, 163, 218, 128, 106, 72,
+ 246, 218, 167, 121, 140, 254, 144, 196
+};
+
+static const uint8_t concat_kdf_1_other_info[] = {
+ 0, 0, 0, 7, 65, 49, 50, 56,
+ 71, 67, 77, 0, 0, 0, 5, 65,
+ 108, 105, 99, 101, 0, 0, 0, 3,
+ 66, 111, 98, 0, 0, 0, 128
+};
+
+static const uint8_t concat_kdf_1_derived_key[] = {
+ 86, 170, 141, 234, 248, 35, 109, 32,
+ 92, 34, 40, 205, 113, 167, 16, 26
+};
+
+/*
+ * PKCS #5 2.0 / RFC 2898 Key Derivation Function 2 (PBKDF2)
+ * Test vectors from RFC 6070 https://www.ietf.org/rfc/rfc6070.txt
+ */
+
+/* 1 */
+static const uint8_t pbkdf2_1_password[] = {
+ 'p', 'a', 's', 's', 'w', 'o', 'r', 'd'
+};
+
+static const uint8_t pbkdf2_1_salt[] = {
+ 's', 'a', 'l', 't'
+};
+
+#define pbkdf2_1_iteration_count 1
+static const uint8_t pbkdf2_1_dkm[] = {
+ 0x0c, 0x60, 0xc8, 0x0f, 0x96, 0x1f, 0x0e, 0x71,
+ 0xf3, 0xa9, 0xb5, 0x24, 0xaf, 0x60, 0x12, 0x06,
+ 0x2f, 0xe0, 0x37, 0xa6
+};
+
+/* 2 */
+#define pbkdf2_2_password pbkdf2_1_password
+#define pbkdf2_2_salt pbkdf2_1_salt
+#define pbkdf2_2_iteration_count 2
+static const uint8_t pbkdf2_2_dkm[] = {
+ 0xea, 0x6c, 0x01, 0x4d, 0xc7, 0x2d, 0x6f, 0x8c,
+ 0xcd, 0x1e, 0xd9, 0x2a, 0xce, 0x1d, 0x41, 0xf0,
+ 0xd8, 0xde, 0x89, 0x57
+};
+
+/* 3 */
+#define pbkdf2_3_password pbkdf2_1_password
+#define pbkdf2_3_salt pbkdf2_1_salt
+#define pbkdf2_3_iteration_count 4096
+static const uint8_t pbkdf2_3_dkm[] = {
+ 0x4b, 0x00, 0x79, 0x01, 0xb7, 0x65, 0x48, 0x9a,
+ 0xbe, 0xad, 0x49, 0xd9, 0x26, 0xf7, 0x21, 0xd0,
+ 0x65, 0xa4, 0x29, 0xc1
+};
+
+/* 4 */
+#define pbkdf2_4_password pbkdf2_1_password
+#define pbkdf2_4_salt pbkdf2_1_salt
+#define pbkdf2_4_iteration_count 16777216
+static const uint8_t pbkdf2_4_dkm[] = {
+ 0xee, 0xfe, 0x3d, 0x61, 0xcd, 0x4d, 0xa4, 0xe4,
+ 0xe9, 0x94, 0x5b, 0x3d, 0x6b, 0xa2, 0x15, 0x8c,
+ 0x26, 0x34, 0xe9, 0x84
+};
+
+/* 5 */
+static const uint8_t pbkdf2_5_password[] = {
+ 'p', 'a', 's', 's', 'w', 'o', 'r', 'd',
+ 'P', 'A', 'S', 'S', 'W', 'O', 'R', 'D',
+ 'p', 'a', 's', 's', 'w', 'o', 'r', 'd'
+};
+
+static const uint8_t pbkdf2_5_salt[] = {
+ 's', 'a', 'l', 't', 'S', 'A', 'L', 'T',
+ 's', 'a', 'l', 't', 'S', 'A', 'L', 'T',
+ 's', 'a', 'l', 't', 'S', 'A', 'L', 'T',
+ 's', 'a', 'l', 't', 'S', 'A', 'L', 'T',
+ 's', 'a', 'l', 't'
+};
+
+#define pbkdf2_5_iteration_count 4096
+static const uint8_t pbkdf2_5_dkm[] = {
+ 0x3d, 0x2e, 0xec, 0x4f, 0xe4, 0x1c, 0x84, 0x9b,
+ 0x80, 0xc8, 0xd8, 0x36, 0x62, 0xc0, 0xe4, 0x4a,
+ 0x8b, 0x29, 0x1a, 0x96, 0x4c, 0xf2, 0xf0, 0x70,
+ 0x38
+};
+
+/* 6 */
+static const uint8_t pbkdf2_6_password[] = {
+ 'p', 'a', 's', 's', '\0', 'w', 'o', 'r',
+ 'd',
+};
+
+static const uint8_t pbkdf2_6_salt[] = {
+ 's', 'a', '\0', 'l', 't'
+};
+
+#define pbkdf2_6_iteration_count 4096
+static const uint8_t pbkdf2_6_dkm[] = {
+ 0x56, 0xfa, 0x6a, 0xa7, 0x55, 0x48, 0x09, 0x9d,
+ 0xcc, 0x37, 0xd7, 0xf0, 0x34, 0x25, 0xe0, 0xc3
+};
+
+#ifdef WITH_HKDF
+static void xtest_test_derivation_hkdf(ADBG_Case_t *c, TEEC_Session *session)
+{
+ size_t n;
+#define TEST_HKDF_DATA(section, algo, id, oeb /* omit empty bufs */) \
+ { \
+ section, algo, \
+ hkdf_##id##_ikm, sizeof(hkdf_##id##_ikm), \
+ (oeb && !sizeof(hkdf_##id##_salt)) ? NULL : hkdf_##id##_salt, sizeof(hkdf_##id##_salt), \
+ (oeb && !sizeof(hkdf_##id##_info)) ? NULL : hkdf_##id##_info, sizeof(hkdf_##id##_info), \
+ hkdf_##id##_okm, sizeof(hkdf_##id##_okm), \
+ }
+ static struct hkdf_case {
+ const char *subcase_name;
+ uint32_t algo;
+ const uint8_t *ikm;
+ size_t ikm_len;
+ const uint8_t *salt;
+ size_t salt_len;
+ const uint8_t *info;
+ size_t info_len;
+ const uint8_t *okm;
+ size_t okm_len;
+ } hkdf_cases[] = {
+ TEST_HKDF_DATA("A.1 (SHA-256)",
+ TEE_ALG_HKDF_SHA256_DERIVE_KEY, a1, false),
+ TEST_HKDF_DATA("A.2 (SHA-256)",
+ TEE_ALG_HKDF_SHA256_DERIVE_KEY, a2, false),
+ TEST_HKDF_DATA("A.3 (SHA-256) [1]",
+ TEE_ALG_HKDF_SHA256_DERIVE_KEY, a3, false),
+ TEST_HKDF_DATA("A.3 (SHA-256) [2]",
+ TEE_ALG_HKDF_SHA256_DERIVE_KEY, a3, true),
+ TEST_HKDF_DATA("A.4 (SHA-1)",
+ TEE_ALG_HKDF_SHA1_DERIVE_KEY, a4, false),
+ TEST_HKDF_DATA("A.5 (SHA-1)",
+ TEE_ALG_HKDF_SHA1_DERIVE_KEY, a5, false),
+ TEST_HKDF_DATA("A.6 (SHA-1) [1]",
+ TEE_ALG_HKDF_SHA1_DERIVE_KEY, a6, false),
+ TEST_HKDF_DATA("A.6 (SHA-1) [2]",
+ TEE_ALG_HKDF_SHA1_DERIVE_KEY, a6, true),
+ TEST_HKDF_DATA("A.7 (SHA-1) [1]",
+ TEE_ALG_HKDF_SHA1_DERIVE_KEY, a7, false),
+ TEST_HKDF_DATA("A.7 (SHA-1) [2]",
+ TEE_ALG_HKDF_SHA1_DERIVE_KEY, a7, true),
+ };
+ size_t max_size = 2048;
+
+ for (n = 0; n < sizeof(hkdf_cases) / sizeof(struct hkdf_case); n++) {
+ TEE_OperationHandle op;
+ TEE_ObjectHandle key_handle;
+ TEE_ObjectHandle sv_handle;
+ TEE_Attribute params[4];
+ size_t param_count = 0;
+ uint8_t out[2048];
+ size_t out_size;
+ const struct hkdf_case *hc = &hkdf_cases[n];
+
+ Do_ADBG_BeginSubCase(c, "HKDF RFC 5869 %s", hc->subcase_name);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, session, &op,
+ hc->algo, TEE_MODE_DERIVE, max_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, session,
+ TEE_TYPE_HKDF_IKM, max_size, &key_handle)))
+ goto out;
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_HKDF_IKM, hc->ikm,
+ hc->ikm_len);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, session,
+ key_handle, params, param_count)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, session, op,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, session,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, session,
+ TEE_TYPE_GENERIC_SECRET, hc->okm_len * 8,
+ &sv_handle)))
+ goto out;
+
+ param_count = 0;
+
+ if (hc->salt)
+ xtest_add_attr(¶m_count, params, TEE_ATTR_HKDF_SALT,
+ hc->salt, hc->salt_len);
+ if (hc->info)
+ xtest_add_attr(¶m_count, params, TEE_ATTR_HKDF_INFO,
+ hc->info, hc->info_len);
+
+ params[param_count].attributeID = TEE_ATTR_HKDF_OKM_LENGTH;
+ params[param_count].content.value.a = hc->okm_len;
+ params[param_count].content.value.b = 0;
+ param_count++;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_derive_key(c, session, op, sv_handle,
+ params, param_count)))
+ goto out;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_get_object_buffer_attribute(c, session,
+ sv_handle, TEE_ATTR_SECRET_VALUE, out,
+ &out_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_BUFFER(c, hc->okm, hc->okm_len, out, out_size))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, session, op)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, session,
+ sv_handle)))
+ goto out;
+ out:
+ Do_ADBG_EndSubCase(c, "HKDF RFC 5869 %s", hc->subcase_name);
+ }
+}
+#endif /* WITH_HKDF */
+
+#ifdef WITH_CONCAT_KDF
+static void xtest_test_derivation_concat_kdf(ADBG_Case_t *c, TEEC_Session *session)
+{
+ size_t n;
+#define TEST_CONCAT_KDF_DATA(name, algo, id, oeb /* omit empty bufs */) \
+ { \
+ name, algo, \
+ concat_kdf_##id##_z, sizeof(concat_kdf_##id##_z), \
+ (oeb && !sizeof(concat_kdf_##id##_other_info)) ? NULL \
+ : concat_kdf_##id##_other_info, \
+ sizeof(concat_kdf_##id##_other_info), \
+ concat_kdf_##id##_derived_key, sizeof(concat_kdf_##id##_derived_key), \
+ }
+ static struct concat_kdf_case {
+ const char *subcase_name;
+ uint32_t algo;
+ const uint8_t *shared_secret;
+ size_t shared_secret_len;
+ const uint8_t *other_info;
+ size_t other_info_len;
+ const uint8_t *derived_key;
+ size_t derived_key_len;
+ } concat_kdf_cases[] = {
+ TEST_CONCAT_KDF_DATA("JWA-37 C (SHA-256)",
+ TEE_ALG_CONCAT_KDF_SHA256_DERIVE_KEY, 1, false),
+ };
+ size_t max_size = 2048;
+
+ for (n = 0;
+ n < sizeof(concat_kdf_cases) / sizeof(struct concat_kdf_case);
+ n++) {
+ TEE_OperationHandle op;
+ TEE_ObjectHandle key_handle;
+ TEE_ObjectHandle sv_handle;
+ TEE_Attribute params[4];
+ size_t param_count = 0;
+ uint8_t out[2048];
+ size_t out_size;
+ const struct concat_kdf_case *cc = &concat_kdf_cases[n];
+
+ Do_ADBG_BeginSubCase(c, "Concat KDF %s", cc->subcase_name);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, session, &op,
+ cc->algo, TEE_MODE_DERIVE, max_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, session,
+ TEE_TYPE_CONCAT_KDF_Z, max_size, &key_handle)))
+ goto out;
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_CONCAT_KDF_Z,
+ cc->shared_secret, cc->shared_secret_len);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, session,
+ key_handle, params, param_count)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, session, op,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, session,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, session,
+ TEE_TYPE_GENERIC_SECRET, cc->derived_key_len *
+ 8, &sv_handle)))
+ goto out;
+
+ param_count = 0;
+
+ if (cc->other_info)
+ xtest_add_attr(¶m_count, params,
+ TEE_ATTR_CONCAT_KDF_OTHER_INFO,
+ cc->other_info, cc->other_info_len);
+
+ params[param_count].attributeID = TEE_ATTR_CONCAT_KDF_DKM_LENGTH;
+ params[param_count].content.value.a = cc->derived_key_len;
+ params[param_count].content.value.b = 0;
+ param_count++;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_derive_key(c, session, op, sv_handle,
+ params, param_count)))
+ goto out;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_get_object_buffer_attribute(c, session,
+ sv_handle, TEE_ATTR_SECRET_VALUE, out,
+ &out_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_BUFFER(c, cc->derived_key, cc->derived_key_len,
+ out, out_size))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, session, op)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, session,
+ sv_handle)))
+ goto out;
+out:
+ Do_ADBG_EndSubCase(c, "Concat KDF %s", cc->subcase_name);
+ }
+}
+#endif /* WITH_CONCAT_KDF */
+
+#ifdef WITH_PBKDF2
+static void xtest_test_derivation_pbkdf2(ADBG_Case_t *c, TEEC_Session *session)
+{
+ size_t n;
+#define TEST_PBKDF2_DATA(section, algo, id, oeb /* omit empty bufs */) \
+ { \
+ section, algo, \
+ pbkdf2_##id##_password, sizeof(pbkdf2_##id##_password), \
+ (oeb && !sizeof(pbkdf2_##id##_salt)) ? NULL : pbkdf2_##id##_salt, sizeof(pbkdf2_##id##_salt), \
+ pbkdf2_##id##_iteration_count, \
+ pbkdf2_##id##_dkm, sizeof(pbkdf2_##id##_dkm), \
+ }
+#define _TO_STR(n) #n
+#define TO_STR(n) _TO_STR(n)
+#define RFC6070_TEST(n) \
+ TEST_PBKDF2_DATA("RFC 6070 " TO_STR(n) " (HMAC-SHA1)", \
+ TEE_ALG_PBKDF2_HMAC_SHA1_DERIVE_KEY, n, false)
+ static struct pbkdf2_case {
+ const char *subcase_name;
+ uint32_t algo;
+ const uint8_t *password;
+ size_t password_len;
+ const uint8_t *salt;
+ size_t salt_len;
+ uint32_t iteration_count;
+ const uint8_t *dkm;
+ size_t dkm_len;
+ } pbkdf2_cases[] = {
+ RFC6070_TEST(1), RFC6070_TEST(2), RFC6070_TEST(3),
+#if 0
+ RFC6070_TEST(4), /* Lengthy! (3 min on my PC / QEMU) */
+#endif
+ RFC6070_TEST(5), RFC6070_TEST(6)
+ };
+ size_t max_size = 2048;
+
+ for (n = 0; n < sizeof(pbkdf2_cases) / sizeof(struct pbkdf2_case); n++) {
+ TEE_OperationHandle op;
+ TEE_ObjectHandle key_handle;
+ TEE_ObjectHandle sv_handle;
+ TEE_Attribute params[4];
+ size_t param_count = 0;
+ uint8_t out[2048];
+ size_t out_size;
+ const struct pbkdf2_case *pc = &pbkdf2_cases[n];
+
+ Do_ADBG_BeginSubCase(c, "PBKDF2 %s", pc->subcase_name);
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, session, &op,
+ pc->algo, TEE_MODE_DERIVE, max_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, session,
+ TEE_TYPE_PBKDF2_PASSWORD, max_size,
+ &key_handle)))
+ goto out;
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_PBKDF2_PASSWORD,
+ pc->password, pc->password_len);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, session,
+ key_handle, params, param_count)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, session, op,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, session,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, session,
+ TEE_TYPE_GENERIC_SECRET, pc->dkm_len * 8,
+ &sv_handle)))
+ goto out;
+
+ param_count = 0;
+
+ if (pc->salt)
+ xtest_add_attr(¶m_count, params,
+ TEE_ATTR_PBKDF2_SALT, pc->salt,
+ pc->salt_len);
+
+ params[param_count].attributeID = TEE_ATTR_PBKDF2_DKM_LENGTH;
+ params[param_count].content.value.a = pc->dkm_len;
+ params[param_count].content.value.b = 0;
+ param_count++;
+
+ params[param_count].attributeID =
+ TEE_ATTR_PBKDF2_ITERATION_COUNT;
+ params[param_count].content.value.a = pc->iteration_count;
+ params[param_count].content.value.b = 0;
+ param_count++;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_derive_key(c, session, op, sv_handle,
+ params, param_count)))
+ goto out;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_get_object_buffer_attribute(c, session,
+ sv_handle, TEE_ATTR_SECRET_VALUE, out, &out_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_BUFFER(c, pc->dkm, pc->dkm_len, out, out_size))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, session, op)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, session,
+ sv_handle)))
+ goto out;
+out:
+ Do_ADBG_EndSubCase(c, "PBKDF2 %s", pc->subcase_name);
+ }
+}
+#endif /* WITH_PBKDF2 */
+
+static TEEC_Result enc_fs_km_self_test(TEEC_Session *sess)
+{
+ TEEC_Operation op;
+ TEEC_Result res;
+ uint32_t org;
+
+ memset(&op, 0, sizeof(op));
+ res = TEEC_InvokeCommand(sess, CMD_SELF_TESTS, &op, &org);
+ return res;
+}
+
+#define CMD_ECC_GEN_KEY_SELF_TESTS 0
+static TEEC_Result ecc_self_test(TEEC_Session *sess, uint32_t algo)
+{
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ TEEC_Result res;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = algo;
+ op.params[0].value.b = 0;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+ res = TEEC_InvokeCommand(sess, CMD_ECC_GEN_KEY_SELF_TESTS,
+ &op, &ret_orig);
+ return res;
+}
+
+static void xtest_tee_test_10001(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+#ifdef WITH_HKDF
+ xtest_test_derivation_hkdf(c, &session);
+#endif
+#ifdef WITH_CONCAT_KDF
+ xtest_test_derivation_concat_kdf(c, &session);
+#endif
+#ifdef WITH_PBKDF2
+ xtest_test_derivation_pbkdf2(c, &session);
+#endif
+
+ TEEC_CloseSession(&session);
+}
+
+/* secure storage key manager self test */
+static void xtest_tee_test_10002(ADBG_Case_t *c)
+{
+ TEEC_Result res;
+ TEEC_Session sess;
+ uint32_t orig;
+
+ res = xtest_teec_open_session(&sess,
+ &enc_fs_key_manager_test_ta_uuid,
+ NULL, &orig);
+ if (res != TEEC_SUCCESS) {
+ Do_ADBG_Log("Ignore test due to TA does not exist");
+ return;
+ }
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(
+ c, enc_fs_km_self_test(&sess)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+/* ECC self test */
+static void xtest_tee_test_10003(ADBG_Case_t *c)
+{
+ TEEC_Result res;
+ TEEC_Session sess;
+ uint32_t orig;
+ uint32_t algo;
+
+ res = xtest_teec_open_session(&sess, &ecc_test_ta_uuid, NULL, &orig);
+ if (res != TEEC_SUCCESS) {
+ Do_ADBG_Log("Ignore test due to TA does not exist");
+ return;
+ }
+
+ for (algo = TEE_ECC_CURVE_NIST_P192;
+ algo <= TEE_ECC_CURVE_NIST_P521;
+ algo++) {
+ Do_ADBG_BeginSubCase(c, "ECC Generate Key algo=0x%x", algo);
+ ADBG_EXPECT_TEEC_SUCCESS(c, ecc_self_test(&sess, algo));
+ Do_ADBG_EndSubCase(c, "ECC Generate Key algo=0x%x", algo);
+ }
+
+ algo = TEE_ECC_CURVE_NIST_P521+1;
+ Do_ADBG_BeginSubCase(c, "ECC Generate Key algo=0x%x", algo);
+ ADBG_EXPECT(c, TEE_ERROR_NOT_SUPPORTED, ecc_self_test(&sess, algo));
+ Do_ADBG_EndSubCase(c, "ECC Generate Key algo=0x%x", algo);
+
+ TEEC_CloseSession(&sess);
+}
diff --git a/host/xtest/xtest_4000.c b/host/xtest/xtest_4000.c
new file mode 100644
index 0000000..35176e2
--- /dev/null
+++ b/host/xtest/xtest_4000.c
@@ -0,0 +1,4056 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <inttypes.h>
+#include <malloc.h>
+
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+
+#include <tee_api_types.h>
+#include <ta_crypt.h>
+#include <utee_defines.h>
+#include <util.h>
+
+#include <xtest_4000_data.h>
+
+#include <assert.h>
+
+static void xtest_tee_test_4001(ADBG_Case_t *Case_p);
+static void xtest_tee_test_4002(ADBG_Case_t *Case_p);
+static void xtest_tee_test_4003_no_xts(ADBG_Case_t *Case_p);
+static void xtest_tee_test_4003_xts(ADBG_Case_t *Case_p);
+static void xtest_tee_test_4004(ADBG_Case_t *Case_p);
+static void xtest_tee_test_4005(ADBG_Case_t *Case_p);
+static void xtest_tee_test_4006(ADBG_Case_t *Case_p);
+static void xtest_tee_test_4007(ADBG_Case_t *Case_p);
+static void xtest_tee_test_4008(ADBG_Case_t *Case_p);
+
+ADBG_CASE_DEFINE(XTEST_TEE_4001, xtest_tee_test_4001,
+ /* Title */
+ "Test TEE Internal API hash operations",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_4002, xtest_tee_test_4002,
+ /* Title */
+ "Test TEE Internal API MAC operations",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_4003_NO_XTS, xtest_tee_test_4003_no_xts,
+ /* Title */
+ "Test TEE Internal API cipher operations without AES XTS",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_4003_XTS, xtest_tee_test_4003_xts,
+ /* Title */
+ "Test TEE Internal API cipher operations for AES XTS",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_4004, xtest_tee_test_4004,
+ /* Title */
+ "Test TEE Internal API get random",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_4005, xtest_tee_test_4005,
+ /* Title */
+ "Test TEE Internal API Authenticated Encryption operations",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_4006, xtest_tee_test_4006,
+ /* Title */
+ "Test TEE Internal API Asymmetric Cipher operations",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_4007, xtest_tee_test_4007,
+ /* Title */
+ "Test TEE Internal API Generate key",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(XTEST_TEE_4008, xtest_tee_test_4008,
+ /* Title */
+ "Test TEE Internal API Derive key",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+static TEEC_Result ta_crypt_cmd_random_number_generate(ADBG_Case_t *c,
+ TEEC_Session *s,
+ void *buf, size_t blen);
+
+static TEEC_Result ta_crypt_cmd_reset_operation(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
+ TEEC_NONE);
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_RESET_OPERATION, &op,
+ &ret_orig);
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_copy_operation(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle dst_oph,
+ TEE_OperationHandle src_oph)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)dst_oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)dst_oph;
+
+ assert((uintptr_t)src_oph <= UINT32_MAX);
+ op.params[0].value.b = (uint32_t)(uintptr_t)src_oph;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_COPY_OPERATION, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_digest_update(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *chunk,
+ size_t chunk_size)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+ op.params[1].tmpref.buffer = (void *)chunk;
+ op.params[1].tmpref.size = chunk_size;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_DIGEST_UPDATE, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_digest_do_final(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *chunk,
+ size_t chunk_len, void *hash,
+ size_t *hash_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)chunk;
+ op.params[1].tmpref.size = chunk_len;
+
+ op.params[2].tmpref.buffer = (void *)hash;
+ op.params[2].tmpref.size = *hash_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_DIGEST_DO_FINAL, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *hash_len = op.params[2].tmpref.size;
+
+ return res;
+}
+
+static TEE_Result ta_crypt_cmd_set_operation_key2(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ TEE_ObjectHandle key1,
+ TEE_ObjectHandle key2)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ assert((uintptr_t)key1 <= UINT32_MAX);
+ op.params[0].value.b = (uint32_t)(uintptr_t)key1;
+
+ assert((uintptr_t)key2 <= UINT32_MAX);
+ op.params[1].value.a = (uint32_t)(uintptr_t)key2;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_VALUE_INPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_SET_OPERATION_KEY2, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_mac_init(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *iv, size_t iv_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ if (iv != NULL) {
+ op.params[1].tmpref.buffer = (void *)iv;
+ op.params[1].tmpref.size = iv_len;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_NONE, TEEC_NONE);
+ } else {
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+ }
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_MAC_INIT, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_mac_update(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *chunk, size_t chunk_size)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)chunk;
+ op.params[1].tmpref.size = chunk_size;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_MAC_UPDATE, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_mac_final_compute(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *chunk,
+ size_t chunk_len,
+ void *hash,
+ size_t *hash_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)chunk;
+ op.params[1].tmpref.size = chunk_len;
+
+ op.params[2].tmpref.buffer = (void *)hash;
+ op.params[2].tmpref.size = *hash_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_MAC_FINAL_COMPUTE, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *hash_len = op.params[2].tmpref.size;
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_cipher_init(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *iv, size_t iv_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ if (iv != NULL) {
+ op.params[1].tmpref.buffer = (void *)iv;
+ op.params[1].tmpref.size = iv_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_NONE, TEEC_NONE);
+ } else {
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+ }
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_CIPHER_INIT, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_cipher_update(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *src, size_t src_len,
+ void *dst, size_t *dst_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)src;
+ op.params[1].tmpref.size = src_len;
+
+ op.params[2].tmpref.buffer = dst;
+ op.params[2].tmpref.size = *dst_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_CIPHER_UPDATE, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *dst_len = op.params[2].tmpref.size;
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_cipher_do_final(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *src,
+ size_t src_len,
+ void *dst,
+ size_t *dst_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)src;
+ op.params[1].tmpref.size = src_len;
+
+ op.params[2].tmpref.buffer = (void *)dst;
+ op.params[2].tmpref.size = *dst_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_CIPHER_DO_FINAL, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *dst_len = op.params[2].tmpref.size;
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_random_number_generate(ADBG_Case_t *c,
+ TEEC_Session *s,
+ void *buf,
+ size_t blen)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].tmpref.buffer = buf;
+ op.params[0].tmpref.size = blen;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_RANDOM_NUMBER_GENEREATE, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ (void)ADBG_EXPECT_COMPARE_UNSIGNED(c, blen, ==,
+ op.params[0].tmpref.size);
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_ae_init(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *nonce, size_t nonce_len,
+ size_t tag_len, size_t aad_len,
+ size_t payload_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+ op.params[0].value.b = tag_len;
+
+ op.params[1].tmpref.buffer = (void *)nonce;
+ op.params[1].tmpref.size = nonce_len;
+
+ op.params[2].value.a = aad_len;
+ op.params[2].value.b = payload_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_VALUE_OUTPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_AE_INIT, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_ae_update_aad(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *aad, size_t aad_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)aad;
+ op.params[1].tmpref.size = aad_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_AE_UPDATE_AAD, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_ae_update(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *src,
+ size_t src_len,
+ void *dst,
+ size_t *dst_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)src;
+ op.params[1].tmpref.size = src_len;
+
+ op.params[2].tmpref.buffer = (void *)dst;
+ op.params[2].tmpref.size = *dst_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_AE_UPDATE, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *dst_len = op.params[2].tmpref.size;
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_ae_encrypt_final(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *src,
+ size_t src_len, void *dst,
+ size_t *dst_len, void *tag,
+ size_t *tag_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)src;
+ op.params[1].tmpref.size = src_len;
+
+ op.params[2].tmpref.buffer = (void *)dst;
+ op.params[2].tmpref.size = *dst_len;
+
+ op.params[3].tmpref.buffer = (void *)tag;
+ op.params[3].tmpref.size = *tag_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_MEMREF_TEMP_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_AE_ENCRYPT_FINAL, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS) {
+ *dst_len = op.params[2].tmpref.size;
+ *tag_len = op.params[3].tmpref.size;
+ }
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_ae_decrypt_final(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const void *src, size_t src_len,
+ void *dst, size_t *dst_len,
+ const void *tag, size_t tag_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = (void *)src;
+ op.params[1].tmpref.size = src_len;
+
+ op.params[2].tmpref.buffer = dst;
+ op.params[2].tmpref.size = *dst_len;
+
+ op.params[3].tmpref.buffer = (void *)tag;
+ op.params[3].tmpref.size = tag_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_MEMREF_TEMP_INPUT);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_AE_DECRYPT_FINAL, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *dst_len = op.params[2].tmpref.size;
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_asymmetric_operate(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ uint32_t cmd,
+ const TEE_Attribute *params,
+ uint32_t paramCount,
+ const void *src,
+ size_t src_len,
+ void *dst,
+ size_t *dst_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ uint8_t *buf;
+ size_t blen;
+
+ res = pack_attrs(params, paramCount, &buf, &blen);
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, res))
+ return res;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = buf;
+ op.params[1].tmpref.size = blen;
+
+ op.params[2].tmpref.buffer = (void *)src;
+ op.params[2].tmpref.size = src_len;
+
+ op.params[3].tmpref.buffer = dst;
+ op.params[3].tmpref.size = *dst_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT);
+
+ res = TEEC_InvokeCommand(s, cmd, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *dst_len = op.params[3].tmpref.size;
+
+ free(buf);
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_asymmetric_encrypt(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const TEE_Attribute *params,
+ uint32_t paramCount,
+ const void *src,
+ size_t src_len,
+ void *dst,
+ size_t *dst_len)
+{
+ return ta_crypt_cmd_asymmetric_operate(c, s, oph,
+ TA_CRYPT_CMD_ASYMMETRIC_ENCRYPT,
+ params, paramCount,
+ src, src_len, dst, dst_len);
+}
+
+static TEEC_Result ta_crypt_cmd_asymmetric_decrypt(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const TEE_Attribute *params,
+ uint32_t paramCount,
+ const void *src,
+ size_t src_len,
+ void *dst,
+ size_t *dst_len)
+{
+ return ta_crypt_cmd_asymmetric_operate(c, s, oph,
+ TA_CRYPT_CMD_ASYMMETRIC_DECRYPT,
+ params, paramCount,
+ src, src_len, dst, dst_len);
+}
+
+static TEEC_Result ta_crypt_cmd_asymmetric_sign(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const TEE_Attribute *params,
+ uint32_t paramCount,
+ const void *digest,
+ size_t digest_len,
+ void *signature,
+ size_t *signature_len)
+{
+ return ta_crypt_cmd_asymmetric_operate(c, s, oph,
+ TA_CRYPT_CMD_ASYMMETRIC_SIGN_DIGEST, params, paramCount,
+ digest, digest_len, signature, signature_len);
+}
+
+static TEEC_Result ta_crypt_cmd_asymmetric_verify(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ const TEE_Attribute *params,
+ uint32_t paramCount,
+ const void *digest,
+ size_t digest_len,
+ const void *signature,
+ size_t signature_len)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ uint8_t *buf;
+ size_t blen;
+
+ res = pack_attrs(params, paramCount, &buf, &blen);
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, res))
+ return res;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.params[1].tmpref.buffer = buf;
+ op.params[1].tmpref.size = blen;
+
+ op.params[2].tmpref.buffer = (void *)digest;
+ op.params[2].tmpref.size = digest_len;
+
+ op.params[3].tmpref.buffer = (void *)signature;
+ op.params[3].tmpref.size = signature_len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_INPUT,
+ TEEC_MEMREF_TEMP_INPUT);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_ASYMMETRIC_VERIFY_DIGEST,
+ &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ free(buf);
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_get_object_value_attribute(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectHandle o,
+ uint32_t attr_id,
+ uint32_t *valuea,
+ uint32_t *valueb)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)o <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)o;
+ op.params[0].value.b = attr_id;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_VALUE_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_GET_OBJECT_VALUE_ATTRIBUTE,
+ &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS) {
+ *valuea = op.params[1].value.a;
+ *valueb = op.params[1].value.b;
+ }
+
+ return res;
+}
+
+static TEEC_Result ta_crypt_cmd_generate_key(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectHandle o,
+ uint32_t key_size,
+ const TEE_Attribute *params,
+ uint32_t paramCount)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ uint8_t *buf;
+ size_t blen;
+
+ res = pack_attrs(params, paramCount, &buf, &blen);
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, res))
+ return res;
+
+ assert((uintptr_t)o <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)o;
+ op.params[0].value.b = key_size;
+
+ op.params[1].tmpref.buffer = buf;
+ op.params[1].tmpref.size = blen;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_GENERATE_KEY, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ free(buf);
+ return res;
+}
+
+static const uint8_t hash_data_md5_in1[] = {
+ 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'
+};
+
+static const uint8_t hash_data_md5_out1[] = {
+ 0x61, 0x12, 0x71, 0x83, 0x70, 0x8d, 0x3a, 0xc7,
+ 0xf1, 0x9b, 0x66, 0x06, 0xfc, 0xae, 0x7d, 0xf6
+};
+
+static const uint8_t hash_data_sha1_in1[] = {
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'
+};
+
+static const uint8_t hash_data_sha1_out1[] = {
+ 0x4b, 0x98, 0x92, 0xb6, 0x52, 0x72, 0x14, 0xaf,
+ 0xc6, 0x55, 0xb8, 0xaa, 0x52, 0xf4, 0xd2, 0x03,
+ 0xc1, 0x5e, 0x7c, 0x9c
+};
+
+static const uint8_t hash_data_sha224_in1[] = {
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'
+};
+
+static const uint8_t hash_data_sha224_out1[] = {
+ 0x08, 0x21, 0x69, 0xf9, 0x77, 0x1b, 0x80, 0x15,
+ 0xf3, 0x97, 0xae, 0xde, 0x5b, 0xba, 0xa2, 0x72,
+ 0x2d, 0x8f, 0x5c, 0x19, 0xfe, 0xd2, 0xe2, 0x68,
+ 0x92, 0x49, 0xd8, 0x44
+};
+
+static const uint8_t hash_data_sha256_in1[] = { 'a', 'b', 'c' };
+
+static const uint8_t hash_data_sha256_out1[] = {
+ 0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
+ 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
+ 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
+ 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad
+};
+
+static const uint8_t hash_data_sha256_in2[] = { 'e', 'f', 'g' };
+
+static const uint8_t hash_data_sha256_out2[] = {
+ 0xd4, 0xff, 0xe8, 0xe9, 0xee, 0x0b, 0x48, 0xeb,
+ 0xa7, 0x16, 0x70, 0x61, 0x23, 0xa7, 0x18, 0x7f,
+ 0x32, 0xea, 0xe3, 0xbd, 0xcb, 0x0e, 0x77, 0x63,
+ 0xe4, 0x1e, 0x53, 0x32, 0x67, 0xbd, 0x8a, 0x53
+};
+
+
+static const uint8_t hash_data_sha384_in1[] = {
+ 'a', 'b', 'c', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'
+};
+
+static const uint8_t hash_data_sha384_out1[] = {
+ 0x4c, 0xab, 0x80, 0x9d, 0x96, 0x84, 0x01, 0x47,
+ 0x67, 0x0a, 0xc1, 0x7a, 0xb6, 0xb9, 0xf7, 0x6e,
+ 0x35, 0xa6, 0xb0, 0x8c, 0xf5, 0x2a, 0x3d, 0x64,
+ 0x9a, 0x8c, 0x7e, 0x0c, 0x55, 0x45, 0xd3, 0x7d,
+ 0x1f, 0x7f, 0x28, 0x34, 0x96, 0x14, 0x44, 0x2a,
+ 0xf5, 0x98, 0xa2, 0x95, 0x24, 0x76, 0x53, 0x97
+};
+
+static const uint8_t hash_data_sha512_in1[] = {
+ 'a', 'b', 'c', 'd', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'
+};
+
+static const uint8_t hash_data_sha512_out1[] = {
+ 0x20, 0xd8, 0x64, 0x4f, 0x54, 0xa2, 0x5f, 0x6f,
+ 0x0a, 0xf9, 0xd5, 0x27, 0x7d, 0x17, 0xa8, 0x99,
+ 0x4c, 0x64, 0x3f, 0xd0, 0xf3, 0x83, 0x36, 0xee,
+ 0x93, 0x12, 0x55, 0xcd, 0x2e, 0x12, 0x34, 0xa0,
+ 0xc2, 0xaa, 0xf9, 0xbb, 0x15, 0xc5, 0xe9, 0xfa,
+ 0xf7, 0xa7, 0xda, 0xb8, 0x2f, 0x72, 0xa0, 0x47,
+ 0xe3, 0x02, 0x04, 0xe8, 0xa0, 0x35, 0x0c, 0x96,
+ 0x26, 0xd1, 0xcb, 0x8b, 0x47, 0x45, 0x25, 0xd0
+};
+
+struct xtest_hash_case {
+ uint32_t algo;
+ size_t in_incr;
+ const uint8_t *in;
+ size_t in_len;
+ const uint8_t *out;
+ size_t out_len;
+};
+
+#define XTEST_HASH_CASE(algo, in_incr, in, out) \
+ { (algo), (in_incr), (in), ARRAY_SIZE(in), (out), ARRAY_SIZE(out) }
+
+static const struct xtest_hash_case hash_cases[] = {
+ XTEST_HASH_CASE(TEE_ALG_MD5, 6, hash_data_md5_in1,
+ hash_data_md5_out1),
+ XTEST_HASH_CASE(TEE_ALG_SHA1, 3, hash_data_sha1_in1,
+ hash_data_sha1_out1),
+ XTEST_HASH_CASE(TEE_ALG_SHA224, 7, hash_data_sha224_in1,
+ hash_data_sha224_out1),
+ XTEST_HASH_CASE(TEE_ALG_SHA256, 1, hash_data_sha256_in1,
+ hash_data_sha256_out1),
+ XTEST_HASH_CASE(TEE_ALG_SHA256, 1, hash_data_sha256_in2,
+ hash_data_sha256_out2),
+ XTEST_HASH_CASE(TEE_ALG_SHA384, 1, hash_data_sha384_in1,
+ hash_data_sha384_out1),
+ XTEST_HASH_CASE(TEE_ALG_SHA512, 1, hash_data_sha512_in1,
+ hash_data_sha512_out1),
+};
+
+static void xtest_tee_test_4001(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+ size_t n;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+
+ for (n = 0; n < ARRAY_SIZE(hash_cases); n++) {
+ TEE_OperationHandle op1;
+ TEE_OperationHandle op2;
+ uint8_t out[64];
+ size_t out_size;
+
+ Do_ADBG_BeginSubCase(c, "Hash case %d algo 0x%x",
+ (int)n, (unsigned int)hash_cases[n].algo);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session, &op1,
+ hash_cases[n].algo,
+ TEE_MODE_DIGEST, 0)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session, &op2,
+ hash_cases[n].algo,
+ TEE_MODE_DIGEST, 0)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_digest_update(c, &session, op1,
+ hash_cases[n].in,
+ hash_cases[n].in_incr)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_copy_operation(c, &session, op2, op1)))
+ goto out;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_digest_do_final(c, &session, op2,
+ hash_cases[n].in + hash_cases[n].in_incr,
+ hash_cases[n].in_len - hash_cases[n].in_incr,
+ out, &out_size)))
+ goto out;
+
+ (void)ADBG_EXPECT_BUFFER(c, hash_cases[n].out,
+ hash_cases[n].out_len, out, out_size);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_reset_operation(c, &session, op1)))
+ goto out;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_digest_do_final(c, &session, op1,
+ hash_cases[n].in,
+ hash_cases[n].in_len, out,
+ &out_size)))
+ goto out;
+
+ (void)ADBG_EXPECT_BUFFER(c, hash_cases[n].out,
+ hash_cases[n].out_len, out, out_size);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op1)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op2)))
+ goto out;
+
+ Do_ADBG_EndSubCase(c, NULL);
+ }
+
+out:
+ TEEC_CloseSession(&session);
+}
+
+static const uint8_t mac_data_md5_key1[10] = {
+ 0x6B, 0x65, 0x79, /* key */
+};
+
+static const uint8_t mac_data_md5_in1[] = {
+ 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, /* The quic */
+ 0x6B, 0x20, 0x62, 0x72, 0x6F, 0x77, 0x6E, 0x20, /* k brown */
+ 0x66, 0x6F, 0x78, 0x20, 0x6A, 0x75, 0x6D, 0x70, /* fox jump */
+ 0x73, 0x20, 0x6F, 0x76, 0x65, 0x72, 0x20, 0x74, /* s over t */
+ 0x68, 0x65, 0x20, 0x6C, 0x61, 0x7A, 0x79, 0x20, /* he lazy */
+ 0x64, 0x6F, 0x67, /* dog */
+};
+
+static const uint8_t mac_data_md5_out1[] = {
+ 0x80, 0x07, 0x07, 0x13, 0x46, 0x3e, 0x77, 0x49,
+ 0xb9, 0x0c, 0x2d, 0xc2, 0x49, 0x11, 0xe2, 0x75
+};
+
+
+/* generated with scripts/digest_hmac.pl */
+static const uint8_t mac_data_sha1_key1[10] = {
+ 0x6B, 0x65, 0x79, /* key */
+};
+
+static const uint8_t mac_data_sha1_in1[] = {
+ 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, /* The quic */
+ 0x6B, 0x20, 0x62, 0x72, 0x6F, 0x77, 0x6E, 0x20, /* k brown */
+ 0x66, 0x6F, 0x78, 0x20, 0x6A, 0x75, 0x6D, 0x70, /* fox jump */
+ 0x73, 0x20, 0x6F, 0x76, 0x65, 0x72, 0x20, 0x74, /* s over t */
+ 0x68, 0x65, 0x20, 0x6C, 0x61, 0x7A, 0x79, 0x20, /* he lazy */
+ 0x64, 0x6F, 0x67, /* dog */
+};
+
+static const uint8_t mac_data_sha1_out1[] = {
+ 0xDE, 0x7C, 0x9B, 0x85, 0xB8, 0xB7, 0x8A, 0xA6, /* .|...... */
+ 0xBC, 0x8A, 0x7A, 0x36, 0xF7, 0x0A, 0x90, 0x70, /* ..z6...p */
+ 0x1C, 0x9D, 0xB4, 0xD9, /* .... */
+};
+
+static const uint8_t mac_data_sha224_key1[24] = {
+ 0x6B, 0x65, 0x79, /* key */
+};
+
+static const uint8_t mac_data_sha224_in1[] = {
+ 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, /* The quic */
+ 0x6B, 0x20, 0x62, 0x72, 0x6F, 0x77, 0x6E, 0x20, /* k brown */
+ 0x66, 0x6F, 0x78, 0x20, 0x6A, 0x75, 0x6D, 0x70, /* fox jump */
+ 0x73, 0x20, 0x6F, 0x76, 0x65, 0x72, 0x20, 0x74, /* s over t */
+ 0x68, 0x65, 0x20, 0x6C, 0x61, 0x7A, 0x79, 0x20, /* he lazy */
+ 0x64, 0x6F, 0x67, /* dog */
+};
+
+static const uint8_t mac_data_sha224_out1[] = {
+ 0x88, 0xFF, 0x8B, 0x54, 0x67, 0x5D, 0x39, 0xB8, /* ...Tg]9. */
+ 0xF7, 0x23, 0x22, 0xE6, 0x5F, 0xF9, 0x45, 0xC5, /* .#"._.E. */
+ 0x2D, 0x96, 0x37, 0x99, 0x88, 0xAD, 0xA2, 0x56, /* -.7....V */
+ 0x39, 0x74, 0x7E, 0x69, /* 9t~i */
+};
+
+
+static const uint8_t mac_data_sha256_key1[24] = {
+ 'Q', 'W', 'E', 'R', 'T', 'Y'
+};
+
+static const uint8_t mac_data_sha256_in1[] = { 'a', 'b', 'c' };
+
+static const uint8_t mac_data_sha256_out1[] = {
+ 0xee, 0x2e, 0x5d, 0x9b, 0x51, 0xe2, 0x9c, 0x1d,
+ 0x49, 0xe9, 0xae, 0x6f, 0x0a, 0xcc, 0x15, 0x18,
+ 0xde, 0x1e, 0xa3, 0x88, 0x8e, 0xee, 0x48, 0xbb,
+ 0x82, 0x77, 0xe9, 0x09, 0x74, 0x4b, 0xa2, 0xf2
+};
+
+/* generated with scripts/digest_hmac.pl */
+static const uint8_t mac_data_sha256_key2[24] = {
+ 0x6B, 0x65, 0x79, /* key */
+};
+
+static const uint8_t mac_data_sha256_in2[] = {
+ 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, /* The quic */
+ 0x6B, 0x20, 0x62, 0x72, 0x6F, 0x77, 0x6E, 0x20, /* k brown */
+ 0x66, 0x6F, 0x78, 0x20, 0x6A, 0x75, 0x6D, 0x70, /* fox jump */
+ 0x73, 0x20, 0x6F, 0x76, 0x65, 0x72, 0x20, 0x74, /* s over t */
+ 0x68, 0x65, 0x20, 0x6C, 0x61, 0x7A, 0x79, 0x20, /* he lazy */
+ 0x64, 0x6F, 0x67, /* dog */
+};
+
+static const uint8_t mac_data_sha256_out2[] = {
+ 0xF7, 0xBC, 0x83, 0xF4, 0x30, 0x53, 0x84, 0x24, /* ....0S.$ */
+ 0xB1, 0x32, 0x98, 0xE6, 0xAA, 0x6F, 0xB1, 0x43, /* .2...o.C */
+ 0xEF, 0x4D, 0x59, 0xA1, 0x49, 0x46, 0x17, 0x59, /* .MY.IF.Y */
+ 0x97, 0x47, 0x9D, 0xBC, 0x2D, 0x1A, 0x3C, 0xD8, /* .G..-.<. */
+};
+
+static const uint8_t mac_data_sha384_key1[32] = {
+ 0x6B, 0x65, 0x79, /* key */
+};
+
+static const uint8_t mac_data_sha384_in1[] = {
+ 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, /* The quic */
+ 0x6B, 0x20, 0x62, 0x72, 0x6F, 0x77, 0x6E, 0x20, /* k brown */
+ 0x66, 0x6F, 0x78, 0x20, 0x6A, 0x75, 0x6D, 0x70, /* fox jump */
+ 0x73, 0x20, 0x6F, 0x76, 0x65, 0x72, 0x20, 0x74, /* s over t */
+ 0x68, 0x65, 0x20, 0x6C, 0x61, 0x7A, 0x79, 0x20, /* he lazy */
+ 0x64, 0x6F, 0x67, /* dog */
+};
+
+static const uint8_t mac_data_sha384_out1[] = {
+ 0xD7, 0xF4, 0x72, 0x7E, 0x2C, 0x0B, 0x39, 0xAE, /* ..r~, .9. */
+ 0x0F, 0x1E, 0x40, 0xCC, 0x96, 0xF6, 0x02, 0x42, /* ..@....B */
+ 0xD5, 0xB7, 0x80, 0x18, 0x41, 0xCE, 0xA6, 0xFC, /* ....A... */
+ 0x59, 0x2C, 0x5D, 0x3E, 0x1A, 0xE5, 0x07, 0x00, /* Y, ]>.... */
+ 0x58, 0x2A, 0x96, 0xCF, 0x35, 0xE1, 0xE5, 0x54, /* X...5..T */
+ 0x99, 0x5F, 0xE4, 0xE0, 0x33, 0x81, 0xC2, 0x37, /* ._..3..7 */
+};
+
+static const uint8_t mac_data_sha512_key1[32] = {
+ 0x6B, 0x65, 0x79, /* key */
+};
+
+static const uint8_t mac_data_sha512_in1[] = {
+ 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, /* The quic */
+ 0x6B, 0x20, 0x62, 0x72, 0x6F, 0x77, 0x6E, 0x20, /* k brown */
+ 0x66, 0x6F, 0x78, 0x20, 0x6A, 0x75, 0x6D, 0x70, /* fox jump */
+ 0x73, 0x20, 0x6F, 0x76, 0x65, 0x72, 0x20, 0x74, /* s over t */
+ 0x68, 0x65, 0x20, 0x6C, 0x61, 0x7A, 0x79, 0x20, /* he lazy */
+ 0x64, 0x6F, 0x67, /* dog */
+};
+
+static const uint8_t mac_data_sha512_out1[] = {
+ 0xB4, 0x2A, 0xF0, 0x90, 0x57, 0xBA, 0xC1, 0xE2, /* ....W... */
+ 0xD4, 0x17, 0x08, 0xE4, 0x8A, 0x90, 0x2E, 0x09, /* ........ */
+ 0xB5, 0xFF, 0x7F, 0x12, 0xAB, 0x42, 0x8A, 0x4F, /* .....B.O */
+ 0xE8, 0x66, 0x53, 0xC7, 0x3D, 0xD2, 0x48, 0xFB, /* .fS.=.H. */
+ 0x82, 0xF9, 0x48, 0xA5, 0x49, 0xF7, 0xB7, 0x91, /* ..H.I... */
+ 0xA5, 0xB4, 0x19, 0x15, 0xEE, 0x4D, 0x1E, 0xC3, /* .....M.. */
+ 0x93, 0x53, 0x57, 0xE4, 0xE2, 0x31, 0x72, 0x50, /* .SW..1rP */
+ 0xD0, 0x37, 0x2A, 0xFA, 0x2E, 0xBE, 0xEB, 0x3A, /* .7.....: */
+};
+
+
+/* AES-CBC-MAC */
+static const uint8_t mac_cbc_vect1_key[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+};
+
+static const uint8_t mac_cbc_vect1_data[] = {
+ 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x20, 0x62, /* Cipher b */
+ 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x63, 0x68, 0x61, /* lock cha */
+ 0x69, 0x6E, 0x69, 0x6E, 0x67, 0x20, 0x28, 0x43, /* ining (C */
+ 0x42, 0x43, 0x29, 0x20, 0x69, 0x73, 0x20, 0x61, /* BC) is a */
+ 0x20, 0x63, 0x6F, 0x6D, 0x6D, 0x6F, 0x6E, 0x20, /* common */
+ 0x63, 0x68, 0x61, 0x69, 0x6E, 0x69, 0x6E, 0x67, /* chaining */
+ 0x20, 0x6D, 0x6F, 0x64, 0x65, 0x20, 0x69, 0x6E, /* mode in */
+ 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, /* which t */
+ 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, /* he previ */
+ 0x6F, 0x75, 0x73, 0x20, 0x62, 0x6C, 0x6F, 0x63, /* ous bloc */
+ 0x6B, 0x27, 0x73, 0x20, 0x63, 0x69, 0x70, 0x68, /* k's ciph */
+ 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x20, 0x69, /* ertext i */
+ 0x73, 0x20, 0x78, 0x6F, 0x72, 0x65, 0x64, 0x20, /* s xored */
+ 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, /* with the */
+ 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6E, 0x74, /* current */
+ 0x20, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x27, 0x73, /* block's */
+ 0x20, 0x70, 0x6C, 0x61, 0x69, 0x6E, 0x74, 0x65, /* plainte */
+ 0x78, 0x74, 0x20, 0x62, 0x65, 0x66, 0x6F, 0x72, /* xt befor */
+ 0x65, 0x20, 0x65, 0x6E, 0x63, 0x72, 0x79, 0x70, /* e encryp */
+ 0x74, 0x69, 0x6F, 0x6E, 0x2E, 0x2E, 0x2E, 0x2E, /* tion.... */
+};
+
+static const uint8_t mac_cbc_vect1_out[] = {
+ 0xC9, 0x6E, 0x83, 0x7E, 0x35, 0xC8, 0xA7, 0xA0, /* .n.~5... */
+ 0x33, 0xA3, 0xB1, 0x4B, 0x5A, 0x92, 0x51, 0x2E, /* 3..KZ.Q. */
+};
+
+/* DES-CBC-MAC */
+static const uint8_t mac_cbc_vect2_key[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+};
+
+#define mac_cbc_vect2_data mac_cbc_vect1_data
+static const uint8_t mac_cbc_vect2_out[] = {
+ 0xE9, 0x41, 0x46, 0x30, 0x69, 0x32, 0xBD, 0xD6, /* .AF0i2.. */
+};
+
+/* DES3-CBC-MAC */
+static const uint8_t mac_cbc_vect3_key[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, /* 12345678 */
+};
+
+#define mac_cbc_vect3_data mac_cbc_vect2_data
+static const uint8_t mac_cbc_vect3_out[] = {
+ 0x1C, 0x17, 0xB7, 0xB5, 0x9F, 0x54, 0x9C, 0x63, /* .....T.c */
+};
+
+/* AES-CBC-MAC PKCS#5 pad*/
+static const uint8_t mac_cbc_vect4_key[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+};
+
+#define mac_cbc_vect4_data mac_cbc_vect1_data
+static const uint8_t mac_cbc_vect4_out[] = {
+ 0x0B, 0x46, 0xC7, 0xA2, 0xE1, 0x5A, 0xE2, 0x23, /* .F...Z.# */
+ 0x83, 0x34, 0x1C, 0x86, 0x53, 0xF8, 0x51, 0x24, /* .4..S.Q$ */
+};
+
+/* DES-CBC-MAC PKCS#5 pad*/
+static const uint8_t mac_cbc_vect5_key[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+};
+
+#define mac_cbc_vect5_data mac_cbc_vect1_data
+static const uint8_t mac_cbc_vect5_out[] = {
+ 0x30, 0x81, 0x4F, 0x42, 0x03, 0x7E, 0xD8, 0xA9, /* 0.OB.~.. */
+};
+
+/* DES3-CBC-MAC PKCS#5 pad*/
+static const uint8_t mac_cbc_vect6_key[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, /* 12345678 */
+};
+
+#define mac_cbc_vect6_data mac_cbc_vect1_data
+static const uint8_t mac_cbc_vect6_out[] = {
+ 0x6E, 0x37, 0x6E, 0x14, 0x5E, 0x21, 0xDD, 0xF8, /* n7n.^!.. */
+};
+
+/* AES-CBC-MAC PKCS#5 pad*/
+#define mac_cbc_vect7_key mac_cbc_vect4_key
+static const uint8_t mac_cbc_vect7_data[] = {
+ 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x20, 0x62, /* Cipher b */
+ 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x63, 0x68, 0x61, /* lock cha */
+ 0x69, 0x6E, 0x69, 0x6E, 0x67, 0x20, 0x28, 0x43, /* ining (C */
+ 0x42, 0x43, 0x29, 0x20, 0x69, 0x73, 0x20, 0x61, /* BC) is a */
+ 0x20, 0x63, 0x6F, 0x6D, 0x6D, 0x6F, 0x6E, 0x20, /* common */
+ 0x63, 0x68, 0x61, 0x69, 0x6E, 0x69, 0x6E, 0x67, /* chaining */
+ 0x20, 0x6D, 0x6F, 0x64, 0x65, 0x20, 0x69, 0x6E, /* mode in */
+ 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, /* which t */
+ 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, /* he previ */
+ 0x6F, 0x75, 0x73, 0x20, 0x62, 0x6C, 0x6F, 0x63, /* ous bloc */
+ 0x6B, 0x27, 0x73, 0x20, 0x63, 0x69, 0x70, 0x68, /* k's ciph */
+ 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x20, 0x69, /* ertext i */
+ 0x73, 0x20, 0x78, 0x6F, 0x72, 0x65, 0x64, 0x20, /* s xored */
+ 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, /* with the */
+ 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6E, 0x74, /* current */
+ 0x20, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x27, 0x73, /* block's */
+ 0x20, 0x70, 0x6C, 0x61, 0x69, 0x6E, 0x74, 0x65, /* plainte */
+ 0x78, 0x74, 0x20, 0x62, 0x65, 0x66, 0x6F, 0x72, /* xt befor */
+ 0x65, 0x20, 0x65, 0x6E, 0x63, 0x72, 0x79, 0x70, /* e encryp */
+ 0x74, 0x69, 0x6F, 0x6E, 0x2E, /* tion. */
+};
+
+static const uint8_t mac_cbc_vect7_out[] = {
+ 0xFD, 0x89, 0x35, 0xB3, 0x93, 0x7F, 0xBB, 0xA2, /* ..5..... */
+ 0xFB, 0x65, 0x60, 0xC4, 0x0A, 0x62, 0xA0, 0xF9, /* .e`..b.. */
+};
+
+/* DES-CBC-MAC PKCS#5 pad*/
+#define mac_cbc_vect8_key mac_cbc_vect5_key
+#define mac_cbc_vect8_data mac_cbc_vect7_data
+static const uint8_t mac_cbc_vect8_out[] = {
+ 0x02, 0x2A, 0xA8, 0x2E, 0x47, 0xC6, 0xBB, 0x7C, /* ....G..| */
+};
+
+/* DES3-CBC-MAC PKCS#5 pad*/
+#define mac_cbc_vect9_key mac_cbc_vect6_key
+#define mac_cbc_vect9_data mac_cbc_vect7_data
+static const uint8_t mac_cbc_vect9_out[] = {
+ 0xD4, 0xF7, 0x3E, 0x27, 0x78, 0x0E, 0x1C, 0x79, /* ..>'x..y */
+};
+
+/*
+ * AES-CMAC
+ * Test vectors from
+ * http://csrc.nist.gov/publications/nistpubs/800-38B/SP_800-38B.pdf
+ */
+
+/* AES-128 */
+static const uint8_t mac_cmac_vect1_key[] = {
+ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
+ 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c
+};
+
+static const uint8_t mac_cmac_vect1_out[] = {
+ 0xbb, 0x1d, 0x69, 0x29, 0xe9, 0x59, 0x37, 0x28,
+ 0x7f, 0xa3, 0x7d, 0x12, 0x9b, 0x75, 0x67, 0x46
+};
+
+#define mac_cmac_vect2_key mac_cmac_vect1_key
+static const uint8_t mac_cmac_vect2_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a
+};
+
+static const uint8_t mac_cmac_vect2_out[] = {
+ 0x07, 0x0a, 0x16, 0xb4, 0x6b, 0x4d, 0x41, 0x44,
+ 0xf7, 0x9b, 0xdd, 0x9d, 0xd0, 0x4a, 0x28, 0x7c
+};
+
+#define mac_cmac_vect3_key mac_cmac_vect1_key
+static const uint8_t mac_cmac_vect3_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
+ 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
+ 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
+ 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11
+};
+
+static const uint8_t mac_cmac_vect3_out[] = {
+ 0xdf, 0xa6, 0x67, 0x47, 0xde, 0x9a, 0xe6, 0x30,
+ 0x30, 0xca, 0x32, 0x61, 0x14, 0x97, 0xc8, 0x27
+};
+
+#define mac_cmac_vect4_key mac_cmac_vect1_key
+static const uint8_t mac_cmac_vect4_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
+ 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
+ 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
+ 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
+ 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
+ 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
+ 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10
+};
+
+static const uint8_t mac_cmac_vect4_out[] = {
+ 0x51, 0xf0, 0xbe, 0xbf, 0x7e, 0x3b, 0x9d, 0x92,
+ 0xfc, 0x49, 0x74, 0x17, 0x79, 0x36, 0x3c, 0xfe
+};
+
+/* AES-192 */
+static const uint8_t mac_cmac_vect5_key[] = {
+ 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52,
+ 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5,
+ 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b
+};
+
+static const uint8_t mac_cmac_vect5_out[] = {
+ 0xd1, 0x7d, 0xdf, 0x46, 0xad, 0xaa, 0xcd, 0xe5,
+ 0x31, 0xca, 0xc4, 0x83, 0xde, 0x7a, 0x93, 0x67
+};
+
+
+#define mac_cmac_vect6_key mac_cmac_vect5_key
+static const uint8_t mac_cmac_vect6_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a
+};
+
+static const uint8_t mac_cmac_vect6_out[] = {
+ 0x9e, 0x99, 0xa7, 0xbf, 0x31, 0xe7, 0x10, 0x90,
+ 0x06, 0x62, 0xf6, 0x5e, 0x61, 0x7c, 0x51, 0x84
+};
+
+#define mac_cmac_vect7_key mac_cmac_vect5_key
+static const uint8_t mac_cmac_vect7_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
+ 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
+ 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
+ 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11
+};
+
+static const uint8_t mac_cmac_vect7_out[] = {
+ 0x8a, 0x1d, 0xe5, 0xbe, 0x2e, 0xb3, 0x1a, 0xad,
+ 0x08, 0x9a, 0x82, 0xe6, 0xee, 0x90, 0x8b, 0x0e
+};
+
+#define mac_cmac_vect8_key mac_cmac_vect5_key
+static const uint8_t mac_cmac_vect8_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
+ 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
+ 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
+ 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
+ 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
+ 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
+ 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10
+};
+
+static const uint8_t mac_cmac_vect8_out[] = {
+ 0xa1, 0xd5, 0xdf, 0x0e, 0xed, 0x79, 0x0f, 0x79,
+ 0x4d, 0x77, 0x58, 0x96, 0x59, 0xf3, 0x9a, 0x11
+};
+
+/* AES-256 */
+static const uint8_t mac_cmac_vect9_key[] = {
+ 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
+ 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
+ 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
+ 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4
+};
+
+static const uint8_t mac_cmac_vect9_out[] = {
+ 0x02, 0x89, 0x62, 0xf6, 0x1b, 0x7b, 0xf8, 0x9e,
+ 0xfc, 0x6b, 0x55, 0x1f, 0x46, 0x67, 0xd9, 0x83
+};
+
+#define mac_cmac_vect10_key mac_cmac_vect9_key
+static const uint8_t mac_cmac_vect10_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a
+};
+
+static const uint8_t mac_cmac_vect10_out[] = {
+ 0x28, 0xa7, 0x02, 0x3f, 0x45, 0x2e, 0x8f, 0x82,
+ 0xbd, 0x4b, 0xf2, 0x8d, 0x8c, 0x37, 0xc3, 0x5c
+};
+
+#define mac_cmac_vect11_key mac_cmac_vect9_key
+static const uint8_t mac_cmac_vect11_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
+ 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
+ 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
+ 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11
+};
+
+static const uint8_t mac_cmac_vect11_out[] = {
+ 0xaa, 0xf3, 0xd8, 0xf1, 0xde, 0x56, 0x40, 0xc2,
+ 0x32, 0xf5, 0xb1, 0x69, 0xb9, 0xc9, 0x11, 0xe6
+};
+
+#define mac_cmac_vect12_key mac_cmac_vect9_key
+static const uint8_t mac_cmac_vect12_data[] = {
+ 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
+ 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
+ 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
+ 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
+ 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
+ 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
+ 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
+ 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10
+};
+
+static const uint8_t mac_cmac_vect12_out[] = {
+ 0xe1, 0x99, 0x21, 0x90, 0x54, 0x9f, 0x6e, 0xd5,
+ 0x69, 0x6a, 0x2c, 0x05, 0x6c, 0x31, 0x54, 0x10
+};
+
+struct xtest_mac_case {
+ uint32_t algo;
+ uint32_t key_type;
+ const uint8_t *key;
+ size_t key_len;
+ size_t in_incr;
+ const uint8_t *in;
+ size_t in_len;
+ const uint8_t *out;
+ size_t out_len;
+};
+
+#define XTEST_MAC_CASE(algo, key_type, key, in_incr, in, out) \
+ { (algo), (key_type), (key), ARRAY_SIZE(key), \
+ (in_incr), (in), ARRAY_SIZE(in), (out), ARRAY_SIZE(out) }
+
+#define XTEST_MAC_CBC_CASE(algo, key_type, vect, in_incr) \
+ XTEST_MAC_CASE((algo), (key_type), \
+ mac_cbc_ ## vect ## _key, (in_incr), \
+ mac_cbc_ ## vect ## _data, mac_cbc_ ## vect ## _out)
+
+#define XTEST_MAC_CMAC_CASE(vect, in_incr) \
+ XTEST_MAC_CASE(TEE_ALG_AES_CMAC, TEE_TYPE_AES, \
+ mac_cmac_ ## vect ## _key, (in_incr), \
+ mac_cmac_ ## vect ## _data, mac_cmac_ ## vect ## _out)
+
+static const struct xtest_mac_case mac_cases[] = {
+ XTEST_MAC_CASE(TEE_ALG_HMAC_MD5, TEE_TYPE_HMAC_MD5,
+ mac_data_md5_key1,
+ 4, mac_data_md5_in1, mac_data_md5_out1),
+ XTEST_MAC_CASE(TEE_ALG_HMAC_SHA1, TEE_TYPE_HMAC_SHA1,
+ mac_data_sha1_key1,
+ 5, mac_data_sha1_in1, mac_data_sha1_out1),
+ XTEST_MAC_CASE(TEE_ALG_HMAC_SHA224, TEE_TYPE_HMAC_SHA224,
+ mac_data_sha224_key1,
+ 8, mac_data_sha224_in1, mac_data_sha224_out1),
+ XTEST_MAC_CASE(TEE_ALG_HMAC_SHA256, TEE_TYPE_HMAC_SHA256,
+ mac_data_sha256_key1,
+ 1, mac_data_sha256_in1, mac_data_sha256_out1),
+ XTEST_MAC_CASE(TEE_ALG_HMAC_SHA256, TEE_TYPE_HMAC_SHA256,
+ mac_data_sha256_key2,
+ 7, mac_data_sha256_in2, mac_data_sha256_out2),
+ XTEST_MAC_CASE(TEE_ALG_HMAC_SHA384, TEE_TYPE_HMAC_SHA384,
+ mac_data_sha384_key1,
+ 11, mac_data_sha384_in1, mac_data_sha384_out1),
+ XTEST_MAC_CASE(TEE_ALG_HMAC_SHA512, TEE_TYPE_HMAC_SHA512,
+ mac_data_sha512_key1,
+ 13, mac_data_sha512_in1, mac_data_sha512_out1),
+
+ XTEST_MAC_CBC_CASE(TEE_ALG_AES_CBC_MAC_NOPAD, TEE_TYPE_AES, vect1, 14),
+ XTEST_MAC_CBC_CASE(TEE_ALG_DES_CBC_MAC_NOPAD, TEE_TYPE_DES, vect2, 16),
+ XTEST_MAC_CBC_CASE(TEE_ALG_DES3_CBC_MAC_NOPAD, TEE_TYPE_DES3, vect3,
+ 17),
+ XTEST_MAC_CBC_CASE(TEE_ALG_AES_CBC_MAC_PKCS5, TEE_TYPE_AES, vect4, 11),
+ XTEST_MAC_CBC_CASE(TEE_ALG_DES_CBC_MAC_PKCS5, TEE_TYPE_DES, vect5, 9),
+ XTEST_MAC_CBC_CASE(TEE_ALG_DES3_CBC_MAC_PKCS5, TEE_TYPE_DES3, vect6, 4),
+ XTEST_MAC_CBC_CASE(TEE_ALG_AES_CBC_MAC_PKCS5, TEE_TYPE_AES, vect7, 3),
+ XTEST_MAC_CBC_CASE(TEE_ALG_DES_CBC_MAC_PKCS5, TEE_TYPE_DES, vect8, 23),
+ XTEST_MAC_CBC_CASE(TEE_ALG_DES3_CBC_MAC_PKCS5, TEE_TYPE_DES3, vect9,
+ 34),
+
+ { TEE_ALG_AES_CMAC, TEE_TYPE_AES, mac_cmac_vect1_key,
+ ARRAY_SIZE(mac_cmac_vect1_key), 0, NULL, 0, mac_cmac_vect1_out,
+ ARRAY_SIZE(mac_cmac_vect1_out) },
+ XTEST_MAC_CMAC_CASE(vect2, 9),
+ XTEST_MAC_CMAC_CASE(vect3, 9),
+ XTEST_MAC_CMAC_CASE(vect4, 9),
+ { TEE_ALG_AES_CMAC, TEE_TYPE_AES, mac_cmac_vect5_key,
+ ARRAY_SIZE(mac_cmac_vect5_key), 0, NULL, 0, mac_cmac_vect5_out,
+ ARRAY_SIZE(mac_cmac_vect5_out) },
+ XTEST_MAC_CMAC_CASE(vect6, 9),
+ XTEST_MAC_CMAC_CASE(vect7, 9),
+ XTEST_MAC_CMAC_CASE(vect8, 9),
+ { TEE_ALG_AES_CMAC, TEE_TYPE_AES, mac_cmac_vect9_key,
+ ARRAY_SIZE(mac_cmac_vect9_key), 0, NULL, 0, mac_cmac_vect9_out,
+ ARRAY_SIZE(mac_cmac_vect9_out) },
+ XTEST_MAC_CMAC_CASE(vect10, 9),
+ XTEST_MAC_CMAC_CASE(vect11, 9),
+ XTEST_MAC_CMAC_CASE(vect12, 9),
+};
+
+static void xtest_tee_test_4002(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ TEE_OperationHandle op1;
+ TEE_OperationHandle op2;
+ TEE_ObjectHandle key_handle;
+ uint8_t out[64];
+ size_t out_size;
+ uint32_t ret_orig;
+ size_t n;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ for (n = 0; n < ARRAY_SIZE(mac_cases); n++) {
+ TEE_Attribute key_attr;
+ size_t key_size;
+
+ Do_ADBG_BeginSubCase(c, "MAC case %d algo 0x%x",
+ (int)n, (unsigned int)mac_cases[n].algo);
+
+ key_attr.attributeID = TEE_ATTR_SECRET_VALUE;
+ key_attr.content.ref.buffer = (void *)mac_cases[n].key;
+ key_attr.content.ref.length = mac_cases[n].key_len;
+
+ key_size = key_attr.content.ref.length * 8;
+ if (mac_cases[n].key_type == TEE_TYPE_DES ||
+ mac_cases[n].key_type == TEE_TYPE_DES3)
+ /* Exclude parity in bit size of key */
+ key_size -= key_size / 8;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session, &op1,
+ mac_cases[n].algo, TEE_MODE_MAC, key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session, &op2,
+ mac_cases[n].algo, TEE_MODE_MAC, key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, &session,
+ mac_cases[n].key_type, key_size, &key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, &session,
+ key_handle, &key_attr, 1)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op1,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_mac_init(c, &session, op1, NULL, 0)))
+ goto out;
+
+ if (mac_cases[n].in != NULL) {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_mac_update(c, &session, op1,
+ mac_cases[n].in, mac_cases[n].in_incr)))
+ goto out;
+ }
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_copy_operation(c, &session, op2, op1)))
+ goto out;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_mac_final_compute(c, &session, op2,
+ mac_cases[n].in + mac_cases[n].in_incr,
+ mac_cases [n].in_len - mac_cases[n].in_incr,
+ out, &out_size)))
+ goto out;
+
+ (void)ADBG_EXPECT_BUFFER(c, mac_cases[n].out,
+ mac_cases[n].out_len, out, out_size);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_mac_init(c, &session, op1, NULL, 0)))
+ goto out;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_mac_final_compute(c, &session, op1,
+ mac_cases[n].in, mac_cases[n].in_len, out,
+ &out_size)))
+ goto out;
+
+ (void)ADBG_EXPECT_BUFFER(c, mac_cases[n].out,
+ mac_cases[n].out_len, out, out_size);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op1)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op2)))
+ goto out;
+
+ Do_ADBG_EndSubCase(c, NULL);
+ }
+out:
+ TEEC_CloseSession(&session);
+}
+
+/* generated with scripts/crypt_aes_cbc_nopad.pl */
+static const uint8_t ciph_data_aes_key1[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+};
+
+static const uint8_t ciph_data_des_key1[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37 /* 01234567 */
+};
+
+static const uint8_t ciph_data_des_key2[] = {
+ 0x13, 0x34, 0x57, 0x79, 0x9B, 0xBC, 0xDF, 0xF1
+};
+
+
+static const uint8_t ciph_data_des3_key1[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, /* 12345678 */
+};
+
+static const uint8_t ciph_data_des3_key2[] = {
+ 0x13, 0x34, 0x57, 0x79, 0x9B, 0xBC, 0xDF, 0xF1,
+ 0x13, 0x34, 0x57, 0x79, 0x9B, 0xBC, 0xDF, 0xF1,
+ 0x13, 0x34, 0x57, 0x79, 0x9B, 0xBC, 0xDF, 0xF1
+};
+
+static const uint8_t ciph_data_des2_key1[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+};
+
+static const uint8_t ciph_data_in1[] = {
+ 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, /* 23456789 */
+ 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x30, 0x31, /* ABCDEF01 */
+ 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, /* 3456789A */
+ 0x42, 0x43, 0x44, 0x45, 0x46, 0x30, 0x31, 0x32, /* BCDEF012 */
+ 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, /* 456789AB */
+ 0x43, 0x44, 0x45, 0x46, 0x30, 0x31, 0x32, 0x33, /* CDEF0123 */
+};
+
+static const uint8_t ciph_data_in3[] = {
+ 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, /* 23456789 */
+ 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x30, 0x31, /* ABCDEF01 */
+ 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, /* 3456789A */
+ 0x42, 0x43, 0x44, 0x45, 0x46, 0x30, 0x31, 0x32, /* BCDEF012 */
+ 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, /* 456789AB */
+ 0x43, 0x44, 0x45, 0x46, 0x30, /* CDEF0 */
+};
+
+static const uint8_t ciph_data_128_iv1[] = {
+ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, /* 12345678 */
+ 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x30, /* 9ABCDEF0 */
+};
+
+static const uint8_t ciph_data_64_iv1[] = {
+ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, /* 12345678 */
+};
+
+static const uint8_t ciph_data_in2[] = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef
+};
+
+static const uint8_t ciph_data_aes_ecb_nopad_out1[] = {
+ 0xA5, 0xBE, 0x14, 0xD5, 0x01, 0x05, 0x24, 0x48, /* ......$H */
+ 0x58, 0x1A, 0x6B, 0x82, 0xD4, 0x41, 0xD2, 0xB3, /* X.k..A.. */
+ 0xBB, 0xF9, 0xAE, 0x37, 0x94, 0xAC, 0x18, 0x50, /* ...7...P */
+ 0x87, 0x09, 0xCC, 0x3F, 0x43, 0xD2, 0xC2, 0xB7, /* ...?C... */
+ 0xD7, 0x6F, 0x84, 0x07, 0xB4, 0x78, 0xCE, 0x34, /* .o...x.4 */
+ 0x48, 0xC9, 0x16, 0x86, 0x42, 0xB8, 0xFF, 0xCF, /* H...B... */
+};
+
+static const uint8_t ciph_data_aes_cbc_nopad_out1[] = {
+ 0x8D, 0x9F, 0x88, 0xD8, 0xAF, 0x9F, 0xC1, 0x3B, /* .......; */
+ 0x02, 0x15, 0x43, 0x6A, 0x8C, 0x1E, 0x34, 0x5C, /* ..Cj..4\ */
+ 0x83, 0xF4, 0x85, 0x3E, 0x43, 0x0F, 0xE5, 0x5F, /* ...>C.._ */
+ 0x81, 0x4C, 0xC0, 0x28, 0x3F, 0xD9, 0x98, 0x53, /* .L.(?..S */
+ 0xB1, 0x44, 0x51, 0x38, 0x21, 0xAB, 0x10, 0xCE, /* .DQ8!... */
+ 0xC2, 0xEC, 0x65, 0x54, 0xDD, 0x5C, 0xEA, 0xDC, /* ..eT.\.. */
+};
+
+static const uint8_t ciph_data_aes_ctr_out1[] = {
+ 0xD2, 0xDD, 0x11, 0xA8, 0xF7, 0xB0, 0xAE, 0x55, /* .......U */
+ 0xBE, 0x61, 0x7A, 0xE6, 0xA1, 0x6C, 0x79, 0xF4, /* .az..ly. */
+ 0x62, 0x51, 0x7B, 0xE9, 0x7C, 0xA0, 0x31, 0x0C, /* bQ{.|.1. */
+ 0x24, 0x15, 0x70, 0x7F, 0x47, 0x37, 0x69, 0xE0, /* $.p.G7i. */
+ 0x24, 0xC3, 0x29, 0xCD, 0xF2, 0x26, 0x69, 0xFF, /* $.)..&i. */
+ 0x72, 0x0E, 0x3C, 0xD1, 0xA1, 0x2F, 0x5D, 0x33, /* r.<../]3 */
+};
+
+static const uint8_t ciph_data_aes_ctr_out2[] = {
+ 0xD2, 0xDD, 0x11, 0xA8, 0xF7, 0xB0, 0xAE, 0x55, /* .......U */
+ 0xBE, 0x61, 0x7A, 0xE6, 0xA1, 0x6C, 0x79, 0xF4, /* .az..ly. */
+ 0x62, 0x51, 0x7B, 0xE9, 0x7C, 0xA0, 0x31, 0x0C, /* bQ{.|.1. */
+ 0x24, 0x15, 0x70, 0x7F, 0x47, 0x37, 0x69, 0xE0, /* $.p.G7i. */
+ 0x24, 0xC3, 0x29, 0xCD, 0xF2, 0x26, 0x69, 0xFF, /* $.)..&i. */
+ 0x72, 0x0E, 0x3C, 0xD1, 0xA1, /* r.<.. */
+};
+
+static const uint8_t ciph_data_aes_cbc_vect1_key[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
+ 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
+};
+
+static const uint8_t ciph_data_aes_cbc_vect1_iv[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
+};
+
+static const uint8_t ciph_data_aes_cbc_vect1_ptx[] = {
+ 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x20, 0x62, /* Cipher b */
+ 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x63, 0x68, 0x61, /* lock cha */
+ 0x69, 0x6E, 0x69, 0x6E, 0x67, 0x20, 0x28, 0x43, /* ining (C */
+ 0x42, 0x43, 0x29, 0x20, 0x69, 0x73, 0x20, 0x61, /* BC) is a */
+ 0x20, 0x63, 0x6F, 0x6D, 0x6D, 0x6F, 0x6E, 0x20, /* common */
+ 0x63, 0x68, 0x61, 0x69, 0x6E, 0x69, 0x6E, 0x67, /* chaining */
+ 0x20, 0x6D, 0x6F, 0x64, 0x65, 0x20, 0x69, 0x6E, /* mode in */
+ 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, /* which t */
+ 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, /* he previ */
+ 0x6F, 0x75, 0x73, 0x20, 0x62, 0x6C, 0x6F, 0x63, /* ous bloc */
+ 0x6B, 0x27, 0x73, 0x20, 0x63, 0x69, 0x70, 0x68, /* k's ciph */
+ 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x20, 0x69, /* ertext i */
+ 0x73, 0x20, 0x78, 0x6F, 0x72, 0x65, 0x64, 0x20, /* s xored */
+ 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, /* with the */
+ 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6E, 0x74, /* current */
+ 0x20, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x27, 0x73, /* block's */
+ 0x20, 0x70, 0x6C, 0x61, 0x69, 0x6E, 0x74, 0x65, /* plainte */
+ 0x78, 0x74, 0x20, 0x62, 0x65, 0x66, 0x6F, 0x72, /* xt befor */
+ 0x65, 0x20, 0x65, 0x6E, 0x63, 0x72, 0x79, 0x70, /* e encryp */
+ 0x74, 0x69, 0x6F, 0x6E, 0x2E, 0x2E, 0x2E, 0x2E, /* tion.... */
+};
+
+static const uint8_t ciph_data_aes_cbc_vect1_ctx[] = {
+ 0xDD, 0x16, 0xC3, 0x47, 0x69, 0xEC, 0xF5, 0x86, /* ...Gi... */
+ 0x20, 0xB4, 0xF7, 0xE3, 0xB9, 0x36, 0xE8, 0xAC, /* ....6.. */
+ 0xC9, 0xA2, 0x11, 0x71, 0x3B, 0x10, 0x9D, 0x45, /* ...q;..E */
+ 0xCA, 0xE2, 0x49, 0xA6, 0x4E, 0x56, 0x07, 0xC5, /* ..I.NV.. */
+ 0xCE, 0xA3, 0x14, 0xB5, 0x30, 0x1B, 0x63, 0xBB, /* ....0.c. */
+ 0x2D, 0x6F, 0xE9, 0xCA, 0x0B, 0x00, 0x31, 0x3F, /* -o....1? */
+ 0xA4, 0x9A, 0x39, 0xE1, 0xC8, 0xD2, 0x24, 0x95, /* ..9...$. */
+ 0x14, 0xE9, 0xD2, 0x43, 0xE8, 0xA8, 0x1E, 0x0A, /* ...C.... */
+ 0xFE, 0x9D, 0x4F, 0xF5, 0xBB, 0x16, 0xB9, 0x54, /* ..O....T */
+ 0x78, 0x07, 0x94, 0x05, 0x8E, 0x47, 0xC3, 0xCB, /* x....G.. */
+ 0x7C, 0xEC, 0xF4, 0xF8, 0xF2, 0xA4, 0x59, 0x6E, /* |.....Yn */
+ 0xED, 0xAD, 0x7F, 0x62, 0xAF, 0x89, 0xA8, 0x5B, /* ...b...[ */
+ 0x75, 0xD4, 0x73, 0xE3, 0xBA, 0x9F, 0x9A, 0xD2, /* u.s..... */
+ 0x0F, 0xFD, 0x3C, 0xE6, 0xC6, 0xA4, 0xD6, 0x6C, /* ..<....l */
+ 0x6A, 0x09, 0xE2, 0x16, 0xB0, 0x8C, 0x69, 0x3C, /* j.....i< */
+ 0xC8, 0x1C, 0xE4, 0x3E, 0x86, 0x4D, 0xB0, 0x2B, /* ...>.M.+ */
+ 0x29, 0xA0, 0x5A, 0xA3, 0x67, 0xBA, 0xDC, 0x11, /* ).Z.g... */
+ 0x08, 0x5E, 0x69, 0xB4, 0x6F, 0xA5, 0xE2, 0xB8, /* .^i.o... */
+ 0xC9, 0x6E, 0x83, 0x7E, 0x35, 0xC8, 0xA7, 0xA0, /* .n.~5... */
+ 0x33, 0xA3, 0xB1, 0x4B, 0x5A, 0x92, 0x51, 0x2E, /* 3..KZ.Q. */
+};
+
+/* AES-CTS test vectors from http://tools.ietf.org/html/rfc3962
+ * and http://tools.ietf.org/html/draft-raeburn-krb-rijndael-krb-02 */
+static const uint8_t ciph_data_aes_cts_vect1_key[] = {
+ 0x63, 0x68, 0x69, 0x63, 0x6b, 0x65, 0x6e, 0x20,
+ 0x74, 0x65, 0x72, 0x69, 0x79, 0x61, 0x6b, 0x69
+};
+
+static const uint8_t ciph_data_aes_cts_vect1_iv[16] = {
+ 0x00
+};
+
+static const uint8_t ciph_data_aes_cts_vect1_ptx[] = {
+ 0x49, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20,
+ 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65,
+ 0x20
+};
+
+static const uint8_t ciph_data_aes_cts_vect1_ctx[] = {
+ 0xc6, 0x35, 0x35, 0x68, 0xf2, 0xbf, 0x8c, 0xb4,
+ 0xd8, 0xa5, 0x80, 0x36, 0x2d, 0xa7, 0xff, 0x7f,
+ 0x97
+};
+
+#define ciph_data_aes_cts_vect2_key ciph_data_aes_cts_vect1_key
+#define ciph_data_aes_cts_vect2_iv ciph_data_aes_cts_vect1_iv
+static const uint8_t ciph_data_aes_cts_vect2_ptx[] = {
+ 0x49, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20,
+ 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65,
+ 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
+ 0x20, 0x47, 0x61, 0x75, 0x27, 0x73, 0x20
+};
+
+static const uint8_t ciph_data_aes_cts_vect2_ctx[] = {
+ 0xfc, 0x00, 0x78, 0x3e, 0x0e, 0xfd, 0xb2, 0xc1,
+ 0xd4, 0x45, 0xd4, 0xc8, 0xef, 0xf7, 0xed, 0x22,
+ 0x97, 0x68, 0x72, 0x68, 0xd6, 0xec, 0xcc, 0xc0,
+ 0xc0, 0x7b, 0x25, 0xe2, 0x5e, 0xcf, 0xe5
+};
+
+#define ciph_data_aes_cts_vect3_key ciph_data_aes_cts_vect1_key
+#define ciph_data_aes_cts_vect3_iv ciph_data_aes_cts_vect1_iv
+static const uint8_t ciph_data_aes_cts_vect3_ptx[] = {
+ 0x49, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20,
+ 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65,
+ 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
+ 0x20, 0x47, 0x61, 0x75, 0x27, 0x73, 0x20, 0x43,
+};
+
+static const uint8_t ciph_data_aes_cts_vect3_ctx[] = {
+ 0x39, 0x31, 0x25, 0x23, 0xa7, 0x86, 0x62, 0xd5,
+ 0xbe, 0x7f, 0xcb, 0xcc, 0x98, 0xeb, 0xf5, 0xa8,
+ 0x97, 0x68, 0x72, 0x68, 0xd6, 0xec, 0xcc, 0xc0,
+ 0xc0, 0x7b, 0x25, 0xe2, 0x5e, 0xcf, 0xe5, 0x84,
+};
+
+#define ciph_data_aes_cts_vect4_key ciph_data_aes_cts_vect1_key
+#define ciph_data_aes_cts_vect4_iv ciph_data_aes_cts_vect1_iv
+static const uint8_t ciph_data_aes_cts_vect4_ptx[] = {
+ 0x49, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20,
+ 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65,
+ 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
+ 0x20, 0x47, 0x61, 0x75, 0x27, 0x73, 0x20, 0x43,
+ 0x68, 0x69, 0x63, 0x6b, 0x65, 0x6e, 0x2c, 0x20,
+ 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2c,
+};
+
+static const uint8_t ciph_data_aes_cts_vect4_ctx[] = {
+ 0x97, 0x68, 0x72, 0x68, 0xd6, 0xec, 0xcc, 0xc0,
+ 0xc0, 0x7b, 0x25, 0xe2, 0x5e, 0xcf, 0xe5, 0x84,
+ 0xb3, 0xff, 0xfd, 0x94, 0x0c, 0x16, 0xa1, 0x8c,
+ 0x1b, 0x55, 0x49, 0xd2, 0xf8, 0x38, 0x02, 0x9e,
+ 0x39, 0x31, 0x25, 0x23, 0xa7, 0x86, 0x62, 0xd5,
+ 0xbe, 0x7f, 0xcb, 0xcc, 0x98, 0xeb, 0xf5,
+};
+
+#define ciph_data_aes_cts_vect5_key ciph_data_aes_cts_vect1_key
+#define ciph_data_aes_cts_vect5_iv ciph_data_aes_cts_vect1_iv
+static const uint8_t ciph_data_aes_cts_vect5_ptx[] = {
+ 0x49, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20,
+ 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65,
+ 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
+ 0x20, 0x47, 0x61, 0x75, 0x27, 0x73, 0x20, 0x43,
+ 0x68, 0x69, 0x63, 0x6b, 0x65, 0x6e, 0x2c, 0x20,
+ 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2c, 0x20,
+};
+
+static const uint8_t ciph_data_aes_cts_vect5_ctx[] = {
+ 0x97, 0x68, 0x72, 0x68, 0xd6, 0xec, 0xcc, 0xc0,
+ 0xc0, 0x7b, 0x25, 0xe2, 0x5e, 0xcf, 0xe5, 0x84,
+ 0x9d, 0xad, 0x8b, 0xbb, 0x96, 0xc4, 0xcd, 0xc0,
+ 0x3b, 0xc1, 0x03, 0xe1, 0xa1, 0x94, 0xbb, 0xd8,
+ 0x39, 0x31, 0x25, 0x23, 0xa7, 0x86, 0x62, 0xd5,
+ 0xbe, 0x7f, 0xcb, 0xcc, 0x98, 0xeb, 0xf5, 0xa8,
+};
+
+#define ciph_data_aes_cts_vect6_key ciph_data_aes_cts_vect1_key
+#define ciph_data_aes_cts_vect6_iv ciph_data_aes_cts_vect1_iv
+static const uint8_t ciph_data_aes_cts_vect6_ptx[] = {
+ 0x49, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20,
+ 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65,
+ 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
+ 0x20, 0x47, 0x61, 0x75, 0x27, 0x73, 0x20, 0x43,
+ 0x68, 0x69, 0x63, 0x6b, 0x65, 0x6e, 0x2c, 0x20,
+ 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2c, 0x20,
+ 0x61, 0x6e, 0x64, 0x20, 0x77, 0x6f, 0x6e, 0x74,
+ 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x70, 0x2e,
+};
+
+static const uint8_t ciph_data_aes_cts_vect6_ctx[] = {
+ 0x97, 0x68, 0x72, 0x68, 0xd6, 0xec, 0xcc, 0xc0,
+ 0xc0, 0x7b, 0x25, 0xe2, 0x5e, 0xcf, 0xe5, 0x84,
+ 0x39, 0x31, 0x25, 0x23, 0xa7, 0x86, 0x62, 0xd5,
+ 0xbe, 0x7f, 0xcb, 0xcc, 0x98, 0xeb, 0xf5, 0xa8,
+ 0x48, 0x07, 0xef, 0xe8, 0x36, 0xee, 0x89, 0xa5,
+ 0x26, 0x73, 0x0d, 0xbc, 0x2f, 0x7b, 0xc8, 0x40,
+ 0x9d, 0xad, 0x8b, 0xbb, 0x96, 0xc4, 0xcd, 0xc0,
+ 0x3b, 0xc1, 0x03, 0xe1, 0xa1, 0x94, 0xbb, 0xd8,
+};
+
+static const uint8_t ciph_data_des_ecb_nopad_out1[] = {
+ 0x46, 0x2B, 0x91, 0xA8, 0x55, 0xE6, 0x7E, 0x75, /* F+..U.~u */
+ 0x5E, 0x53, 0xF4, 0x8F, 0x29, 0x41, 0x4E, 0xEF, /* ^S..)AN. */
+ 0x32, 0x1B, 0x58, 0x42, 0x9B, 0xB4, 0x3A, 0x1F, /* 2.XB..:. */
+ 0x9A, 0xEA, 0xA4, 0xB4, 0xCD, 0xE9, 0x87, 0x7C, /* .......| */
+ 0xC0, 0x05, 0x34, 0xED, 0x86, 0x3C, 0x2A, 0x81, /* ..4..<.. */
+ 0x5E, 0x93, 0x0E, 0x86, 0xA9, 0xBB, 0x80, 0xFF, /* ^....... */
+};
+
+static const uint8_t ciph_data_des_ecb_nopad_out2[] = {
+ 0x85, 0xE8, 0x13, 0x54, 0x0F, 0x0A, 0xB4, 0x05
+};
+
+static const uint8_t ciph_data_des_cbc_nopad_out1[] = {
+ 0xAD, 0xD6, 0xD6, 0x3E, 0x88, 0xD0, 0xDD, 0xD4, /* ...>.... */
+ 0x9A, 0x93, 0x95, 0xA0, 0x86, 0x22, 0x5B, 0x9E, /* ....."[. */
+ 0x84, 0x0C, 0x6F, 0x12, 0x04, 0x11, 0x6F, 0xD4, /* ..o...o. */
+ 0x12, 0x29, 0xC6, 0x78, 0x0C, 0xFB, 0x58, 0x5B, /* .).x..X[ */
+ 0x66, 0x82, 0x0E, 0x52, 0xDC, 0x25, 0x16, 0x51, /* f..R.%.Q */
+ 0x69, 0xDF, 0xFE, 0x4E, 0x11, 0x1D, 0x9D, 0x08, /* i..N.... */
+};
+
+static const uint8_t ciph_data_des3_ecb_nopad_out1[] = {
+ 0xA7, 0x46, 0xEC, 0xA8, 0x6A, 0x7F, 0x4A, 0xF1, /* .F..j.J. */
+ 0x44, 0x60, 0x37, 0x3B, 0x7F, 0x76, 0xE5, 0xFF, /* D`7;.v.. */
+ 0xC1, 0xE7, 0xA5, 0x04, 0x9C, 0x29, 0x5C, 0xA5, /* .....)\. */
+ 0xDD, 0xC8, 0xEE, 0x36, 0x1F, 0x48, 0xE0, 0xA9, /* ...6.H.. */
+ 0x82, 0x2D, 0x53, 0x84, 0x49, 0x69, 0x78, 0xFA, /* .-S.Iix. */
+ 0x23, 0x69, 0x1D, 0xF7, 0x08, 0x38, 0x44, 0x05, /* #i...8D. */
+};
+
+static const uint8_t ciph_data_des3_cbc_nopad_out1[] = {
+ 0x18, 0x09, 0xEB, 0x98, 0xE4, 0x58, 0x72, 0x11, /* .....Xr. */
+ 0x30, 0x58, 0xAB, 0x38, 0xB0, 0xC9, 0x2B, 0xED, /* 0X.8..+. */
+ 0xDA, 0xC5, 0xE8, 0xA9, 0xF6, 0x8A, 0xA7, 0x80, /* ........ */
+ 0xBE, 0x54, 0x1F, 0x63, 0xF6, 0xEE, 0xA2, 0x4C, /* .T.c...L */
+ 0x7C, 0xEB, 0x84, 0x7D, 0xDA, 0xCA, 0x1E, 0xB2, /* |..}.... */
+ 0xED, 0x5E, 0x96, 0xB8, 0x01, 0x4B, 0x77, 0x02, /* .^...Kw. */
+};
+
+static const uint8_t ciph_data_des2_ecb_nopad_out1[] = {
+ 0xAB, 0x12, 0xB6, 0xE2, 0x4A, 0x3A, 0x26, 0x14, /* ....J:&. */
+ 0xF0, 0x7D, 0x23, 0xD0, 0x55, 0xDF, 0x5C, 0x16, /* .}#.U.\. */
+ 0x43, 0x59, 0x1E, 0x44, 0x01, 0x76, 0xD7, 0x50, /* CY.D.v.P */
+ 0x44, 0xC0, 0x15, 0xDF, 0x2E, 0x7F, 0x8B, 0xC5, /* D....... */
+ 0xFF, 0x8B, 0x87, 0xFE, 0x33, 0xD7, 0xCB, 0x2C, /* ....3.., */
+ 0xDA, 0x79, 0x6F, 0xA4, 0x05, 0x2B, 0x30, 0xCE, /* .yo..+0. */
+};
+
+static const uint8_t ciph_data_des2_cbc_nopad_out1[] = {
+ 0x47, 0x2F, 0xB1, 0x83, 0xC4, 0xBB, 0x93, 0x16, /* G/...... */
+ 0x73, 0xF9, 0xAD, 0x6F, 0x00, 0xF9, 0xCB, 0x4A, /* s..o...J */
+ 0x0F, 0x4F, 0x75, 0x75, 0xFB, 0x39, 0x0B, 0xFC, /* .Ouu.9.. */
+ 0x9F, 0x48, 0x52, 0xAD, 0xA2, 0x75, 0x2C, 0xF1, /* .HR..u, . */
+ 0x7D, 0xC3, 0x8F, 0x16, 0xCF, 0xC9, 0x76, 0x29, /* }.....v) */
+ 0x1A, 0xBF, 0xB3, 0xD9, 0x10, 0x7E, 0xAA, 0x49, /* .....~.I */
+};
+
+struct xtest_ciph_case {
+ uint32_t algo;
+ uint32_t mode;
+ uint32_t key_type;
+ const uint8_t *key1;
+ size_t key1_len;
+ const uint8_t *key2;
+ size_t key2_len;
+ const uint8_t *iv;
+ size_t iv_len;
+ size_t in_incr;
+ const uint8_t *in;
+ size_t in_len;
+ const uint8_t *out;
+ size_t out_len;
+ size_t line;
+};
+
+#define XTEST_CIPH_CASE_NO_IV(algo, key_type, key, in_incr, ptx, ctx) \
+ { (algo), TEE_MODE_ENCRYPT, (key_type), (key), ARRAY_SIZE(key), \
+ NULL, 0, NULL, 0, \
+ (in_incr), (ptx), ARRAY_SIZE(ptx), (ctx), ARRAY_SIZE(ctx), \
+ __LINE__ }, \
+ { (algo), TEE_MODE_DECRYPT, (key_type), (key), ARRAY_SIZE(key), \
+ NULL, 0, NULL, 0, \
+ (in_incr), (ctx), ARRAY_SIZE(ctx), (ptx), ARRAY_SIZE(ptx), __LINE__ }
+
+#define XTEST_CIPH_CASE(algo, key_type, key, iv, in_incr, ptx, ctx) \
+ { (algo), TEE_MODE_ENCRYPT, (key_type), (key), ARRAY_SIZE(key), \
+ NULL, 0, iv, ARRAY_SIZE(iv), (in_incr), (ptx), ARRAY_SIZE(ptx), \
+ (ctx), ARRAY_SIZE(ctx), __LINE__ }, \
+ { (algo), TEE_MODE_DECRYPT, (key_type), (key), ARRAY_SIZE(key), \
+ NULL, 0, iv, ARRAY_SIZE(iv), (in_incr), (ctx), ARRAY_SIZE(ctx), \
+ (ptx), ARRAY_SIZE(ptx), __LINE__ }
+
+#define XTEST_CIPH_CASE_AES_XTS(vect, in_incr) \
+ { TEE_ALG_AES_XTS, TEE_MODE_ENCRYPT, TEE_TYPE_AES, \
+ ciph_data_aes_xts_ ## vect ## _key1, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _key1), \
+ ciph_data_aes_xts_ ## vect ## _key2, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _key2), \
+ ciph_data_aes_xts_ ## vect ## _iv, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _iv), \
+ (in_incr), \
+ ciph_data_aes_xts_ ## vect ## _ptx, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _ptx), \
+ ciph_data_aes_xts_ ## vect ## _ctx, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _ctx), __LINE__ }, \
+ { TEE_ALG_AES_XTS, TEE_MODE_DECRYPT, TEE_TYPE_AES, \
+ ciph_data_aes_xts_ ## vect ## _key1, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _key1), \
+ ciph_data_aes_xts_ ## vect ## _key2, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _key2), \
+ ciph_data_aes_xts_ ## vect ## _iv, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _iv), \
+ (in_incr), \
+ ciph_data_aes_xts_ ## vect ## _ctx, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _ctx), \
+ ciph_data_aes_xts_ ## vect ## _ptx, \
+ ARRAY_SIZE(ciph_data_aes_xts_ ## vect ## _ptx), __LINE__ }
+
+#define XTEST_CIPH_CASE_AES_CBC(vect, in_incr) \
+ XTEST_CIPH_CASE(TEE_ALG_AES_CBC_NOPAD, TEE_TYPE_AES, \
+ ciph_data_aes_cbc_ ## vect ## _key, \
+ ciph_data_aes_cbc_ ## vect ## _iv, \
+ (in_incr), ciph_data_aes_cbc_ ## vect ## _ptx, \
+ ciph_data_aes_cbc_ ## vect ## _ctx)
+
+#define XTEST_CIPH_CASE_AES_CTS(vect, in_incr) \
+ XTEST_CIPH_CASE(TEE_ALG_AES_CTS, TEE_TYPE_AES, \
+ ciph_data_aes_cts_ ## vect ## _key, \
+ ciph_data_aes_cts_ ## vect ## _iv, \
+ (in_incr), ciph_data_aes_cts_ ## vect ## _ptx, \
+ ciph_data_aes_cts_ ## vect ## _ctx)
+
+static const struct xtest_ciph_case ciph_cases[] = {
+ /* AES */
+ XTEST_CIPH_CASE_NO_IV(TEE_ALG_AES_ECB_NOPAD, TEE_TYPE_AES,
+ ciph_data_aes_key1, 11, ciph_data_in1,
+ ciph_data_aes_ecb_nopad_out1),
+ XTEST_CIPH_CASE(TEE_ALG_AES_CBC_NOPAD, TEE_TYPE_AES,
+ ciph_data_aes_key1, ciph_data_128_iv1, 11,
+ ciph_data_in1,
+ ciph_data_aes_cbc_nopad_out1),
+ XTEST_CIPH_CASE(TEE_ALG_AES_CTR, TEE_TYPE_AES,
+ ciph_data_aes_key1, ciph_data_128_iv1, 13,
+ ciph_data_in1,
+ ciph_data_aes_ctr_out1),
+ XTEST_CIPH_CASE(TEE_ALG_AES_CTR, TEE_TYPE_AES,
+ ciph_data_aes_key1, ciph_data_128_iv1, 13,
+ ciph_data_in3,
+ ciph_data_aes_ctr_out2),
+
+ XTEST_CIPH_CASE_AES_CBC(vect1, 11),
+
+ /* AES-CTS */
+ XTEST_CIPH_CASE_AES_CTS(vect1, 13),
+ XTEST_CIPH_CASE_AES_CTS(vect2, 14),
+ XTEST_CIPH_CASE_AES_CTS(vect3, 11),
+ XTEST_CIPH_CASE_AES_CTS(vect4, 9),
+ XTEST_CIPH_CASE_AES_CTS(vect5, 7),
+ XTEST_CIPH_CASE_AES_CTS(vect6, 17),
+ XTEST_CIPH_CASE_AES_CTS(vect6, 0x20),
+
+ /* DES */
+ XTEST_CIPH_CASE_NO_IV(TEE_ALG_DES_ECB_NOPAD, TEE_TYPE_DES,
+ ciph_data_des_key1, 14, ciph_data_in1,
+ ciph_data_des_ecb_nopad_out1),
+ XTEST_CIPH_CASE_NO_IV(TEE_ALG_DES_ECB_NOPAD, TEE_TYPE_DES,
+ ciph_data_des_key2, 3, ciph_data_in2,
+ ciph_data_des_ecb_nopad_out2),
+ XTEST_CIPH_CASE(TEE_ALG_DES_CBC_NOPAD, TEE_TYPE_DES,
+ ciph_data_des_key1, ciph_data_64_iv1, 15, ciph_data_in1,
+ ciph_data_des_cbc_nopad_out1),
+
+ /* DES3 */
+ XTEST_CIPH_CASE_NO_IV(TEE_ALG_DES3_ECB_NOPAD, TEE_TYPE_DES3,
+ ciph_data_des3_key1, 11, ciph_data_in1,
+ ciph_data_des3_ecb_nopad_out1),
+ XTEST_CIPH_CASE_NO_IV(TEE_ALG_DES3_ECB_NOPAD, TEE_TYPE_DES3,
+ ciph_data_des3_key2, 3, ciph_data_in2,
+ ciph_data_des_ecb_nopad_out2),
+ XTEST_CIPH_CASE(TEE_ALG_DES3_CBC_NOPAD, TEE_TYPE_DES3,
+ ciph_data_des3_key1, ciph_data_64_iv1, 11,
+ ciph_data_in1,
+ ciph_data_des3_cbc_nopad_out1),
+
+ /* DES2 */
+ XTEST_CIPH_CASE_NO_IV(TEE_ALG_DES3_ECB_NOPAD, TEE_TYPE_DES3,
+ ciph_data_des2_key1, 11, ciph_data_in1,
+ ciph_data_des2_ecb_nopad_out1),
+ XTEST_CIPH_CASE(TEE_ALG_DES3_CBC_NOPAD, TEE_TYPE_DES3,
+ ciph_data_des2_key1, ciph_data_64_iv1, 11,
+ ciph_data_in1,
+ ciph_data_des2_cbc_nopad_out1),
+};
+
+static const struct xtest_ciph_case ciph_cases_xts[] = {
+ /* AES-XTS */
+ XTEST_CIPH_CASE_AES_XTS(vect1, 3),
+ XTEST_CIPH_CASE_AES_XTS(vect2, 6),
+ XTEST_CIPH_CASE_AES_XTS(vect3, 7),
+ XTEST_CIPH_CASE_AES_XTS(vect4, 8),
+ XTEST_CIPH_CASE_AES_XTS(vect5, 9),
+ XTEST_CIPH_CASE_AES_XTS(vect6, 13),
+ XTEST_CIPH_CASE_AES_XTS(vect7, 1),
+ XTEST_CIPH_CASE_AES_XTS(vect8, 3),
+ XTEST_CIPH_CASE_AES_XTS(vect9, 2),
+ XTEST_CIPH_CASE_AES_XTS(vect10, 5),
+ XTEST_CIPH_CASE_AES_XTS(vect11, 6),
+ XTEST_CIPH_CASE_AES_XTS(vect12, 7),
+ XTEST_CIPH_CASE_AES_XTS(vect13, 3),
+ XTEST_CIPH_CASE_AES_XTS(vect14, 2),
+ XTEST_CIPH_CASE_AES_XTS(vect15, 0),
+ XTEST_CIPH_CASE_AES_XTS(vect16, 9),
+ XTEST_CIPH_CASE_AES_XTS(vect17, 6),
+ XTEST_CIPH_CASE_AES_XTS(vect18, 8),
+ XTEST_CIPH_CASE_AES_XTS(vect19, 23),
+};
+
+static void xtest_tee_test_4003_no_xts(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ TEE_OperationHandle op;
+ TEE_ObjectHandle key1_handle = TEE_HANDLE_NULL;
+ TEE_ObjectHandle key2_handle = TEE_HANDLE_NULL;
+ uint8_t out[2048];
+ size_t out_size;
+ size_t out_offs;
+ uint32_t ret_orig;
+ size_t n;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ for (n = 0; n < ARRAY_SIZE(ciph_cases); n++) {
+ TEE_Attribute key_attr;
+ size_t key_size;
+ size_t op_key_size;
+
+
+ Do_ADBG_BeginSubCase(c, "Cipher case %d algo 0x%x line %d",
+ (int)n, (unsigned int)ciph_cases[n].algo,
+ (int)ciph_cases[n].line);
+
+ key_attr.attributeID = TEE_ATTR_SECRET_VALUE;
+ key_attr.content.ref.buffer = (void *)ciph_cases[n].key1;
+ key_attr.content.ref.length = ciph_cases[n].key1_len;
+
+ key_size = key_attr.content.ref.length * 8;
+ if (ciph_cases[n].key_type == TEE_TYPE_DES ||
+ ciph_cases[n].key_type == TEE_TYPE_DES3)
+ /* Exclude parity in bit size of key */
+ key_size -= key_size / 8;
+
+ op_key_size = key_size;
+ if (ciph_cases[n].key2 != NULL)
+ op_key_size *= 2;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session, &op,
+ ciph_cases[n].algo, ciph_cases[n].mode,
+ op_key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, &session,
+ ciph_cases[n].key_type, key_size,
+ &key1_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, &session,
+ key1_handle, &key_attr, 1)))
+ goto out;
+
+ if (ciph_cases[n].key2 != NULL) {
+ key_attr.content.ref.buffer =
+ (void *)ciph_cases[n].key2;
+ key_attr.content.ref.length = ciph_cases[n].key2_len;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c,
+ &session, ciph_cases[n].key_type,
+ key_attr.content.ref.length * 8,
+ &key2_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c,
+ &session, key2_handle, &key_attr, 1)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key2(c, &session, op,
+ key1_handle, key2_handle)))
+ goto out;
+ } else {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op,
+ key1_handle)))
+ goto out;
+ }
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ key1_handle)))
+ goto out;
+ key1_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ key2_handle)))
+ goto out;
+ key2_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_cipher_init(c, &session, op,
+ ciph_cases[n].iv, ciph_cases[n].iv_len)))
+ goto out;
+
+ out_offs = 0;
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_cipher_update(c, &session, op,
+ ciph_cases[n].in, ciph_cases[n].in_incr, out,
+ &out_size)))
+ goto out;
+
+ out_offs += out_size;
+ out_size = sizeof(out) - out_offs;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_cipher_do_final(c, &session, op,
+ ciph_cases[n].in + ciph_cases[n].in_incr,
+ ciph_cases[n].in_len - ciph_cases[n].in_incr,
+ out + out_offs,
+ &out_size)))
+ goto out;
+
+ out_offs += out_size;
+
+ (void)ADBG_EXPECT_BUFFER(c, ciph_cases[n].out,
+ ciph_cases[n].out_len, out, out_offs);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op)))
+ goto out;
+
+ Do_ADBG_EndSubCase(c, NULL);
+ }
+out:
+ TEEC_CloseSession(&session);
+}
+
+/*
+ * This is a split of the original xtest 4003 as eary version of the ST TEE.
+ *
+ * Core did not support xts.
+ */
+static void xtest_tee_test_4003_xts(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ TEE_OperationHandle op;
+ TEE_ObjectHandle key1_handle = TEE_HANDLE_NULL;
+ TEE_ObjectHandle key2_handle = TEE_HANDLE_NULL;
+ uint8_t out[2048];
+ size_t out_size;
+ size_t out_offs;
+ uint32_t ret_orig;
+ size_t n;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ for (n = 0; n < ARRAY_SIZE(ciph_cases_xts); n++) {
+ TEE_Attribute key_attr;
+ size_t key_size;
+ size_t op_key_size;
+
+ Do_ADBG_BeginSubCase(c, "Cipher case %d algo 0x%x line %d",
+ (int)n,
+ (unsigned int)ciph_cases_xts[n].algo,
+ (int)ciph_cases_xts[n].line);
+
+ key_attr.attributeID = TEE_ATTR_SECRET_VALUE;
+ key_attr.content.ref.buffer = (void *)ciph_cases_xts[n].key1;
+ key_attr.content.ref.length = ciph_cases_xts[n].key1_len;
+
+ key_size = key_attr.content.ref.length * 8;
+ if (ciph_cases_xts[n].key_type == TEE_TYPE_DES ||
+ ciph_cases_xts[n].key_type == TEE_TYPE_DES3)
+ /* Exclude parity in bit size of key */
+ key_size -= key_size / 8;
+
+ op_key_size = key_size;
+ if (ciph_cases_xts[n].key2 != NULL)
+ op_key_size *= 2;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session, &op,
+ ciph_cases_xts[n].algo, ciph_cases_xts[n].mode,
+ op_key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, &session,
+ ciph_cases_xts[n].key_type, key_size,
+ &key1_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, &session,
+ key1_handle, &key_attr, 1)))
+ goto out;
+
+ if (ciph_cases_xts[n].key2 != NULL) {
+ key_attr.content.ref.buffer =
+ (void *)ciph_cases_xts[n].key2;
+
+ key_attr.content.ref.length =
+ ciph_cases_xts[n].key2_len;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c,
+ &session, ciph_cases_xts[n].key_type,
+ key_attr.content.ref.length * 8,
+ &key2_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c,
+ &session, key2_handle, &key_attr, 1)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key2(c, &session, op,
+ key1_handle, key2_handle)))
+ goto out;
+ } else {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op,
+ key1_handle)))
+ goto out;
+ }
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ key1_handle)))
+ goto out;
+
+ key1_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ key2_handle)))
+ goto out;
+
+ key2_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, ta_crypt_cmd_cipher_init(c,
+ &
+ session,
+ op,
+ ciph_cases_xts
+ [n].iv, ciph_cases_xts[n].iv_len)))
+ goto out;
+
+ out_offs = 0;
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_cipher_update(c, &session, op,
+ ciph_cases_xts[n].in, ciph_cases_xts[n].in_incr,
+ out, &out_size)))
+ goto out;
+
+ out_offs += out_size;
+ out_size = sizeof(out) - out_offs;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_cipher_do_final(c, &session, op,
+ ciph_cases_xts[n].in +
+ ciph_cases_xts[n].in_incr,
+ ciph_cases_xts[n].in_len -
+ ciph_cases_xts[n].in_incr,
+ out + out_offs,
+ &out_size)))
+ goto out;
+ out_offs += out_size;
+
+ (void)ADBG_EXPECT_BUFFER(c, ciph_cases_xts[n].out,
+ ciph_cases_xts[n].out_len, out,
+ out_offs);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op)))
+ goto out;
+
+ Do_ADBG_EndSubCase(c, NULL);
+ }
+out:
+ TEEC_CloseSession(&session);
+}
+
+static void xtest_tee_test_4004(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+ uint8_t buf1[45] = { 0 };
+ uint8_t buf2[45] = { 0 };
+ static const uint8_t zeros[45] = { 0 };
+
+ Do_ADBG_BeginSubCase(c, "TEE get random");
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_random_number_generate(c, &session, buf1,
+ sizeof(buf1))))
+ goto out;
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, !=, memcmp(buf1, zeros, sizeof(buf1)));
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_random_number_generate(c, &session, buf2,
+ sizeof(buf2))))
+ goto out;
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, !=, memcmp(buf2, zeros, sizeof(buf2)));
+
+ (void)ADBG_EXPECT_COMPARE_SIGNED(c,
+ 0, !=, memcmp(buf2, buf1, sizeof(buf1)));
+out:
+ TEEC_CloseSession(&session);
+ Do_ADBG_EndSubCase(c, "TEE get random");
+}
+
+
+struct xtest_ae_case {
+ uint32_t algo;
+ uint32_t mode;
+ uint32_t key_type;
+ const uint8_t *key;
+ size_t key_len;
+ const uint8_t *nonce;
+ size_t nonce_len;
+ size_t aad_incr;
+ const uint8_t *aad;
+ size_t aad_len;
+ size_t in_incr;
+ const uint8_t *ptx;
+ size_t ptx_len;
+ const uint8_t *ctx;
+ size_t ctx_len;
+ const uint8_t *tag;
+ size_t tag_len;
+ size_t line;
+};
+
+
+#define ARRAY(a) a, ARRAY_SIZE(a)
+#define NULL_ARRAY(a) NULL, 0
+
+#define XTEST_AE_CASE(algo, vect, aad_incr, in_incr, \
+ aad_array, ptx_array, ctx_array) \
+ { (algo), TEE_MODE_ENCRYPT, TEE_TYPE_AES, ARRAY(vect ## _key), \
+ ARRAY(vect ## _nonce), (aad_incr), \
+ aad_array(vect ## _aad), (in_incr), \
+ ptx_array(vect ## _ptx), ctx_array(vect ## _ctx), \
+ ARRAY(vect ## _tag), \
+ __LINE__ }, \
+ { (algo), TEE_MODE_DECRYPT, TEE_TYPE_AES, ARRAY(vect ## _key), \
+ ARRAY(vect ## _nonce), (aad_incr), \
+ aad_array(vect ## _aad), (in_incr), \
+ ptx_array(vect ## _ptx), ctx_array(vect ## _ctx), \
+ ARRAY(vect ## _tag), \
+ __LINE__ }
+
+#define XTEST_AE_CASE_AES_CCM(vect, aad_incr, in_incr) \
+ XTEST_AE_CASE(TEE_ALG_AES_CCM, ae_data_aes_ccm_ ## vect, aad_incr, \
+ in_incr, ARRAY, ARRAY, ARRAY)
+
+#define XTEST_AE_CASE_AES_GCM(vect, aad_incr, in_incr, \
+ aad_array, ptx_array, ctx_array) \
+ XTEST_AE_CASE(TEE_ALG_AES_GCM, ae_data_aes_gcm_ ## vect, aad_incr, \
+ in_incr, aad_array, ptx_array, ctx_array)
+
+
+
+static const struct xtest_ae_case ae_cases[] = {
+ XTEST_AE_CASE_AES_CCM(vect1, 3, 2),
+ XTEST_AE_CASE_AES_CCM(vect2, 7, 13),
+ XTEST_AE_CASE_AES_CCM(vect3, 5, 21),
+
+ XTEST_AE_CASE_AES_GCM(vect1, 0, 0, NULL_ARRAY, NULL_ARRAY, NULL_ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect2, 0, 9, NULL_ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect3, 0, 9, NULL_ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect3, 0, 0x20, NULL_ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect4, 5, 9, ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect5, 5, 9, ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect6, 5, 9, ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect7, 0, 0, NULL_ARRAY, NULL_ARRAY, NULL_ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect8, 0, 9, NULL_ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect9, 0, 9, NULL_ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect10, 5, 9, ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect11, 5, 9, ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect12, 5, 9, ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect13, 0, 0, NULL_ARRAY, NULL_ARRAY, NULL_ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect14, 0, 9, NULL_ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect15, 0, 9, NULL_ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect16, 5, 9, ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect17, 5, 9, ARRAY, ARRAY, ARRAY),
+ XTEST_AE_CASE_AES_GCM(vect18, 5, 9, ARRAY, ARRAY, ARRAY),
+};
+
+static void xtest_tee_test_4005(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ TEE_OperationHandle op;
+ TEE_ObjectHandle key_handle = TEE_HANDLE_NULL;
+ TEE_Attribute key_attr;
+ uint8_t out[512];
+ size_t out_size;
+ size_t out_offs;
+ uint32_t ret_orig;
+ size_t n;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ for (n = 0; n < ARRAY_SIZE(ae_cases); n++) {
+ Do_ADBG_BeginSubCase(c, "AE case %d algo 0x%x line %d",
+ (int)n, (unsigned int)ae_cases[n].algo,
+ (int)ae_cases[n].line);
+
+ key_attr.attributeID = TEE_ATTR_SECRET_VALUE;
+ key_attr.content.ref.buffer = (void *)ae_cases[n].key;
+ key_attr.content.ref.length = ae_cases[n].key_len;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session, &op,
+ ae_cases[n].algo, ae_cases[n].mode,
+ key_attr.content.ref.length * 8)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, &session,
+ ae_cases[n].key_type,
+ key_attr.content.ref.length * 8,
+ &key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, &session,
+ key_handle, &key_attr, 1)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op,
+ key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ key_handle)))
+ goto out;
+ key_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_ae_init(c, &session, op, ae_cases[n].nonce,
+ ae_cases[n].nonce_len, ae_cases[n].tag_len,
+ ae_cases[n].aad_len, ae_cases[n].ptx_len)))
+ goto out;
+
+ if (ae_cases[n].aad != NULL) {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_ae_update_aad(c, &session, op,
+ ae_cases[n].aad, ae_cases[n].aad_incr)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_ae_update_aad(c, &session, op,
+ ae_cases[n].aad + ae_cases[n].aad_incr,
+ ae_cases [n].aad_len -
+ ae_cases[n].aad_incr)))
+ goto out;
+ }
+
+ out_offs = 0;
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (ae_cases[n].mode == TEE_MODE_ENCRYPT) {
+ if (ae_cases[n].ptx != NULL) {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_ae_update(c, &session, op,
+ ae_cases[n].ptx,
+ ae_cases[n].in_incr, out,
+ &out_size)))
+ goto out;
+ out_offs += out_size;
+ }
+ } else {
+ if (ae_cases[n].ctx != NULL) {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_ae_update(c, &session, op,
+ ae_cases[n].ctx,
+ ae_cases[n].in_incr, out,
+ &out_size)))
+ goto out;
+ out_offs += out_size;
+ }
+ }
+
+ out_size = sizeof(out) - out_offs;
+ if (ae_cases[n].mode == TEE_MODE_ENCRYPT) {
+ uint8_t out_tag[64];
+ size_t out_tag_len = MIN(sizeof(out_tag),
+ ae_cases[n].tag_len);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_ae_encrypt_final(c, &session, op,
+ ae_cases[n].ptx + ae_cases[n].in_incr,
+ ae_cases[n].ptx_len -
+ ae_cases[n].in_incr,
+ out + out_offs,
+ &out_size, out_tag, &out_tag_len)))
+ goto out;
+
+ (void)ADBG_EXPECT_BUFFER(c,
+ ae_cases[n].tag, ae_cases[n].tag_len, out_tag,
+ out_tag_len);
+
+ out_offs += out_size;
+
+ (void)ADBG_EXPECT_BUFFER(c, ae_cases[n].ctx,
+ ae_cases[n].ctx_len, out, out_offs);
+ } else {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_ae_decrypt_final(c, &session, op,
+ ae_cases[n].ctx + ae_cases[n].in_incr,
+ ae_cases[n].ctx_len -
+ ae_cases[n].in_incr,
+ out + out_offs,
+ &out_size, ae_cases[n].tag,
+ ae_cases[n].tag_len)))
+ goto out;
+
+ out_offs += out_size;
+
+ (void)ADBG_EXPECT_BUFFER(c, ae_cases[n].ptx,
+ ae_cases[n].ptx_len, out, out_offs);
+ }
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op)))
+ goto out;
+
+ Do_ADBG_EndSubCase(c, NULL);
+ }
+out:
+ TEEC_CloseSession(&session);
+}
+
+struct xtest_ac_case {
+ uint32_t algo;
+ TEE_OperationMode mode;
+
+ union {
+ struct {
+ const uint8_t *modulus;
+ size_t modulus_len;
+
+ const uint8_t *pub_exp;
+ size_t pub_exp_len;
+
+ const uint8_t *priv_exp;
+ size_t priv_exp_len;
+
+ const uint8_t *prime1; /* q */
+ size_t prime1_len;
+ const uint8_t *prime2; /* p */
+ size_t prime2_len;
+ const uint8_t *exp1; /* dp */
+ size_t exp1_len;
+ const uint8_t *exp2; /* dq */
+ size_t exp2_len;
+ const uint8_t *coeff; /* iq */
+ size_t coeff_len;
+
+ int salt_len;
+ } rsa;
+ struct {
+ const uint8_t *prime;
+ size_t prime_len;
+ const uint8_t *sub_prime;
+ size_t sub_prime_len;
+ const uint8_t *base;
+ size_t base_len;
+ const uint8_t *pub_val;
+ size_t pub_val_len;
+ const uint8_t *priv_val;
+ size_t priv_val_len;
+ } dsa;
+ } params;
+
+ const uint8_t *ptx;
+ size_t ptx_len;
+ const uint8_t *ctx;
+ size_t ctx_len;
+ size_t line;
+};
+
+#define WITHOUT_SALT(x) -1
+#define WITH_SALT(x) x
+
+#define XTEST_AC_CASE(algo, mode, vect, union_params) \
+ { (algo), (mode), .params = union_params, \
+ ARRAY(vect ## _ptx), \
+ ARRAY(vect ## _out), \
+ __LINE__ }
+
+#define XTEST_AC_RSA_UNION(vect, opt_crt_array, opt_salt) \
+ { .rsa = { \
+ ARRAY(vect ## _modulus), \
+ ARRAY(vect ## _pub_exp), \
+ ARRAY(vect ## _priv_exp), \
+ opt_crt_array(vect ## _prime1), \
+ opt_crt_array(vect ## _prime2), \
+ opt_crt_array(vect ## _exp1), \
+ opt_crt_array(vect ## _exp2), \
+ opt_crt_array(vect ## _coeff), \
+ opt_salt(vect ## _salt_len) \
+ } }
+
+#define XTEST_AC_RSA_CASE(algo, mode, vect, opt_crt_array, opt_salt) \
+ XTEST_AC_CASE(algo, mode, vect, \
+ XTEST_AC_RSA_UNION(vect, opt_crt_array, opt_salt))
+
+#define XTEST_AC_DSA_UNION(vect) \
+ { .dsa = { \
+ ARRAY(vect ## _prime), \
+ ARRAY(vect ## _sub_prime), \
+ ARRAY(vect ## _base), \
+ ARRAY(vect ## _pub_val), \
+ ARRAY(vect ## _priv_val), \
+ } }
+
+#define XTEST_AC_DSA_CASE(algo, mode, vect) \
+ XTEST_AC_CASE(algo, mode, vect, XTEST_AC_DSA_UNION(vect))
+
+static const struct xtest_ac_case xtest_ac_cases[] = {
+ /* RSA test without crt parameters */
+ XTEST_AC_RSA_CASE(TEE_ALG_RSA_NOPAD, TEE_MODE_ENCRYPT,
+ ac_rsassa_vect1, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSA_NOPAD, TEE_MODE_DECRYPT,
+ ac_rsassa_vect1, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSA_NOPAD, TEE_MODE_ENCRYPT,
+ ac_rsassa_vect2, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSA_NOPAD, TEE_MODE_DECRYPT,
+ ac_rsassa_vect2, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect3, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect3, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect4, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect4, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect5, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect5, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect6, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect6, NULL_ARRAY, WITHOUT_SALT),
+
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect7, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect7, NULL_ARRAY, WITHOUT_SALT),
+
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect8, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect8, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA224, TEE_MODE_SIGN,
+ ac_rsassa_vect16, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA224, TEE_MODE_VERIFY,
+ ac_rsassa_vect16, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA256, TEE_MODE_SIGN,
+ ac_rsassa_vect9, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA256, TEE_MODE_VERIFY,
+ ac_rsassa_vect9, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA384, TEE_MODE_SIGN,
+ ac_rsassa_vect10, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA384, TEE_MODE_VERIFY,
+ ac_rsassa_vect10, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA512, TEE_MODE_SIGN,
+ ac_rsassa_vect11, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA512, TEE_MODE_VERIFY,
+ ac_rsassa_vect11, NULL_ARRAY, WITHOUT_SALT),
+
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect12, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect12, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224, TEE_MODE_VERIFY,
+ ac_rsassa_vect17, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224, TEE_MODE_SIGN,
+ ac_rsassa_vect17, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256, TEE_MODE_VERIFY,
+ ac_rsassa_vect13, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256, TEE_MODE_SIGN,
+ ac_rsassa_vect13, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384, TEE_MODE_VERIFY,
+ ac_rsassa_vect14, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384, TEE_MODE_SIGN,
+ ac_rsassa_vect14, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512, TEE_MODE_VERIFY,
+ ac_rsassa_vect15, NULL_ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512, TEE_MODE_SIGN,
+ ac_rsassa_vect15, NULL_ARRAY, WITH_SALT),
+
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_DECRYPT,
+ ac_rsaes_pkcs1_v1_5_vect1, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_ENCRYPT,
+ ac_rsaes_pkcs1_v1_5_vect1, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_DECRYPT,
+ ac_rsaes_pkcs1_v1_5_vect2, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_ENCRYPT,
+ ac_rsaes_pkcs1_v1_5_vect2, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_DECRYPT,
+ ac_rsaes_pkcs1_v1_5_vect15, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_ENCRYPT,
+ ac_rsaes_pkcs1_v1_5_vect15, NULL_ARRAY, WITHOUT_SALT),
+
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_DECRYPT,
+ ac_rsaes_oaep_vect1, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_ENCRYPT,
+ ac_rsaes_oaep_vect1, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_DECRYPT,
+ ac_rsaes_oaep_vect2, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_ENCRYPT,
+ ac_rsaes_oaep_vect2, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_DECRYPT,
+ ac_rsaes_oaep_vect10, NULL_ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_ENCRYPT,
+ ac_rsaes_oaep_vect10, NULL_ARRAY, WITHOUT_SALT),
+
+ /* RSA test with crt parameters */
+ XTEST_AC_RSA_CASE(TEE_ALG_RSA_NOPAD, TEE_MODE_ENCRYPT,
+ ac_rsassa_vect1, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSA_NOPAD, TEE_MODE_DECRYPT,
+ ac_rsassa_vect1, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSA_NOPAD, TEE_MODE_ENCRYPT,
+ ac_rsassa_vect2, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSA_NOPAD, TEE_MODE_DECRYPT,
+ ac_rsassa_vect2, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect3, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect3, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect4, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect4, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect5, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect5, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect6, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect6, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect7, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect7, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect8, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect8, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA256, TEE_MODE_SIGN,
+ ac_rsassa_vect9, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA256, TEE_MODE_VERIFY,
+ ac_rsassa_vect9, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA384, TEE_MODE_SIGN,
+ ac_rsassa_vect10, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA384, TEE_MODE_VERIFY,
+ ac_rsassa_vect10, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA512, TEE_MODE_SIGN,
+ ac_rsassa_vect11, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_V1_5_SHA512, TEE_MODE_VERIFY,
+ ac_rsassa_vect11, ARRAY, WITHOUT_SALT),
+
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1, TEE_MODE_VERIFY,
+ ac_rsassa_vect12, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1, TEE_MODE_SIGN,
+ ac_rsassa_vect12, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224, TEE_MODE_VERIFY,
+ ac_rsassa_vect17, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224, TEE_MODE_SIGN,
+ ac_rsassa_vect17, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256, TEE_MODE_VERIFY,
+ ac_rsassa_vect13, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256, TEE_MODE_SIGN,
+ ac_rsassa_vect13, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384, TEE_MODE_VERIFY,
+ ac_rsassa_vect14, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384, TEE_MODE_SIGN,
+ ac_rsassa_vect14, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512, TEE_MODE_VERIFY,
+ ac_rsassa_vect15, ARRAY, WITH_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512, TEE_MODE_SIGN,
+ ac_rsassa_vect15, ARRAY, WITH_SALT),
+
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_DECRYPT,
+ ac_rsaes_pkcs1_v1_5_vect1, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_ENCRYPT,
+ ac_rsaes_pkcs1_v1_5_vect1, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_DECRYPT,
+ ac_rsaes_pkcs1_v1_5_vect2, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_ENCRYPT,
+ ac_rsaes_pkcs1_v1_5_vect2, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_DECRYPT,
+ ac_rsaes_pkcs1_v1_5_vect15, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_V1_5, TEE_MODE_ENCRYPT,
+ ac_rsaes_pkcs1_v1_5_vect15, ARRAY, WITHOUT_SALT),
+
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_DECRYPT,
+ ac_rsaes_oaep_vect1, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_ENCRYPT,
+ ac_rsaes_oaep_vect1, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_DECRYPT,
+ ac_rsaes_oaep_vect2, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_ENCRYPT,
+ ac_rsaes_oaep_vect2, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_DECRYPT,
+ ac_rsaes_oaep_vect10, ARRAY, WITHOUT_SALT),
+ XTEST_AC_RSA_CASE(TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1, TEE_MODE_ENCRYPT,
+ ac_rsaes_oaep_vect10, ARRAY, WITHOUT_SALT),
+
+ /* DSA tests */
+ XTEST_AC_DSA_CASE(TEE_ALG_DSA_SHA1, TEE_MODE_VERIFY, ac_dsa_vect1),
+ XTEST_AC_DSA_CASE(TEE_ALG_DSA_SHA1, TEE_MODE_SIGN, ac_dsa_vect1),
+ XTEST_AC_DSA_CASE(TEE_ALG_DSA_SHA1, TEE_MODE_VERIFY, ac_dsa_vect2),
+ XTEST_AC_DSA_CASE(TEE_ALG_DSA_SHA1, TEE_MODE_SIGN, ac_dsa_vect2),
+};
+
+static bool create_key(ADBG_Case_t *c, TEEC_Session *s,
+ uint32_t max_key_size, uint32_t key_type,
+ TEE_Attribute *attrs, size_t num_attrs,
+ TEE_ObjectHandle *handle)
+{
+ size_t n;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, s, key_type,
+ max_key_size, handle)))
+ return false;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, s, *handle, attrs,
+ num_attrs)))
+ return false;
+
+ for (n = 0; n < num_attrs; n++) {
+ uint8_t out[256];
+ size_t out_size;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_get_object_buffer_attribute(c, s, *handle,
+ attrs[n].attributeID, out, &out_size)))
+ return false;
+
+ if (!ADBG_EXPECT_BUFFER(c, attrs[n].content.ref.buffer,
+ attrs[n].content.ref.length, out, out_size))
+ return false;
+ }
+
+ return true;
+}
+
+static void xtest_tee_test_4006(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ TEE_OperationHandle op = TEE_HANDLE_NULL;
+ TEE_ObjectHandle priv_key_handle = TEE_HANDLE_NULL;
+ TEE_ObjectHandle pub_key_handle = TEE_HANDLE_NULL;
+ TEE_Attribute key_attrs[8];
+ TEE_Attribute algo_params[1];
+ size_t num_algo_params;
+ uint8_t out[512];
+ size_t out_size;
+ uint8_t out_enc[512];
+ size_t out_enc_size;
+ uint8_t ptx_hash[TEE_MAX_HASH_SIZE];
+ size_t ptx_hash_size;
+ size_t max_key_size;
+ size_t num_key_attrs;
+ uint32_t ret_orig;
+ size_t n;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ for (n = 0; n < ARRAY_SIZE(xtest_ac_cases); n++) {
+ const struct xtest_ac_case *tv = xtest_ac_cases + n;
+
+ Do_ADBG_BeginSubCase(c, "Asym Crypto case %d algo 0x%x line %d",
+ (int)n, (unsigned int)tv->algo,
+ (int)tv->line);
+
+ /*
+ * When signing or verifying we're working with the hash of
+ * the payload.
+ */
+ if (tv->mode == TEE_MODE_VERIFY || tv->mode == TEE_MODE_SIGN) {
+ uint32_t hash_algo = TEE_ALG_HASH_ALGO(
+ TEE_ALG_GET_DIGEST_HASH(
+ tv->algo));
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session,
+ &op, hash_algo, TEE_MODE_DIGEST, 0)))
+ goto out;
+
+ ptx_hash_size = sizeof(ptx_hash);
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_digest_do_final(c, & session, op,
+ tv->ptx, tv->ptx_len, ptx_hash,
+ &ptx_hash_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op)))
+ goto out;
+ }
+
+ num_algo_params = 0;
+ num_key_attrs = 0;
+ switch (TEE_ALG_GET_MAIN_ALG(tv->algo)) {
+ case TEE_MAIN_ALGO_RSA:
+ if (tv->params.rsa.salt_len > 0) {
+ algo_params[0].attributeID =
+ TEE_ATTR_RSA_PSS_SALT_LENGTH;
+ algo_params[0].content.value.a =
+ tv->params.rsa.salt_len;
+ algo_params[0].content.value.b = 0;
+ num_algo_params = 1;
+ }
+
+ max_key_size = tv->params.rsa.modulus_len * 8;
+
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_RSA_MODULUS,
+ tv->params.rsa.modulus,
+ tv->params.rsa.modulus_len);
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_RSA_PUBLIC_EXPONENT,
+ tv->params.rsa.pub_exp,
+ tv->params.rsa.pub_exp_len);
+
+ if (!ADBG_EXPECT_TRUE(c,
+ create_key(c, &session,
+ max_key_size,
+ TEE_TYPE_RSA_PUBLIC_KEY,
+ key_attrs,
+ num_key_attrs,
+ &pub_key_handle)))
+ goto out;
+
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_RSA_PRIVATE_EXPONENT,
+ tv->params.rsa.priv_exp,
+ tv->params.rsa.priv_exp_len);
+
+ if (tv->params.rsa.prime1_len != 0) {
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_RSA_PRIME1,
+ tv->params.rsa.prime1,
+ tv->params.rsa.prime1_len);
+ }
+
+ if (tv->params.rsa.prime2_len != 0) {
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_RSA_PRIME2,
+ tv->params.rsa.prime2,
+ tv->params.rsa.prime2_len);
+ }
+
+ if (tv->params.rsa.exp1_len != 0) {
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_RSA_EXPONENT1,
+ tv->params.rsa.exp1,
+ tv->params.rsa.exp1_len);
+ }
+
+ if (tv->params.rsa.exp2_len != 0) {
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_RSA_EXPONENT2,
+ tv->params.rsa.exp2,
+ tv->params.rsa.exp2_len);
+ }
+
+ if (tv->params.rsa.coeff_len != 0) {
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_RSA_COEFFICIENT,
+ tv->params.rsa.coeff,
+ tv->params.rsa.coeff_len);
+ }
+
+ if (!ADBG_EXPECT_TRUE(c,
+ create_key(c, &session,
+ max_key_size,
+ TEE_TYPE_RSA_KEYPAIR,
+ key_attrs,
+ num_key_attrs,
+ &priv_key_handle)))
+ goto out;
+ break;
+
+ case TEE_MAIN_ALGO_DSA:
+ max_key_size = tv->params.dsa.prime_len * 8;
+
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_DSA_PRIME,
+ tv->params.dsa.prime,
+ tv->params.dsa.prime_len);
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_DSA_SUBPRIME,
+ tv->params.dsa.sub_prime,
+ tv->params.dsa.sub_prime_len);
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_DSA_BASE,
+ tv->params.dsa.base,
+ tv->params.dsa.base_len);
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_DSA_PUBLIC_VALUE,
+ tv->params.dsa.pub_val,
+ tv->params.dsa.pub_val_len);
+
+ if (!ADBG_EXPECT_TRUE(c,
+ create_key(c, &session, max_key_size,
+ TEE_TYPE_DSA_PUBLIC_KEY, key_attrs,
+ num_key_attrs, &pub_key_handle)))
+ goto out;
+
+ xtest_add_attr(&num_key_attrs, key_attrs,
+ TEE_ATTR_DSA_PRIVATE_VALUE,
+ tv->params.dsa.priv_val,
+ tv->params.dsa.priv_val_len);
+
+ if (!ADBG_EXPECT_TRUE(c,
+ create_key(c, &session, max_key_size,
+ TEE_TYPE_DSA_KEYPAIR, key_attrs,
+ num_key_attrs, &priv_key_handle)))
+ goto out;
+ break;
+
+ default:
+ ADBG_EXPECT_TRUE(c, false);
+ goto out;
+ }
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ switch (tv->mode) {
+ case TEE_MODE_ENCRYPT:
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session,
+ &op, tv->algo, TEE_MODE_ENCRYPT, max_key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op,
+ pub_key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ pub_key_handle)))
+ goto out;
+ pub_key_handle = TEE_HANDLE_NULL;
+
+ out_enc_size = sizeof(out_enc);
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_asymmetric_encrypt(c, &session, op,
+ NULL, 0, tv->ptx, tv->ptx_len, out_enc,
+ &out_enc_size)))
+ goto out;
+
+ /*
+ * A PS which is random is added when formatting the
+ * message internally of the algorithm so we can't
+ * verify against precomputed values, instead we use the
+ * decrypt operation to see that output is correct.
+ */
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session,
+ &op, tv->algo, TEE_MODE_DECRYPT,
+ max_key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op,
+ priv_key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ priv_key_handle)))
+ goto out;
+
+ priv_key_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_asymmetric_decrypt(c, &session, op,
+ NULL, 0, out_enc, out_enc_size, out,
+ &out_size)))
+ goto out;
+
+ (void)ADBG_EXPECT_BUFFER(c, tv->ptx, tv->ptx_len, out,
+ out_size);
+ break;
+
+ case TEE_MODE_DECRYPT:
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session,
+ &op, tv->algo, TEE_MODE_DECRYPT,
+ max_key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op,
+ priv_key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ priv_key_handle)))
+ goto out;
+
+ priv_key_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_asymmetric_decrypt(c, &session, op,
+ NULL, 0, tv->ctx, tv->ctx_len, out,
+ &out_size)))
+ goto out;
+
+ (void)ADBG_EXPECT_BUFFER(c, tv->ptx, tv->ptx_len, out,
+ out_size);
+ break;
+
+ case TEE_MODE_VERIFY:
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session,
+ &op, tv->algo, TEE_MODE_VERIFY,
+ max_key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op,
+ pub_key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ pub_key_handle)))
+ goto out;
+
+ pub_key_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_asymmetric_verify(c, &session, op,
+ algo_params, num_algo_params, ptx_hash,
+ ptx_hash_size, tv->ctx, tv->ctx_len)))
+ goto out;
+ break;
+
+ case TEE_MODE_SIGN:
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session,
+ &op, tv->algo, TEE_MODE_SIGN,
+ max_key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op,
+ priv_key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ priv_key_handle)))
+ goto out;
+
+ priv_key_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_asymmetric_sign(c, &session, op,
+ algo_params, num_algo_params, ptx_hash,
+ ptx_hash_size, out, &out_size)))
+ goto out;
+
+ if (TEE_ALG_GET_CHAIN_MODE(tv->algo) ==
+ TEE_CHAIN_MODE_PKCS1_PSS_MGF1 ||
+ tv->algo == TEE_ALG_DSA_SHA1) {
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session,
+ op)))
+ goto out;
+ /*
+ * The salt or K is random so we can't verify
+ * signing against precomputed values, instead
+ * we use the verify operation to see that
+ * output is correct.
+ */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c,
+ &session, &op, tv->algo,
+ TEE_MODE_VERIFY, max_key_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c,
+ &session, op, pub_key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c,
+ &session, pub_key_handle)))
+ goto out;
+
+ pub_key_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_asymmetric_verify(c,
+ &session, op, algo_params,
+ num_algo_params, ptx_hash,
+ ptx_hash_size, out, out_size)))
+ goto out;
+ } else {
+ (void)ADBG_EXPECT_BUFFER(c, tv->ctx,
+ tv->ctx_len, out,
+ out_size);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ pub_key_handle)))
+ goto out;
+ pub_key_handle = TEE_HANDLE_NULL;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session,
+ priv_key_handle)))
+ goto out;
+
+ priv_key_handle = TEE_HANDLE_NULL;
+
+ Do_ADBG_EndSubCase(c, NULL);
+ }
+out:
+ TEEC_CloseSession(&session);
+}
+
+#define KEY_ATTR(x, y) { #x, (x), y }
+
+struct key_attrs {
+ const char *name;
+ uint32_t attr;
+ bool keysize_check;
+};
+
+static bool test_keygen_attributes(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_ObjectHandle key, uint32_t key_size,
+ struct key_attrs *attrs, size_t num_attrs)
+{
+ uint8_t out[2048];
+ size_t out_size;
+ size_t n;
+ size_t m;
+
+ for (m = 0; m < num_attrs; m++) {
+ if ((attrs[m].attr & TEE_ATTR_BIT_VALUE) == 0) {
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_get_object_buffer_attribute(c, s,
+ key, attrs[m].attr, out, &out_size)))
+ return false;
+
+ if (attrs[m].keysize_check)
+ ADBG_EXPECT_COMPARE_UNSIGNED(c, out_size, ==,
+ key_size / 8);
+
+ if (out_size > 0) {
+ /* Check that buffer isn't all zeroes */
+ for (n = 0; n < out_size; n++)
+ if (out[n] != 0)
+ break;
+ if (!ADBG_EXPECT_COMPARE_UNSIGNED(c, n, <,
+ out_size))
+ return false;
+ }
+ } else {
+ uint32_t a;
+ uint32_t b;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_get_object_value_attribute(c, s, key,
+ attrs[m].attr, &a, &b)))
+ return false;
+ }
+ }
+ return true;
+}
+
+static bool test_secret_value(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_ObjectHandle key, uint32_t key_size)
+{
+ const struct key_attrs attrs[] = {
+ KEY_ATTR(TEE_ATTR_SECRET_VALUE, true),
+ };
+
+ return test_keygen_attributes(c, s, key, key_size,
+ (struct key_attrs *)&attrs,
+ ARRAY_SIZE(attrs));
+}
+
+
+static bool test_rsa_key_pair(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_ObjectHandle key, uint32_t key_size)
+{
+ const struct key_attrs attrs[] = {
+ KEY_ATTR(TEE_ATTR_RSA_MODULUS, true),
+ KEY_ATTR(TEE_ATTR_RSA_PUBLIC_EXPONENT, false),
+ KEY_ATTR(TEE_ATTR_RSA_PRIVATE_EXPONENT, false),
+ KEY_ATTR(TEE_ATTR_RSA_PRIME1, false),
+ KEY_ATTR(TEE_ATTR_RSA_PRIME2, false),
+ KEY_ATTR(TEE_ATTR_RSA_EXPONENT1, false),
+ KEY_ATTR(TEE_ATTR_RSA_EXPONENT2, false),
+ KEY_ATTR(TEE_ATTR_RSA_COEFFICIENT, false),
+ };
+
+ return test_keygen_attributes(c, s, key, key_size,
+ (struct key_attrs *)&attrs,
+ ARRAY_SIZE(attrs));
+}
+
+static bool test_dh_key_pair(ADBG_Case_t *c, TEEC_Session *s,
+ uint32_t check_keysize,
+ TEE_ObjectHandle key, uint32_t key_size)
+{
+ const struct key_attrs attrs[] = {
+ KEY_ATTR(TEE_ATTR_DH_PRIME, false),
+ KEY_ATTR(TEE_ATTR_DH_BASE, false),
+ KEY_ATTR(TEE_ATTR_DH_PUBLIC_VALUE, false),
+ KEY_ATTR(TEE_ATTR_DH_PRIVATE_VALUE, check_keysize),
+ KEY_ATTR(TEE_ATTR_DH_X_BITS, false),
+ };
+
+ return test_keygen_attributes(c, s, key, key_size,
+ (struct key_attrs *)&attrs,
+ ARRAY_SIZE(attrs));
+}
+
+static bool test_dsa_key_pair(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_ObjectHandle key, uint32_t key_size)
+{
+ const struct key_attrs attrs[] = {
+ KEY_ATTR(TEE_ATTR_DSA_PRIME, true),
+ KEY_ATTR(TEE_ATTR_DSA_SUBPRIME, false),
+ KEY_ATTR(TEE_ATTR_DSA_BASE, false),
+ KEY_ATTR(TEE_ATTR_DSA_PUBLIC_VALUE, false),
+ KEY_ATTR(TEE_ATTR_DSA_PRIVATE_VALUE, false),
+ };
+
+ return test_keygen_attributes(c, s, key, key_size,
+ (struct key_attrs *)&attrs,
+ ARRAY_SIZE(attrs));
+}
+
+static bool generate_and_test_key(ADBG_Case_t *c, TEEC_Session *s,
+ uint32_t key_type, uint32_t check_keysize,
+ uint32_t key_size,
+ TEE_Attribute *params, size_t param_count)
+{
+ TEE_ObjectHandle key;
+ bool ret_val = true;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, s, key_type, key_size,
+ &key)))
+ return false;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_generate_key(c, s, key, key_size, params,
+ param_count)))
+ return false;
+
+ switch (key_type) {
+ case TEE_TYPE_DES:
+ case TEE_TYPE_DES3:
+ ret_val = ADBG_EXPECT_TRUE(c,
+ test_secret_value(c, s, key,
+ key_size + key_size / 7));
+ break;
+ case TEE_TYPE_AES:
+ case TEE_TYPE_HMAC_MD5:
+ case TEE_TYPE_HMAC_SHA1:
+ case TEE_TYPE_HMAC_SHA224:
+ case TEE_TYPE_HMAC_SHA256:
+ case TEE_TYPE_HMAC_SHA384:
+ case TEE_TYPE_HMAC_SHA512:
+ case TEE_TYPE_GENERIC_SECRET:
+ ret_val = ADBG_EXPECT_TRUE(c,
+ test_secret_value(c, s, key, key_size));
+ break;
+
+ case TEE_TYPE_RSA_KEYPAIR:
+ ret_val = ADBG_EXPECT_TRUE(c,
+ test_rsa_key_pair(c, s, key, key_size));
+ break;
+
+ case TEE_TYPE_DH_KEYPAIR:
+ ret_val =
+ ADBG_EXPECT_TRUE(c,
+ test_dh_key_pair(c, s, check_keysize, key,
+ key_size));
+ break;
+
+ case TEE_TYPE_DSA_KEYPAIR:
+ ret_val = ADBG_EXPECT_TRUE(c,
+ test_dsa_key_pair(c, s, key, key_size));
+ break;
+
+ default:
+ ret_val = false;
+ break;
+ }
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, s, key)))
+ return false;
+
+ return ret_val;
+}
+
+static void xtest_test_keygen_noparams(ADBG_Case_t *c, TEEC_Session *session)
+{
+ size_t n;
+ uint32_t key_size;
+ static const struct {
+ const char *name;
+ uint32_t key_type;
+ uint32_t quanta;
+ uint32_t min_size;
+ uint32_t max_size;
+ } key_types[] = {
+ { "AES", TEE_TYPE_AES, 64, 128,
+ 256 /* valid sizes 128, 192, 256 */ },
+ { "DES", TEE_TYPE_DES, 56, 56, 56 /* valid size 56 */ },
+ { "DES3", TEE_TYPE_DES3, 56, 112,
+ 168 /* valid sizes 112, 168 */ },
+ { "HMAC-MD5", TEE_TYPE_HMAC_MD5, 8, 64, 512 },
+ { "HMAC-SHA1", TEE_TYPE_HMAC_SHA1, 8, 80, 512 },
+ { "HMAC-SHA224", TEE_TYPE_HMAC_SHA224, 8, 112, 512 },
+ { "HMAC-SHA256", TEE_TYPE_HMAC_SHA256, 8, 192, 1024 },
+ { "HMAC-SHA384", TEE_TYPE_HMAC_SHA384, 8, 256, 1024 },
+ { "HMAC-SHA512", TEE_TYPE_HMAC_SHA512, 8, 256, 1024 },
+ { "Generic secret", TEE_TYPE_GENERIC_SECRET, 8, 128, 4096 },
+ { "RSA-2048", TEE_TYPE_RSA_KEYPAIR, 1, 2048, 2048 },
+
+ /* New tests added to check non-regression of issue #5398 */
+ { "RSA-256", TEE_TYPE_RSA_KEYPAIR, 1, 256, 256 },
+ { "RSA-384", TEE_TYPE_RSA_KEYPAIR, 1, 384, 384 },
+ { "RSA-512", TEE_TYPE_RSA_KEYPAIR, 1, 512, 512 },
+ { "RSA-640", TEE_TYPE_RSA_KEYPAIR, 1, 640, 640 },
+ { "RSA-768", TEE_TYPE_RSA_KEYPAIR, 1, 768, 768 },
+ { "RSA-896", TEE_TYPE_RSA_KEYPAIR, 1, 896, 896 },
+ { "RSA-1024", TEE_TYPE_RSA_KEYPAIR, 1, 1024, 1024 },
+ };
+
+ for (n = 0; n < ARRAY_SIZE(key_types); n++) {
+ uint32_t min_size = key_types[n].min_size;
+ uint32_t max_size = key_types[n].max_size;
+ uint32_t quanta = key_types[n].quanta;
+
+ Do_ADBG_BeginSubCase(c, "Generate %s key", key_types[n].name);
+
+ for (key_size = min_size; key_size <= max_size;
+ key_size += quanta) {
+ if (!ADBG_EXPECT_TRUE(c,
+ generate_and_test_key(c, session, key_types
+ [n].key_type, 1, key_size, NULL, 0)))
+ break;
+ }
+
+ Do_ADBG_EndSubCase(c, "Generate %s key", key_types[n].name);
+ }
+}
+
+static void xtest_test_keygen_dh(ADBG_Case_t *c, TEEC_Session *session)
+{
+ size_t n;
+ size_t param_count;
+ /*
+ * Note that the key size parameter is not used when creating the keys
+ * but specifying these sizes make it possible to test the expected size
+ * of the private value. This also means that the keysize must match the
+ * size of p or what is specified in private_bits or the equvivalent
+ * size of the subprime parameter.
+ */
+ TEE_Attribute params[4];
+
+#define XTEST_DH_GK_DATA(vect) \
+ ARRAY(vect ## _p), \
+ ARRAY(vect ## _g), \
+ &vect ## _private_bits, \
+ 0, 0
+#define XTEST_DH_GK_DATA_SUBPRIME(vect) \
+ ARRAY(vect ## _p), \
+ ARRAY(vect ## _g), \
+ &vect ## _private_bits, \
+ ARRAY(vect ## _subprime)
+ static const struct {
+ uint32_t key_size;
+ const uint8_t *p;
+ size_t p_len;
+ const uint8_t *g;
+ size_t g_len;
+ const uint32_t *private_bits;
+ const uint8_t *subprime;
+ size_t subprime_len;
+ } key_types[] = {
+ { 256, XTEST_DH_GK_DATA(keygen_dh256) },
+ { 256, XTEST_DH_GK_DATA(keygen_dh320) },
+ { 384, XTEST_DH_GK_DATA(keygen_dh384) },
+ { 256, XTEST_DH_GK_DATA(keygen_dh448) },
+ { 512, XTEST_DH_GK_DATA(keygen_dh512) },
+ { 288, XTEST_DH_GK_DATA(keygen_dh576) },
+ { 640, XTEST_DH_GK_DATA(keygen_dh640) },
+ { 352, XTEST_DH_GK_DATA(keygen_dh704) },
+ { 768, XTEST_DH_GK_DATA(keygen_dh768) },
+ { 416, XTEST_DH_GK_DATA(keygen_dh832) },
+ { 896, XTEST_DH_GK_DATA(keygen_dh896) },
+ { 480, XTEST_DH_GK_DATA(keygen_dh960) },
+ { 1024, XTEST_DH_GK_DATA(keygen_dh1024) },
+ { 544, XTEST_DH_GK_DATA(keygen_dh1088) },
+ { 1152, XTEST_DH_GK_DATA(keygen_dh1152) },
+ { 608, XTEST_DH_GK_DATA(keygen_dh1216) },
+ { 1280, XTEST_DH_GK_DATA(keygen_dh1280) },
+ { 672, XTEST_DH_GK_DATA(keygen_dh1344) },
+ { 1408, XTEST_DH_GK_DATA(keygen_dh1408) },
+ { 736, XTEST_DH_GK_DATA(keygen_dh1472) },
+ { 1536, XTEST_DH_GK_DATA(keygen_dh1536) },
+ { 800, XTEST_DH_GK_DATA(keygen_dh1600) },
+ { 1664, XTEST_DH_GK_DATA(keygen_dh1664) },
+ { 864, XTEST_DH_GK_DATA(keygen_dh1728) },
+ { 1792, XTEST_DH_GK_DATA(keygen_dh1792) },
+ { 928, XTEST_DH_GK_DATA(keygen_dh1856) },
+ { 1920, XTEST_DH_GK_DATA(keygen_dh1920) },
+ { 992, XTEST_DH_GK_DATA(keygen_dh1984) },
+ { 2048, XTEST_DH_GK_DATA(keygen_dh2048) },
+ { 256, XTEST_DH_GK_DATA_SUBPRIME(keygen_dh2048_subprime) }
+ };
+
+
+ for (n = 0; n < ARRAY_SIZE(key_types); n++) {
+ Do_ADBG_BeginSubCase(c,
+ "Generate DH key %d bits - Private bits = %d",
+ key_types[n].key_size,
+ *key_types[n].private_bits);
+ param_count = 0;
+
+ xtest_add_attr(¶m_count, params,
+ TEE_ATTR_DH_PRIME,
+ key_types[n].p, key_types[n].p_len);
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DH_BASE,
+ key_types[n].g, key_types[n].g_len);
+
+ if (key_types[n].private_bits != 0) {
+ params[param_count].attributeID = TEE_ATTR_DH_X_BITS;
+
+ params[param_count].content.value.a =
+ *key_types[n].private_bits;
+
+ params[param_count].content.value.b = 0;
+ param_count++;
+ }
+
+ if (key_types[n].subprime != 0) {
+ xtest_add_attr(¶m_count, params,
+ TEE_ATTR_DH_SUBPRIME,
+ key_types[n].subprime,
+ key_types[n].subprime_len);
+ }
+
+ if (!ADBG_EXPECT_TRUE(c,
+ generate_and_test_key(c, session, TEE_TYPE_DH_KEYPAIR,
+ ((*key_types[n].private_bits) != 0),
+ key_types[n]. key_size, params, param_count)))
+ break;
+
+ Do_ADBG_EndSubCase(c,
+ "Generate DH key %d bits - Private bits = %d",
+ key_types[n].key_size,
+ *key_types[n].private_bits);
+ }
+}
+
+static void xtest_test_keygen_dsa(ADBG_Case_t *c, TEEC_Session *session)
+{
+ size_t n;
+ size_t param_count;
+ TEE_Attribute params[4];
+
+#define XTEST_DSA_GK_DATA(vect) \
+ ARRAY(vect ## _p), \
+ ARRAY(vect ## _g), \
+ ARRAY(vect ## _q)
+ static const struct {
+ uint32_t key_size;
+ const uint8_t *prime;
+ size_t prime_len;
+ const uint8_t *base;
+ size_t base_len;
+ const uint8_t *sub_prime;
+ size_t sub_prime_len;
+ } key_types[] = {
+ { 1024, XTEST_DSA_GK_DATA(keygen_dsa_test1) },
+ { 512, XTEST_DSA_GK_DATA(keygen_dsa512) },
+ { 576, XTEST_DSA_GK_DATA(keygen_dsa576) },
+ { 640, XTEST_DSA_GK_DATA(keygen_dsa640) },
+ { 704, XTEST_DSA_GK_DATA(keygen_dsa704) },
+ { 768, XTEST_DSA_GK_DATA(keygen_dsa768) },
+ { 832, XTEST_DSA_GK_DATA(keygen_dsa832) },
+ { 896, XTEST_DSA_GK_DATA(keygen_dsa896) },
+ { 960, XTEST_DSA_GK_DATA(keygen_dsa960) },
+ { 1024, XTEST_DSA_GK_DATA(keygen_dsa1024) },
+ };
+
+ for (n = 0; n < ARRAY_SIZE(key_types); n++) {
+ Do_ADBG_BeginSubCase(c, "Generate DSA key %d bits",
+ key_types[n].key_size);
+ param_count = 0;
+
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DSA_PRIME,
+ key_types[n].prime, key_types[n].prime_len);
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DSA_SUBPRIME,
+ key_types[n].sub_prime,
+ key_types[n].sub_prime_len);
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DSA_BASE,
+ key_types[n].base, key_types[n].base_len);
+
+ if (!ADBG_EXPECT_TRUE(c,
+ generate_and_test_key(c, session, TEE_TYPE_DSA_KEYPAIR,
+ 1, key_types[n]. key_size, params,
+ param_count)))
+ break;
+
+ Do_ADBG_EndSubCase(c, "Generate DSA key %d bits",
+ key_types[n].key_size);
+ }
+}
+
+static void xtest_tee_test_4007(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ xtest_test_keygen_noparams(c, &session);
+
+ xtest_test_keygen_dh(c, &session);
+
+ xtest_test_keygen_dsa(c, &session);
+
+ TEEC_CloseSession(&session);
+}
+
+static void xtest_tee_test_4008(ADBG_Case_t *c)
+{
+ TEEC_Session session = { 0 };
+ uint32_t ret_orig;
+ TEE_OperationHandle op;
+ TEE_ObjectHandle key_handle;
+ TEE_ObjectHandle sv_handle;
+ TEE_Attribute params[4];
+ size_t param_count = 0;
+ uint8_t out[2048];
+ size_t out_size;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&session, &crypt_user_ta_uuid, NULL,
+ &ret_orig)))
+ return;
+
+ Do_ADBG_BeginSubCase(c, "Derive DH key success");
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_operation(c, &session, &op,
+ TEE_ALG_DH_DERIVE_SHARED_SECRET, TEE_MODE_DERIVE,
+ derive_key_max_keysize)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, & session,
+ TEE_TYPE_DH_KEYPAIR, derive_key_max_keysize,
+ &key_handle)))
+ goto out;
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DH_PRIME,
+ ARRAY(derive_key_dh_prime));
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DH_BASE,
+ ARRAY(derive_key_dh_base));
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DH_PUBLIC_VALUE,
+ ARRAY(derive_key_dh_public_value));
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DH_PRIVATE_VALUE,
+ ARRAY(derive_key_dh_private_value));
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_populate_transient_object(c, &session, key_handle,
+ params, param_count)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_set_operation_key(c, &session, op, key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, & session, key_handle)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_allocate_transient_object(c, &session,
+ TEE_TYPE_GENERIC_SECRET, derive_key_max_keysize,
+ &sv_handle)))
+ goto out;
+
+ /* resuse but reset params and param-count */
+ param_count = 0;
+
+ xtest_add_attr(¶m_count, params, TEE_ATTR_DH_PUBLIC_VALUE,
+ ARRAY(derive_key_dh_public_value_2));
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_derive_key(c, &session, op, sv_handle, params,
+ param_count)))
+ goto out;
+
+ out_size = sizeof(out);
+ memset(out, 0, sizeof(out));
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_get_object_buffer_attribute(c, &session, sv_handle,
+ TEE_ATTR_SECRET_VALUE, out, &out_size)))
+ goto out;
+
+ if (!ADBG_EXPECT_BUFFER(c, derive_key_dh_shared_secret,
+ sizeof(derive_key_dh_shared_secret), out,
+ out_size))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_operation(c, &session, op)))
+ goto out;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ ta_crypt_cmd_free_transient_object(c, &session, sv_handle)))
+ goto out;
+out:
+ Do_ADBG_EndSubCase(c, "Derive DH key success");
+ TEEC_CloseSession(&session);
+}
diff --git a/host/xtest/xtest_4000_data.h b/host/xtest/xtest_4000_data.h
new file mode 100644
index 0000000..9c6e2bc
--- /dev/null
+++ b/host/xtest/xtest_4000_data.h
@@ -0,0 +1,6091 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef XTEST_4000_DATA_H
+#define XTEST_4000_DATA_H
+#include <stdint.h>
+
+/*
+ * XTS-AES Test data from:
+ * http://grouper.ieee.org/groups/1619/email/pdf00086.pdf
+ */
+
+/*
+ * XTS-AES applied for a data unit of 32 bytes, 32 bytes key material.
+ */
+
+/* Vector 1 */
+static const uint8_t ciph_data_aes_xts_vect1_key1[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const uint8_t ciph_data_aes_xts_vect1_key2[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const uint8_t ciph_data_aes_xts_vect1_iv[16] = {
+ 0x0
+};
+static const uint8_t ciph_data_aes_xts_vect1_ptx[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+/* TWK 66e94bd4ef8a2c3b884cfa59ca342b2eccd297a8df1559761099f4b39469565c */
+static const uint8_t ciph_data_aes_xts_vect1_ctx[] = {
+ 0x91, 0x7c, 0xf6, 0x9e, 0xbd, 0x68, 0xb2, 0xec,
+ 0x9b, 0x9f, 0xe9, 0xa3, 0xea, 0xdd, 0xa6, 0x92,
+ 0xcd, 0x43, 0xd2, 0xf5, 0x95, 0x98, 0xed, 0x85,
+ 0x8c, 0x02, 0xc2, 0x65, 0x2f, 0xbf, 0x92, 0x2e,
+};
+
+/* Vector 2 */
+static const uint8_t ciph_data_aes_xts_vect2_key1[] = {
+ 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
+ 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
+};
+static const uint8_t ciph_data_aes_xts_vect2_key2[] = {
+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
+};
+static const uint8_t ciph_data_aes_xts_vect2_iv[16] = {
+ 0x33, 0x33, 0x33, 0x33, 0x33
+};
+static const uint8_t ciph_data_aes_xts_vect2_ptx[] = {
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+};
+/* TWK 3f803bcd0d7fd2b37558419f59d5cda6f900779a1bfea467ebb0823eb3aa9b4d */
+static const uint8_t ciph_data_aes_xts_vect2_ctx[] = {
+ 0xc4, 0x54, 0x18, 0x5e, 0x6a, 0x16, 0x93, 0x6e,
+ 0x39, 0x33, 0x40, 0x38, 0xac, 0xef, 0x83, 0x8b,
+ 0xfb, 0x18, 0x6f, 0xff, 0x74, 0x80, 0xad, 0xc4,
+ 0x28, 0x93, 0x82, 0xec, 0xd6, 0xd3, 0x94, 0xf0,
+};
+
+/* Vector 3 */
+static const uint8_t ciph_data_aes_xts_vect3_key1[] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
+};
+static const uint8_t ciph_data_aes_xts_vect3_key2[] = {
+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
+};
+static const uint8_t ciph_data_aes_xts_vect3_iv[16] = {
+ 0x33, 0x33, 0x33, 0x33, 0x33
+};
+static const uint8_t ciph_data_aes_xts_vect3_ptx[] = {
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+};
+/* TWK 3f803bcd0d7fd2b37558419f59d5cda6f900779a1bfea467ebb0823eb3aa9b4d */
+static const uint8_t ciph_data_aes_xts_vect3_ctx[] = {
+ 0xaf, 0x85, 0x33, 0x6b, 0x59, 0x7a, 0xfc, 0x1a,
+ 0x90, 0x0b, 0x2e, 0xb2, 0x1e, 0xc9, 0x49, 0xd2,
+ 0x92, 0xdf, 0x4c, 0x04, 0x7e, 0x0b, 0x21, 0x53,
+ 0x21, 0x86, 0xa5, 0x97, 0x1a, 0x22, 0x7a, 0x89,
+};
+
+/*
+ * XTS-AES-128 applied for a data unit of 512 bytes
+ */
+
+/* Vector 4 */
+static const uint8_t ciph_data_aes_xts_vect4_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+};
+static const uint8_t ciph_data_aes_xts_vect4_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+};
+static const uint8_t ciph_data_aes_xts_vect4_iv[16] = {
+ 0x00
+};
+static const uint8_t ciph_data_aes_xts_vect4_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 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 0x4a, 0x42, 0x7d, 0x19, 0x23, 0xce, 0x3f,
+ 0xf2, 0x62, 0x73, 0x57, 0x79, 0xa4, 0x18, 0xf2,
+ 0x0a, 0x28, 0x2d, 0xf9, 0x20, 0x14, 0x7b, 0xea,
+ 0xbe, 0x42, 0x1e, 0xe5, 0x31, 0x9d, 0x05, 0x68,
+};
+
+/* Vector 5 */
+static const uint8_t ciph_data_aes_xts_vect5_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+};
+static const uint8_t ciph_data_aes_xts_vect5_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+};
+static const uint8_t ciph_data_aes_xts_vect5_iv[16] = {
+ 0x01
+};
+static const uint8_t ciph_data_aes_xts_vect5_ptx[] = {
+ 0x27, 0xa7, 0x47, 0x9b, 0xef, 0xa1, 0xd4, 0x76,
+ 0x48, 0x9f, 0x30, 0x8c, 0xd4, 0xcf, 0xa6, 0xe2,
+ 0xa9, 0x6e, 0x4b, 0xbe, 0x32, 0x08, 0xff, 0x25,
+ 0x28, 0x7d, 0xd3, 0x81, 0x96, 0x16, 0xe8, 0x9c,
+
+ 0xc7, 0x8c, 0xf7, 0xf5, 0xe5, 0x43, 0x44, 0x5f,
+ 0x83, 0x33, 0xd8, 0xfa, 0x7f, 0x56, 0x00, 0x00,
+ 0x05, 0x27, 0x9f, 0xa5, 0xd8, 0xb5, 0xe4, 0xad,
+ 0x40, 0xe7, 0x36, 0xdd, 0xb4, 0xd3, 0x54, 0x12,
+
+ 0x32, 0x80, 0x63, 0xfd, 0x2a, 0xab, 0x53, 0xe5,
+ 0xea, 0x1e, 0x0a, 0x9f, 0x33, 0x25, 0x00, 0xa5,
+ 0xdf, 0x94, 0x87, 0xd0, 0x7a, 0x5c, 0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8b, 0x43,
+ 0x97, 0x18, 0x4b, 0x74, 0x71, 0x36, 0x0c, 0x95,
+ 0x64, 0x88, 0x0a, 0xed, 0xdd, 0xb9, 0xba, 0xa4,
+ 0xaf, 0x2e, 0x75, 0x39, 0x4b, 0x08, 0xcd, 0x32,
+
+ 0xff, 0x47, 0x9c, 0x57, 0xa0, 0x7d, 0x3e, 0xab,
+ 0x5d, 0x54, 0xde, 0x5f, 0x97, 0x38, 0xb8, 0xd2,
+ 0x7f, 0x27, 0xa9, 0xf0, 0xab, 0x11, 0x79, 0x9d,
+ 0x7b, 0x7f, 0xfe, 0xfb, 0x27, 0x04, 0xc9, 0x5c,
+
+ 0x6a, 0xd1, 0x2c, 0x39, 0xf1, 0xe8, 0x67, 0xa4,
+ 0xb7, 0xb1, 0xd7, 0x81, 0x8a, 0x4b, 0x75, 0x3d,
+ 0xfd, 0x2a, 0x89, 0xcc, 0xb4, 0x5e, 0x00, 0x1a,
+ 0x03, 0xa8, 0x67, 0xb1, 0x87, 0xf2, 0x25, 0xdd,
+};
+
+/* Vector 6 */
+static const uint8_t ciph_data_aes_xts_vect6_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+};
+static const uint8_t ciph_data_aes_xts_vect6_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+};
+static const uint8_t ciph_data_aes_xts_vect6_iv[16] = {
+ 0x02
+};
+static const uint8_t ciph_data_aes_xts_vect6_ptx[] = {
+ 0x26, 0x4d, 0x3c, 0xa8, 0x51, 0x21, 0x94, 0xfe,
+ 0xc3, 0x12, 0xc8, 0xc9, 0x89, 0x1f, 0x27, 0x9f,
+ 0xef, 0xdd, 0x60, 0x8d, 0x0c, 0x02, 0x7b, 0x60,
+ 0x48, 0x3a, 0x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, 0x9a, 0x6b, 0x6e,
+ 0xeb, 0xe0, 0xc5, 0x37, 0x90, 0xa1, 0x2a, 0x89,
+ 0x98, 0x37, 0x8b, 0x33, 0xa5, 0xb7, 0x11, 0x59,
+
+ 0x62, 0x5f, 0x4b, 0xa4, 0x9d, 0x2a, 0x2f, 0xdb,
+ 0xa5, 0x9f, 0xbf, 0x08, 0x97, 0xbc, 0x7a, 0xab,
+ 0xd8, 0xd7, 0x07, 0xdc, 0x14, 0x0a, 0x80, 0xf0,
+ 0xf3, 0x09, 0xf8, 0x35, 0xd3, 0xda, 0x54, 0xab,
+
+ 0x58, 0x4e, 0x50, 0x1d, 0xfa, 0x0e, 0xe9, 0x77,
+ 0xfe, 0xc5, 0x43, 0xf7, 0x41, 0x86, 0xa8, 0x02,
+ 0xb9, 0xa3, 0x7a, 0xdb, 0x3e, 0x82, 0x91, 0xec,
+ 0xa0, 0x4d, 0x66, 0x52, 0x0d, 0x22, 0x9e, 0x60,
+
+ 0x40, 0x1e, 0x72, 0x82, 0xbe, 0xf4, 0x86, 0xae,
+ 0x05, 0x9a, 0xa7, 0x06, 0x96, 0xe0, 0xe3, 0x05,
+ 0xd7, 0x77, 0x14, 0x0a, 0x7a, 0x88, 0x3e, 0xcd,
+ 0xcb, 0x69, 0xb9, 0xff, 0x93, 0x8e, 0x8a, 0x42,
+
+ 0x31, 0x86, 0x4c, 0x69, 0xca, 0x2c, 0x20, 0x43,
+ 0xbe, 0xd0, 0x07, 0xff, 0x3e, 0x60, 0x5e, 0x01,
+ 0x4b, 0xcf, 0x51, 0x81, 0x38, 0xdc, 0x3a, 0x25,
+ 0xc5, 0xe2, 0x36, 0x17, 0x1a, 0x2d, 0x01, 0xd6,
+};
+
+/* Vector 7 */
+static const uint8_t ciph_data_aes_xts_vect7_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+};
+static const uint8_t ciph_data_aes_xts_vect7_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+};
+static const uint8_t ciph_data_aes_xts_vect7_iv[16] = {
+ 0xfd
+};
+static const uint8_t ciph_data_aes_xts_vect7_ptx[] = {
+ 0x8e, 0x41, 0xb7, 0x8c, 0x39, 0x0b, 0x5a, 0xf9,
+ 0xd7, 0x58, 0xbb, 0x21, 0x4a, 0x67, 0xe9, 0xf6,
+ 0xbf, 0x77, 0x27, 0xb0, 0x9a, 0xc6, 0x12, 0x40,
+ 0x84, 0xc3, 0x76, 0x11, 0x39, 0x8f, 0xa4, 0x5d,
+
+ 0xaa, 0xd9, 0x48, 0x68, 0x60, 0x0e, 0xd3, 0x91,
+ 0xfb, 0x1a, 0xcd, 0x48, 0x57, 0xa9, 0x5b, 0x46,
+ 0x6e, 0x62, 0xef, 0x9f, 0x4b, 0x37, 0x72, 0x44,
+ 0xd1, 0xc1, 0x52, 0xe7, 0xb3, 0x0d, 0x73, 0x1a,
+
+ 0xad, 0x30, 0xc7, 0x16, 0xd2, 0x14, 0xb7, 0x07,
+ 0xae, 0xd9, 0x9e, 0xb5, 0xb5, 0xe5, 0x80, 0xb3,
+ 0xe8, 0x87, 0xcf, 0x74, 0x97, 0x46, 0x56, 0x51,
+ 0xd4, 0xb6, 0x0e, 0x60, 0x42, 0x05, 0x1d, 0xa3,
+
+ 0x69, 0x3c, 0x3b, 0x78, 0xc1, 0x44, 0x89, 0x54,
+ 0x3b, 0xe8, 0xb6, 0xad, 0x0b, 0xa6, 0x29, 0x56,
+ 0x5b, 0xba, 0x20, 0x23, 0x13, 0xba, 0x7b, 0x0d,
+ 0x0c, 0x94, 0xa3, 0x25, 0x2b, 0x67, 0x6f, 0x46,
+
+ 0xcc, 0x02, 0xce, 0x0f, 0x8a, 0x7d, 0x34, 0xc0,
+ 0xed, 0x22, 0x91, 0x29, 0x67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0xa6, 0xb3,
+
+ 0x25, 0x28, 0xf4, 0xef, 0x78, 0xee, 0xd7, 0x78,
+ 0xb2, 0xe1, 0x22, 0xdd, 0xfd, 0x1c, 0xbd, 0xd1,
+ 0x1d, 0x1c, 0x0a, 0x67, 0x83, 0xe0, 0x11, 0xfc,
+ 0x53, 0x6d, 0x63, 0xd0, 0x53, 0x26, 0x06, 0x37,
+};
+
+/* Vector 8 */
+static const uint8_t ciph_data_aes_xts_vect8_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+};
+static const uint8_t ciph_data_aes_xts_vect8_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+};
+static const uint8_t ciph_data_aes_xts_vect8_iv[16] = {
+ 0xfe
+};
+static const uint8_t ciph_data_aes_xts_vect8_ptx[] = {
+ 0xd5, 0x5f, 0x68, 0x4f, 0x81, 0xf4, 0x42, 0x6e,
+ 0x9f, 0xde, 0x92, 0xa5, 0xff, 0x02, 0xdf, 0x2a,
+ 0xc8, 0x96, 0xaf, 0x63, 0x96, 0x28, 0x88, 0xa9,
+ 0x79, 0x10, 0xc1, 0x37, 0x9e, 0x20, 0xb0, 0xa3,
+
+ 0xb1, 0xdb, 0x61, 0x3f, 0xb7, 0xfe, 0x2e, 0x07,
+ 0x00, 0x43, 0x29, 0xea, 0x5c, 0x22, 0xbf, 0xd3,
+ 0x3e, 0x3d, 0xbe, 0x4c, 0xf5, 0x8c, 0xc6, 0x08,
+ 0xc2, 0xc2, 0x6c, 0x19, 0xa2, 0xe2, 0xfe, 0x22,
+
+ 0xf9, 0x87, 0x32, 0xc2, 0xb5, 0xcb, 0x84, 0x4c,
+ 0xc6, 0xc0, 0x70, 0x2d, 0x91, 0xe1, 0xd5, 0x0f,
+ 0xc4,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 0x18, 0x2f, 0x88, 0x40, 0xb0, 0x9d, 0x05,
+ 0x95, 0x85, 0xc3, 0x1a, 0xd6, 0x91, 0xfa, 0x06,
+ 0x19, 0xff, 0x03, 0x8a, 0xca, 0x2c, 0x39, 0xa9,
+ 0x43, 0x42, 0x11, 0x57, 0x36, 0x17, 0x17, 0xc4,
+
+ 0x9d, 0x32, 0x20, 0x28, 0xa7, 0x46, 0x48, 0x11,
+ 0x3b, 0xd8, 0xc9, 0xd7, 0xec, 0x77, 0xcf, 0x3c,
+ 0x89, 0xc1, 0xec, 0x87, 0x18, 0xce, 0xff, 0x85,
+ 0x16, 0xd9, 0x6b, 0x34, 0xc3, 0xc6, 0x14, 0xf1,
+
+ 0x06, 0x99, 0xc9, 0xab, 0xc4, 0xed, 0x04, 0x11,
+ 0x50, 0x62, 0x23, 0xbe, 0xa1, 0x6a, 0xf3, 0x5c,
+ 0x88, 0x3a, 0xcc, 0xdb, 0xe1, 0x10, 0x4e, 0xef,
+ 0x0c, 0xfd, 0xb5, 0x4e, 0x12, 0xfb, 0x23, 0x0a,
+};
+
+/* Vector 9 */
+static const uint8_t ciph_data_aes_xts_vect9_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+};
+static const uint8_t ciph_data_aes_xts_vect9_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+};
+static const uint8_t ciph_data_aes_xts_vect9_iv[16] = {
+ 0xff
+};
+static const uint8_t ciph_data_aes_xts_vect9_ptx[] = {
+ 0x72, 0xef, 0xc1, 0xeb, 0xfe, 0x1e, 0xe2, 0x59,
+ 0x75, 0xa6, 0xeb, 0x3a, 0xa8, 0x58, 0x9d, 0xda,
+ 0x2b, 0x26, 0x1f, 0x1c, 0x85, 0xbd, 0xab, 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0x86, 0x6b, 0xad,
+ 0x22, 0xc8, 0x6a, 0x60, 0x36, 0xb2, 0x51, 0x8b,
+ 0x20, 0x59, 0xb4, 0x22, 0x9d, 0x18, 0xc8, 0xc2,
+ 0xcc, 0xbd, 0xf9, 0x06, 0xc6, 0xcc, 0x6e, 0x82,
+
+ 0x46, 0x4e, 0xe5, 0x7b, 0xdd, 0xb0, 0xbe, 0xbc,
+ 0xb1, 0xdc, 0x64, 0x53, 0x25, 0xbf, 0xb3, 0xe6,
+ 0x65, 0xef, 0x72, 0x51, 0x08, 0x2c, 0x88, 0xeb,
+ 0xb1, 0xcf, 0x20, 0x3b, 0xd7, 0x79, 0xfd, 0xd3,
+
+ 0x86, 0x75, 0x71, 0x3c, 0x8d, 0xaa, 0xdd, 0x17,
+ 0xe1, 0xca, 0xbe, 0xe4, 0x32, 0xb0, 0x97, 0x87,
+ 0xb6, 0xdd, 0xf3, 0x30, 0x4e, 0x38, 0xb7, 0x31,
+ 0xb4, 0x5d, 0xf5, 0xdf, 0x51, 0xb7, 0x8f, 0xcf,
+
+ 0xb3, 0xd3, 0x24, 0x66, 0x02, 0x8d, 0x0b, 0xa3,
+ 0x65, 0x55, 0xe7, 0xe1, 0x1a, 0xb0, 0xee, 0x06,
+ 0x66, 0x06, 0x1d, 0x16, 0x45, 0xd9, 0x62, 0x44,
+ 0x4b, 0xc4, 0x7a, 0x38, 0x18, 0x89, 0x30, 0xa8,
+
+ 0x4b, 0x4d, 0x56, 0x13, 0x95, 0xc7, 0x3c, 0x08,
+ 0x70, 0x21, 0x92, 0x7c, 0xa6, 0x38, 0xb7, 0xaf,
+ 0xc8, 0xa8, 0x67, 0x9c, 0xcb, 0x84, 0xc2, 0x65,
+ 0x55, 0x44, 0x0e, 0xc7, 0xf1, 0x04, 0x45, 0xcd,
+};
+
+/*
+ * XTS-AES-256 applied for a data unit of 512 bytes
+ */
+
+/* Vector 10 */
+static const uint8_t ciph_data_aes_xts_vect10_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+ 0x62, 0x49, 0x77, 0x57, 0x24, 0x70, 0x93, 0x69,
+ 0x99, 0x59, 0x57, 0x49, 0x66, 0x96, 0x76, 0x27,
+};
+static const uint8_t ciph_data_aes_xts_vect10_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+ 0x02, 0x88, 0x41, 0x97, 0x16, 0x93, 0x99, 0x37,
+ 0x51, 0x05, 0x82, 0x09, 0x74, 0x94, 0x45, 0x92,
+};
+static const uint8_t ciph_data_aes_xts_vect10_iv[16] = {
+ 0xff
+};
+static const uint8_t ciph_data_aes_xts_vect10_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+
+ 0x60, 0x61, 0x62, 0x63, 0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xed,
+ 0x53, 0x76, 0x44, 0x1a, 0x77, 0xed, 0x43, 0x85,
+
+ 0x1a, 0xd7, 0x7f, 0x16, 0xf5, 0x41, 0xdf, 0xd2,
+ 0x69, 0xd5, 0x0d, 0x6a, 0x5f, 0x14, 0xfb, 0x0a,
+ 0xab, 0x1c, 0xbb, 0x4c, 0x15, 0x50, 0xbe, 0x97,
+ 0xf7, 0xab, 0x40, 0x66, 0x19, 0x3c, 0x4c, 0xaa,
+
+ 0x77, 0x3d, 0xad, 0x38, 0x01, 0x4b, 0xd2, 0x09,
+ 0x2f, 0xa7, 0x55, 0xc8, 0x24, 0xbb, 0x5e, 0x54,
+ 0xc4, 0xf3, 0x6f, 0xfd, 0xa9, 0xfc, 0xea, 0x70,
+ 0xb9, 0xc6, 0xe6, 0x93, 0xe1, 0x48, 0xc1, 0x51,
+};
+
+/* Vector 11 */
+static const uint8_t ciph_data_aes_xts_vect11_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+ 0x62, 0x49, 0x77, 0x57, 0x24, 0x70, 0x93, 0x69,
+ 0x99, 0x59, 0x57, 0x49, 0x66, 0x96, 0x76, 0x27,
+};
+static const uint8_t ciph_data_aes_xts_vect11_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+ 0x02, 0x88, 0x41, 0x97, 0x16, 0x93, 0x99, 0x37,
+ 0x51, 0x05, 0x82, 0x09, 0x74, 0x94, 0x45, 0x92,
+};
+static const uint8_t ciph_data_aes_xts_vect11_iv[16] = {
+ 0xff, 0xff
+};
+static const uint8_t ciph_data_aes_xts_vect11_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x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 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+ 0x62, 0x49, 0x77, 0x57, 0x24, 0x70, 0x93, 0x69,
+ 0x99, 0x59, 0x57, 0x49, 0x66, 0x96, 0x76, 0x27,
+};
+static const uint8_t ciph_data_aes_xts_vect12_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+ 0x02, 0x88, 0x41, 0x97, 0x16, 0x93, 0x99, 0x37,
+ 0x51, 0x05, 0x82, 0x09, 0x74, 0x94, 0x45, 0x92,
+};
+static const uint8_t ciph_data_aes_xts_vect12_iv[16] = {
+ 0xff, 0xff, 0xff
+};
+static const uint8_t ciph_data_aes_xts_vect12_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+
+ 0x60, 0x61, 0x62, 0x63, 0x64, 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xe5, 0x21, 0x7a, 0xc9, 0xd8, 0xeb,
+ 0xaf, 0xa7, 0x20, 0xe9, 0xda, 0x4f, 0x9a, 0xce,
+
+ 0x23, 0x1c, 0xc9, 0x49, 0xe5, 0xb9, 0x6f, 0xe7,
+ 0x6f, 0xfc, 0x21, 0x06, 0x3f, 0xdd, 0xc8, 0x3a,
+ 0x6b, 0x86, 0x79, 0xc0, 0x0d, 0x35, 0xe0, 0x95,
+ 0x76, 0xa8, 0x75, 0x30, 0x5b, 0xed, 0x5f, 0x36,
+
+ 0xed, 0x24, 0x2c, 0x89, 0x00, 0xdd, 0x1f, 0xa9,
+ 0x65, 0xbc, 0x95, 0x0d, 0xfc, 0xe0, 0x9b, 0x13,
+ 0x22, 0x63, 0xa1, 0xee, 0xf5, 0x2d, 0xd6, 0x88,
+ 0x8c, 0x30, 0x9f, 0x5a, 0x7d, 0x71, 0x28, 0x26,
+};
+
+/* Vector 13 */
+static const uint8_t ciph_data_aes_xts_vect13_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+ 0x62, 0x49, 0x77, 0x57, 0x24, 0x70, 0x93, 0x69,
+ 0x99, 0x59, 0x57, 0x49, 0x66, 0x96, 0x76, 0x27,
+};
+static const uint8_t ciph_data_aes_xts_vect13_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+ 0x02, 0x88, 0x41, 0x97, 0x16, 0x93, 0x99, 0x37,
+ 0x51, 0x05, 0x82, 0x09, 0x74, 0x94, 0x45, 0x92,
+};
+static const uint8_t ciph_data_aes_xts_vect13_iv[16] = {
+ 0xff, 0xff, 0xff, 0xff
+};
+static const uint8_t ciph_data_aes_xts_vect13_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07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_t ciph_data_aes_xts_vect14_key1[] = {
+ 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
+ 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
+ 0x62, 0x49, 0x77, 0x57, 0x24, 0x70, 0x93, 0x69,
+ 0x99, 0x59, 0x57, 0x49, 0x66, 0x96, 0x76, 0x27,
+};
+static const uint8_t ciph_data_aes_xts_vect14_key2[] = {
+ 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
+ 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
+ 0x02, 0x88, 0x41, 0x97, 0x16, 0x93, 0x99, 0x37,
+ 0x51, 0x05, 0x82, 0x09, 0x74, 0x94, 0x45, 0x92,
+};
+static const uint8_t ciph_data_aes_xts_vect14_iv[16] = {
+ 0xff, 0xff, 0xff, 0xff, 0xff
+};
+static const uint8_t ciph_data_aes_xts_vect14_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a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xf0, 0x59, 0xb6, 0x72,
+ 0xb5, 0x6e, 0x5c, 0xbc, 0x8e, 0x1d, 0x21, 0xbb,
+ 0xd8, 0x67, 0xdd, 0x92, 0x72, 0x12, 0x05, 0x46,
+
+ 0x81, 0xd7, 0x0e, 0xa7, 0x37, 0x13, 0x4c, 0xdf,
+ 0xce, 0x93, 0xb6, 0xf8, 0x2a, 0xe2, 0x24, 0x23,
+ 0x27, 0x4e, 0x58, 0xa0, 0x82, 0x1c, 0xc5, 0x50,
+ 0x2e, 0x2d, 0x0a, 0xb4, 0x58, 0x5e, 0x94, 0xde,
+
+ 0x69, 0x75, 0xbe, 0x5e, 0x0b, 0x4e, 0xfc, 0xe5,
+ 0x1c, 0xd3, 0xe7, 0x0c, 0x25, 0xa1, 0xfb, 0xbb,
+ 0xd6, 0x09, 0xd2, 0x73, 0xad, 0x5b, 0x0d, 0x59,
+ 0x63, 0x1c, 0x53, 0x1f, 0x6a, 0x0a, 0x57, 0xb9,
+};
+
+/*
+ * XTS-AES-128 applied for a data unit that is not a multiple of 16 bytes
+ */
+
+/* Vector 15 */
+static const uint8_t ciph_data_aes_xts_vect15_key1[] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
+};
+static const uint8_t ciph_data_aes_xts_vect15_key2[] = {
+ 0xbf, 0xbe, 0xbd, 0xbc, 0xbb, 0xba, 0xb9, 0xb8,
+ 0xb7, 0xb6, 0xb5, 0xb4, 0xb3, 0xb2, 0xb1, 0xb0,
+};
+static const uint8_t ciph_data_aes_xts_vect15_iv[16] = {
+ 0x9a, 0x78, 0x56, 0x34, 0x12
+};
+static const uint8_t ciph_data_aes_xts_vect15_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10
+};
+static const uint8_t ciph_data_aes_xts_vect15_ctx[] = {
+ 0x6c, 0x16, 0x25, 0xdb, 0x46, 0x71, 0x52, 0x2d,
+ 0x3d, 0x75, 0x99, 0x60, 0x1d, 0xe7, 0xca, 0x09,
+ 0xed
+};
+
+/* Vector 16 */
+static const uint8_t ciph_data_aes_xts_vect16_key1[] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
+};
+static const uint8_t ciph_data_aes_xts_vect16_key2[] = {
+ 0xbf, 0xbe, 0xbd, 0xbc, 0xbb, 0xba, 0xb9, 0xb8,
+ 0xb7, 0xb6, 0xb5, 0xb4, 0xb3, 0xb2, 0xb1, 0xb0,
+};
+static const uint8_t ciph_data_aes_xts_vect16_iv[16] = {
+ 0x9a, 0x78, 0x56, 0x34, 0x12
+};
+static const uint8_t ciph_data_aes_xts_vect16_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11
+};
+static const uint8_t ciph_data_aes_xts_vect16_ctx[] = {
+ 0xd0, 0x69, 0x44, 0x4b, 0x7a, 0x7e, 0x0c, 0xab,
+ 0x09, 0xe2, 0x44, 0x47, 0xd2, 0x4d, 0xeb, 0x1f,
+ 0xed, 0xbf
+};
+
+/* Vector 17 */
+static const uint8_t ciph_data_aes_xts_vect17_key1[] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
+};
+static const uint8_t ciph_data_aes_xts_vect17_key2[] = {
+ 0xbf, 0xbe, 0xbd, 0xbc, 0xbb, 0xba, 0xb9, 0xb8,
+ 0xb7, 0xb6, 0xb5, 0xb4, 0xb3, 0xb2, 0xb1, 0xb0,
+};
+static const uint8_t ciph_data_aes_xts_vect17_iv[16] = {
+ 0x9a, 0x78, 0x56, 0x34, 0x12
+};
+static const uint8_t ciph_data_aes_xts_vect17_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12
+};
+static const uint8_t ciph_data_aes_xts_vect17_ctx[] = {
+ 0xe5, 0xdf, 0x13, 0x51, 0xc0, 0x54, 0x4b, 0xa1,
+ 0x35, 0x0b, 0x33, 0x63, 0xcd, 0x8e, 0xf4, 0xbe,
+ 0xed, 0xbf, 0x9d
+};
+
+/* Vector 18 */
+static const uint8_t ciph_data_aes_xts_vect18_key1[] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
+};
+static const uint8_t ciph_data_aes_xts_vect18_key2[] = {
+ 0xbf, 0xbe, 0xbd, 0xbc, 0xbb, 0xba, 0xb9, 0xb8,
+ 0xb7, 0xb6, 0xb5, 0xb4, 0xb3, 0xb2, 0xb1, 0xb0,
+};
+static const uint8_t ciph_data_aes_xts_vect18_iv[16] = {
+ 0x9a, 0x78, 0x56, 0x34, 0x12
+};
+static const uint8_t ciph_data_aes_xts_vect18_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13
+};
+static const uint8_t ciph_data_aes_xts_vect18_ctx[] = {
+ 0x9d, 0x84, 0xc8, 0x13, 0xf7, 0x19, 0xaa, 0x2c,
+ 0x7b, 0xe3, 0xf6, 0x61, 0x71, 0xc7, 0xc5, 0xc2,
+ 0xed, 0xbf, 0x9d, 0xac
+};
+
+/* Vector 19 */
+static const uint8_t ciph_data_aes_xts_vect19_key1[] = {
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+};
+static const uint8_t ciph_data_aes_xts_vect19_key2[] = {
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+};
+static const uint8_t ciph_data_aes_xts_vect19_iv[16] = {
+ 0x21, 0x43, 0x65, 0x87, 0xa9
+};
+static const uint8_t ciph_data_aes_xts_vect19_ptx[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 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c0, 0xf4, 0x23, 0xc7, 0x7a,
+
+ 0x5f, 0xd4, 0x6c, 0xd3, 0x12, 0x02, 0x1d, 0x4b,
+ 0x43, 0x88, 0x62, 0x41, 0x9a, 0x79, 0x1b, 0xe0,
+ 0x3b, 0xb4, 0xd9, 0x7c, 0x0e, 0x59, 0x57, 0x85,
+ 0x42, 0x53, 0x1b, 0xa4, 0x66, 0xa8, 0x3b, 0xaf,
+
+ 0x92, 0xce, 0xfc, 0x15, 0x1b, 0x5c, 0xc1, 0x61,
+ 0x1a, 0x16, 0x78, 0x93, 0x81, 0x9b, 0x63, 0xfb,
+ 0x8a, 0x6b, 0x18, 0xe8, 0x6d, 0xe6, 0x02, 0x90,
+ 0xfa, 0x72, 0xb7, 0x97, 0xb0, 0xce, 0x59, 0xf3,
+};
+
+/* AES-CCM test data from NIST Special Publication 800-38C */
+
+/*
+ * Example1:
+ * K: 40414243 44454647 48494a4b 4c4d4e4f
+ * N: 10111213 141516
+ * A: 00010203 04050607
+ * P: 20212223
+ * B: 4f101112 13141516 00000000 00000004
+ * 00080001 02030405 06070000 00000000
+ * 20212223 00000000 00000000 00000000
+ * T: 6084341b
+ * Ctr0: 07101112 13141516 00000000 00000000
+ * S0: 2d281146 10676c26 32bad748 559a679a
+ * Ctr1: 07101112 13141516 00000000 00000001
+ * S1: 51432378 e474b339 71318484 103cddfb
+ * C: 7162015b 4dac255d
+ */
+static const uint8_t ae_data_aes_ccm_vect1_key[] = {
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
+};
+static const uint8_t ae_data_aes_ccm_vect1_nonce[] = {
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16
+};
+static const uint8_t ae_data_aes_ccm_vect1_aad[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+};
+static const uint8_t ae_data_aes_ccm_vect1_ptx[] = {
+ 0x20, 0x21, 0x22, 0x23
+};
+static const uint8_t ae_data_aes_ccm_vect1_ctx[] = {
+ 0x71, 0x62, 0x01, 0x5b,
+};
+static const uint8_t ae_data_aes_ccm_vect1_tag[] = {
+ 0x4d, 0xac, 0x25, 0x5d
+};
+
+/*
+ * Example 2:
+ * K: 40414243 44454647 48494a4b 4c4d4e4f
+ * N: 10111213 14151617
+ * A: 00010203 04050607 08090a0b 0c0d0e0f
+ * P: 20212223 24252627 28292a2b 2c2d2e2f
+ * B: 56101112 13141516 17000000 00000010
+ * 00100001 02030405 06070809 0a0b0c0d
+ * 0e0f0000 00000000 00000000 00000000
+ * 20212223 24252627 28292a2b 2c2d2e2f
+ * T: 7f479ffc a464
+ * Ctr0: 06101112 13141516 17000000 00000000
+ * S0: 6081d043 08a97dcc 20cdcc60 bf947b78
+ * Ctr1: 06101112 13141516 17000000 00000001
+ * S1: f280d2c3 75cf7945 20335db9 2b107712
+ * C: d2a1f0e0 51ea5f62 081a7792 073d593d
+ * 1fc64fbf accd
+ */
+static const uint8_t ae_data_aes_ccm_vect2_key[] = {
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
+};
+static const uint8_t ae_data_aes_ccm_vect2_nonce[] = {
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17
+};
+static const uint8_t ae_data_aes_ccm_vect2_aad[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
+};
+static const uint8_t ae_data_aes_ccm_vect2_ptx[] = {
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f
+};
+static const uint8_t ae_data_aes_ccm_vect2_ctx[] = {
+ 0xd2, 0xa1, 0xf0, 0xe0, 0x51, 0xea, 0x5f, 0x62,
+ 0x08, 0x1a, 0x77, 0x92, 0x07, 0x3d, 0x59, 0x3d,
+};
+static const uint8_t ae_data_aes_ccm_vect2_tag[] = {
+ 0x1f, 0xc6, 0x4f, 0xbf, 0xac, 0xcd
+};
+
+/*
+ * Example 3
+ * K: 40414243 44454647 48494a4b 4c4d4e4f
+ * N: 10111213 14151617 18191a1b
+ * A: 00010203 04050607 08090a0b 0c0d0e0f
+ * 10111213
+ * P: 20212223 24252627 28292a2b 2c2d2e2f
+ * 30313233 34353637
+ * B: 5a101112 13141516 1718191a 1b000018
+ * 00140001 02030405 06070809 0a0b0c0d
+ * 0e0f1011 12130000 00000000 00000000
+ * 20212223 24252627 28292a2b 2c2d2e2f
+ * 30313233 34353637 00000000 00000000
+ * T: 67c99240 c7d51048
+ * Ctr0: 02101112 13141516 1718191a 1b000000
+ * S0: 2f8a00bb 06658919 c3a040a6 eaed1a7f
+ * Ctr1: 02101112 13141516 1718191a 1b000001
+ * S1: c393238a d1923c5d b335c0c7 e1bac924
+ * Ctr2: 02101112 13141516 1718191a 1b000002
+ * S2: 514798ea 9077bc92 6c22ebef 2ac732dc
+ * C: e3b201a9 f5b71a7a 9b1ceaec cd97e70b
+ * 6176aad9 a4428aa5 484392fb c1b09951
+ */
+static const uint8_t ae_data_aes_ccm_vect3_key[] = {
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
+};
+static const uint8_t ae_data_aes_ccm_vect3_nonce[] = {
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b
+};
+static const uint8_t ae_data_aes_ccm_vect3_aad[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13
+};
+static const uint8_t ae_data_aes_ccm_vect3_ptx[] = {
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37
+};
+static const uint8_t ae_data_aes_ccm_vect3_ctx[] = {
+ 0xe3, 0xb2, 0x01, 0xa9, 0xf5, 0xb7, 0x1a, 0x7a,
+ 0x9b, 0x1c, 0xea, 0xec, 0xcd, 0x97, 0xe7, 0x0b,
+ 0x61, 0x76, 0xaa, 0xd9, 0xa4, 0x42, 0x8a, 0xa5,
+};
+static const uint8_t ae_data_aes_ccm_vect3_tag[] = {
+ 0x48, 0x43, 0x92, 0xfb, 0xc1, 0xb0, 0x99, 0x51
+};
+
+/*
+ * AES-GCM vectors from the reviced "The Galois/Counter Mode of Operation
+ * (GCM)" 2005-05-31 spec
+ */
+
+/*
+ * Test case 1
+ * K 00000000000000000000000000000000
+ * P
+ * IV 000000000000000000000000
+ * H 66e94bd4ef8a2c3b884cfa59ca342b2e
+ * Y0 00000000000000000000000000000001
+ * E(K, Y0) 58e2fccefa7e3061367f1d57a4e7455a
+ * len(A)||len(C) 00000000000000000000000000000000
+ * GHASH(H, A, C) 00000000000000000000000000000000
+ * C
+ * T 58e2fccefa7e3061367f1d57a4e7455a
+ */
+static const uint8_t ae_data_aes_gcm_vect1_key[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const uint8_t ae_data_aes_gcm_vect1_nonce[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00
+};
+#define ae_data_aes_gcm_vect1_aad NULL
+#define ae_data_aes_gcm_vect1_ptx NULL
+#define ae_data_aes_gcm_vect1_ctx NULL
+static const uint8_t ae_data_aes_gcm_vect1_tag[] = {
+ 0x58, 0xe2, 0xfc, 0xce, 0xfa, 0x7e, 0x30, 0x61,
+ 0x36, 0x7f, 0x1d, 0x57, 0xa4, 0xe7, 0x45, 0x5a
+};
+
+/*
+ * Test case 2
+ * K 00000000000000000000000000000000
+ * P 00000000000000000000000000000000
+ * IV 000000000000000000000000
+ * H 66e94bd4ef8a2c3b884cfa59ca342b2e
+ * Y0 00000000000000000000000000000001
+ * E(K, Y0) 58e2fccefa7e3061367f1d57a4e7455a
+ * Y1 00000000000000000000000000000002
+ * E(K, Y1) 0388dace60b6a392f328c2b971b2fe78
+ * X1 5e2ec746917062882c85b0685353deb7
+ * len(A)||len(C) 00000000000000000000000000000080
+ * GHASH(H, A, C) f38cbb1ad69223dcc3457ae5b6b0f885
+ * C 0388dace60b6a392f328c2b971b2fe78
+ * T ab6e47d42cec13bdf53a67b21257bddf
+ */
+
+static const uint8_t ae_data_aes_gcm_vect2_key[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const uint8_t ae_data_aes_gcm_vect2_nonce[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00
+};
+#define ae_data_aes_gcm_vect2_aad NULL
+static const uint8_t ae_data_aes_gcm_vect2_ptx[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const uint8_t ae_data_aes_gcm_vect2_ctx[] = {
+ 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92,
+ 0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78
+};
+static const uint8_t ae_data_aes_gcm_vect2_tag[] = {
+ 0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd,
+ 0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf
+};
+
+/*
+ * Test case 3
+ * K feffe9928665731c6d6a8f9467308308
+ * P d9313225f88406e5a55909c5aff5269a
+ * 86a7a9531534f7da2e4c303d8a318a72
+ * 1c3c0c95956809532fcf0e2449a6b525
+ * b16aedf5aa0de657ba637b391aafd255
+ * IV cafebabefacedbaddecaf888
+ * H b83b533708bf535d0aa6e52980d53b78
+ * Y0 cafebabefacedbaddecaf88800000001
+ * E(K, Y0) 3247184b3c4f69a44dbcd22887bbb418
+ * Y1 cafebabefacedbaddecaf88800000002
+ * E(K, Y1) 9bb22ce7d9f372c1ee2b28722b25f206
+ * Y2 cafebabefacedbaddecaf88800000003
+ * E(K, Y2) 650d887c3936533a1b8d4e1ea39d2b5c
+ * Y3 cafebabefacedbaddecaf88800000004
+ * E(K, Y3) 3de91827c10e9a4f5240647ee5221f20
+ * Y4 cafebabefacedbaddecaf88800000005
+ * E(K, Y4) aac9e6ccc0074ac0873b9ba85d908bd0
+ * X1 59ed3f2bb1a0aaa07c9f56c6a504647b
+ * X2 b714c9048389afd9f9bc5c1d4378e052
+ * X3 47400c6577b1ee8d8f40b2721e86ff10
+ * X4 4796cf49464704b5dd91f159bb1b7f95
+ * len(A)||len(C) 00000000000000000000000000000200
+ * GHASH(H, A, C) 7f1b32b81b820d02614f8895ac1d4eac
+ * C 42831ec2217774244b7221b784d0d49c
+ * e3aa212f2c02a4e035c17e2329aca12e
+ * 21d514b25466931c7d8f6a5aac84aa05
+ * 1ba30b396a0aac973d58e091473f5985
+ * T 4d5c2af327cd64a62cf35abd2ba6fab4
+ */
+
+static const uint8_t ae_data_aes_gcm_vect3_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
+};
+static const uint8_t ae_data_aes_gcm_vect3_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+ 0xde, 0xca, 0xf8, 0x88
+};
+#define ae_data_aes_gcm_vect3_aad NULL
+static const uint8_t ae_data_aes_gcm_vect3_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55
+};
+static const uint8_t ae_data_aes_gcm_vect3_ctx[] = {
+ 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
+ 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
+ 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
+ 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
+ 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
+ 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
+ 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
+ 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85
+};
+static const uint8_t ae_data_aes_gcm_vect3_tag[] = {
+ 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6,
+ 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4
+};
+
+/*
+ * Test case 4
+ * K feffe9928665731c6d6a8f9467308308
+ * P d9313225f88406e5a55909c5aff5269a
+ * 86a7a9531534f7da2e4c303d8a318a72
+ * 1c3c0c95956809532fcf0e2449a6b525
+ * b16aedf5aa0de657ba637b39
+ * A feedfacedeadbeeffeedfacedeadbeef
+ * abaddad2
+ * IV cafebabefacedbaddecaf888
+ * H b83b533708bf535d0aa6e52980d53b78
+ * Y0 cafebabefacedbaddecaf88800000001
+ * E(K, Y0) 3247184b3c4f69a44dbcd22887bbb418
+ * X1 ed56aaf8a72d67049fdb9228edba1322
+ * X2 cd47221ccef0554ee4bb044c88150352
+ * Y1 cafebabefacedbaddecaf88800000002
+ * E(K, Y1) 9bb22ce7d9f372c1ee2b28722b25f206
+ * Y2 cafebabefacedbaddecaf88800000003
+ * E(K, Y2) 650d887c3936533a1b8d4e1ea39d2b5c
+ * Y3 cafebabefacedbaddecaf88800000004
+ * E(K, Y3) 3de91827c10e9a4f5240647ee5221f20
+ * Y4 cafebabefacedbaddecaf88800000005
+ * E(K, Y4) aac9e6ccc0074ac0873b9ba85d908bd0
+ * X3 54f5e1b2b5a8f9525c23924751a3ca51
+ * X4 324f585c6ffc1359ab371565d6c45f93
+ * X5 ca7dd446af4aa70cc3c0cd5abba6aa1c
+ * X6 1590df9b2eb6768289e57d56274c8570
+ * len(A)||len(C) 00000000000000a000000000000001e0
+ * GHASH(H, A, C) 698e57f70e6ecc7fd9463b7260a9ae5f
+ * C 42831ec2217774244b7221b784d0d49c
+ * e3aa212f2c02a4e035c17e2329aca12e
+ * 21d514b25466931c7d8f6a5aac84aa05
+ * 1ba30b396a0aac973d58e091
+ * T 5bc94fbc3221a5db94fae95ae7121a47
+ */
+
+static const uint8_t ae_data_aes_gcm_vect4_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
+};
+static const uint8_t ae_data_aes_gcm_vect4_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+ 0xde, 0xca, 0xf8, 0x88
+};
+static const uint8_t ae_data_aes_gcm_vect4_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2
+};
+static const uint8_t ae_data_aes_gcm_vect4_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39
+};
+static const uint8_t ae_data_aes_gcm_vect4_ctx[] = {
+ 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
+ 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
+ 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
+ 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
+ 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
+ 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
+ 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
+ 0x3d, 0x58, 0xe0, 0x91
+};
+static const uint8_t ae_data_aes_gcm_vect4_tag[] = {
+ 0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb,
+ 0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47
+};
+
+/*
+ * Test case 5
+ * K feffe9928665731c6d6a8f9467308308
+ * P d9313225f88406e5a55909c5aff5269a
+ * 86a7a9531534f7da2e4c303d8a318a72
+ * 1c3c0c95956809532fcf0e2449a6b525
+ * b16aedf5aa0de657ba637b39
+ * A feedfacedeadbeeffeedfacedeadbeef
+ * abaddad2
+ * IV cafebabefacedbad
+ * H b83b533708bf535d0aa6e52980d53b78
+ * N1 6f288b846e5fed9a18376829c86a6a16
+ * len({})||len(IV ) 00000000000000000000000000000040
+ * Y0 c43a83c4c4badec4354ca984db252f7d
+ * E(K, Y0) e94ab9535c72bea9e089c93d48e62fb0
+ * X1 ed56aaf8a72d67049fdb9228edba1322
+ * X2 cd47221ccef0554ee4bb044c88150352
+ * Y1 c43a83c4c4badec4354ca984db252f7e
+ * E(K, Y1) b8040969d08295afd226fcda0ddf61cf
+ * Y2 c43a83c4c4badec4354ca984db252f7f
+ * E(K, Y2) ef3c83225af93122192ad5c4f15dfe51
+ * Y3 c43a83c4c4badec4354ca984db252f80
+ * E(K, Y3) 6fbc659571f72de104c67b609d2fde67
+ * Y4 c43a83c4c4badec4354ca984db252f81
+ * E(K, Y4) f8e3581441a1e950785c3ea1430c6fa6
+ * X3 9379e2feae14649c86cf2250e3a81916
+ * X4 65dde904c92a6b3db877c4817b50a5f4
+ * X5 48c53cf863b49a1b0bbfc48c3baaa89d
+ * X6 08c873f1c8cec3effc209a07468caab1
+ * len(A)||len(C) 00000000000000a000000000000001e0
+ * GHASH(H, A, C) df586bb4c249b92cb6922877e444d37b
+ * C 61353b4c2806934a777ff51fa22a4755
+ * 699b2a714fcdc6f83766e5f97b6c7423
+ * 73806900e49f24b22b097544d4896b42
+ * 4989b5e1ebac0f07c23f4598
+ * T 3612d2e79e3b0785561be14aaca2fccb
+ */
+
+static const uint8_t ae_data_aes_gcm_vect5_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
+};
+static const uint8_t ae_data_aes_gcm_vect5_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad
+};
+static const uint8_t ae_data_aes_gcm_vect5_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2
+};
+static const uint8_t ae_data_aes_gcm_vect5_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39
+};
+static const uint8_t ae_data_aes_gcm_vect5_ctx[] = {
+ 0x61, 0x35, 0x3b, 0x4c, 0x28, 0x06, 0x93, 0x4a,
+ 0x77, 0x7f, 0xf5, 0x1f, 0xa2, 0x2a, 0x47, 0x55,
+ 0x69, 0x9b, 0x2a, 0x71, 0x4f, 0xcd, 0xc6, 0xf8,
+ 0x37, 0x66, 0xe5, 0xf9, 0x7b, 0x6c, 0x74, 0x23,
+ 0x73, 0x80, 0x69, 0x00, 0xe4, 0x9f, 0x24, 0xb2,
+ 0x2b, 0x09, 0x75, 0x44, 0xd4, 0x89, 0x6b, 0x42,
+ 0x49, 0x89, 0xb5, 0xe1, 0xeb, 0xac, 0x0f, 0x07,
+ 0xc2, 0x3f, 0x45, 0x98
+};
+static const uint8_t ae_data_aes_gcm_vect5_tag[] = {
+ 0x36, 0x12, 0xd2, 0xe7, 0x9e, 0x3b, 0x07, 0x85,
+ 0x56, 0x1b, 0xe1, 0x4a, 0xac, 0xa2, 0xfc, 0xcb
+};
+
+/*
+ * Test case 6
+ * K feffe9928665731c6d6a8f9467308308
+ * P d9313225f88406e5a55909c5aff5269a
+ * 86a7a9531534f7da2e4c303d8a318a72
+ * 1c3c0c95956809532fcf0e2449a6b525
+ * b16aedf5aa0de657ba637b39
+ * A feedfacedeadbeeffeedfacedeadbeef
+ * abaddad2
+ * IV 9313225df88406e555909c5aff5269aa
+ * 6a7a9538534f7da1e4c303d2a318a728
+ * c3c0c95156809539fcf0e2429a6b5254
+ * 16aedbf5a0de6a57a637b39b
+ * H b83b533708bf535d0aa6e52980d53b78
+ * N1 004d6599d7fb1634756e1e299d81630f
+ * N2 88ffe8a3c8033df4b54d732f7f88408e
+ * N3 24e694cfab657beabba8055aad495e23
+ * N4 d8349a5eda24943c8fbb2ef5168b20cb
+ * len({})||len(IV ) 000000000000000000000000000001e0
+ * Y0 3bab75780a31c059f83d2a44752f9864
+ * E(K, Y0) 7dc63b399f2d98d57ab073b6baa4138e
+ * X1 ed56aaf8a72d67049fdb9228edba1322
+ * X2 cd47221ccef0554ee4bb044c88150352
+ * Y1 3bab75780a31c059f83d2a44752f9865
+ * E(K, Y1) 55d37bbd9ad21353a6f93a690eca9e0e
+ * Y2 3bab75780a31c059f83d2a44752f9866
+ * E(K, Y2) 3836bbf6d696e672946a1a01404fa6d5
+ * Y3 3bab75780a31c059f83d2a44752f9867
+ * E(K, Y3) 1dd8a5316ecc35c3e313bca59d2ac94a
+ * Y4 3bab75780a31c059f83d2a44752f9868
+ * E(K, Y4) 6742982706a9f154f657d5dc94b746db
+ * X3 31727669c63c6f078b5d22adbbbca384
+ * X4 480c00db2679065a7ed2f771a53acacd
+ * X5 1c1ae3c355e2214466a9923d2ba6ab35
+ * X6 0694c6f16bb0275a48891d06590344b0
+ * len(A)||len(C) 00000000000000a000000000000001e0
+ * GHASH(H, A, C) 1c5afe9760d3932f3c9a878aac3dc3de
+ * C 8ce24998625615b603a033aca13fb894
+ * be9112a5c3a211a8ba262a3cca7e2ca7
+ * 01e4a9a4fba43c90ccdcb281d48c7c6f
+ * d62875d2aca417034c34aee5
+ * T 619cc5aefffe0bfa462af43c1699d050
+ */
+
+static const uint8_t ae_data_aes_gcm_vect6_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+};
+static const uint8_t ae_data_aes_gcm_vect6_nonce[] = {
+ 0x93, 0x13, 0x22, 0x5d, 0xf8, 0x84, 0x06, 0xe5,
+ 0x55, 0x90, 0x9c, 0x5a, 0xff, 0x52, 0x69, 0xaa,
+ 0x6a, 0x7a, 0x95, 0x38, 0x53, 0x4f, 0x7d, 0xa1,
+ 0xe4, 0xc3, 0x03, 0xd2, 0xa3, 0x18, 0xa7, 0x28,
+ 0xc3, 0xc0, 0xc9, 0x51, 0x56, 0x80, 0x95, 0x39,
+ 0xfc, 0xf0, 0xe2, 0x42, 0x9a, 0x6b, 0x52, 0x54,
+ 0x16, 0xae, 0xdb, 0xf5, 0xa0, 0xde, 0x6a, 0x57,
+ 0xa6, 0x37, 0xb3, 0x9b,
+};
+static const uint8_t ae_data_aes_gcm_vect6_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2,
+};
+static const uint8_t ae_data_aes_gcm_vect6_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39,
+};
+static const uint8_t ae_data_aes_gcm_vect6_ctx[] = {
+ 0x8c, 0xe2, 0x49, 0x98, 0x62, 0x56, 0x15, 0xb6,
+ 0x03, 0xa0, 0x33, 0xac, 0xa1, 0x3f, 0xb8, 0x94,
+ 0xbe, 0x91, 0x12, 0xa5, 0xc3, 0xa2, 0x11, 0xa8,
+ 0xba, 0x26, 0x2a, 0x3c, 0xca, 0x7e, 0x2c, 0xa7,
+ 0x01, 0xe4, 0xa9, 0xa4, 0xfb, 0xa4, 0x3c, 0x90,
+ 0xcc, 0xdc, 0xb2, 0x81, 0xd4, 0x8c, 0x7c, 0x6f,
+ 0xd6, 0x28, 0x75, 0xd2, 0xac, 0xa4, 0x17, 0x03,
+ 0x4c, 0x34, 0xae, 0xe5,
+};
+static const uint8_t ae_data_aes_gcm_vect6_tag[] = {
+ 0x61, 0x9c, 0xc5, 0xae, 0xff, 0xfe, 0x0b, 0xfa,
+ 0x46, 0x2a, 0xf4, 0x3c, 0x16, 0x99, 0xd0, 0x50,
+};
+
+/*
+ * Test case 7
+ * K 00000000000000000000000000000000
+ * 0000000000000000
+ * P
+ * IV 000000000000000000000000
+ * H aae06992acbf52a3e8f4a96ec9300bd7
+ * Y0 00000000000000000000000000000001
+ * E(K, Y0) cd33b28ac773f74ba00ed1f312572435
+ * len(A)||len(C) 00000000000000000000000000000000
+ * GHASH(H, A, C) 00000000000000000000000000000000
+ * C
+ * T cd33b28ac773f74ba00ed1f312572435
+ */
+
+static const uint8_t ae_data_aes_gcm_vect7_key[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+static const uint8_t ae_data_aes_gcm_vect7_nonce[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
+#define ae_data_aes_gcm_vect7_aad NULL
+#define ae_data_aes_gcm_vect7_ptx NULL
+#define ae_data_aes_gcm_vect7_ctx NULL
+static const uint8_t ae_data_aes_gcm_vect7_tag[] = {
+ 0xcd, 0x33, 0xb2, 0x8a, 0xc7, 0x73, 0xf7, 0x4b,
+ 0xa0, 0x0e, 0xd1, 0xf3, 0x12, 0x57, 0x24, 0x35,
+};
+
+/*
+ * Test case 8
+ * K 00000000000000000000000000000000
+ * 0000000000000000
+ * P 00000000000000000000000000000000
+ * IV 000000000000000000000000
+ * H aae06992acbf52a3e8f4a96ec9300bd7
+ * Y0 00000000000000000000000000000001
+ * E(K, Y0) cd33b28ac773f74ba00ed1f312572435
+ * Y1 00000000000000000000000000000002
+ * E(K, Y1) 98e7247c07f0fe411c267e4384b0f600
+ * X1 90e87315fb7d4e1b4092ec0cbfda5d7d
+ * len(A)||len(C) 00000000000000000000000000000080
+ * GHASH(H, A, C) e2c63f0ac44ad0e02efa05ab6743d4ce
+ * C 98e7247c07f0fe411c267e4384b0f600
+ * T 2ff58d80033927ab8ef4d4587514f0fb
+ */
+
+static const uint8_t ae_data_aes_gcm_vect8_key[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+static const uint8_t ae_data_aes_gcm_vect8_nonce[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
+#define ae_data_aes_gcm_vect8_aad NULL
+static const uint8_t ae_data_aes_gcm_vect8_ptx[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+static const uint8_t ae_data_aes_gcm_vect8_ctx[] = {
+ 0x98, 0xe7, 0x24, 0x7c, 0x07, 0xf0, 0xfe, 0x41,
+ 0x1c, 0x26, 0x7e, 0x43, 0x84, 0xb0, 0xf6, 0x00,
+};
+static const uint8_t ae_data_aes_gcm_vect8_tag[] = {
+ 0x2f, 0xf5, 0x8d, 0x80, 0x03, 0x39, 0x27, 0xab,
+ 0x8e, 0xf4, 0xd4, 0x58, 0x75, 0x14, 0xf0, 0xfb,
+};
+
+/* Test case 9 */
+static const uint8_t ae_data_aes_gcm_vect9_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+};
+static const uint8_t ae_data_aes_gcm_vect9_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+ 0xde, 0xca, 0xf8, 0x88,
+};
+#define ae_data_aes_gcm_vect9_aad NULL
+static const uint8_t ae_data_aes_gcm_vect9_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55,
+};
+static const uint8_t ae_data_aes_gcm_vect9_ctx[] = {
+ 0x39, 0x80, 0xca, 0x0b, 0x3c, 0x00, 0xe8, 0x41,
+ 0xeb, 0x06, 0xfa, 0xc4, 0x87, 0x2a, 0x27, 0x57,
+ 0x85, 0x9e, 0x1c, 0xea, 0xa6, 0xef, 0xd9, 0x84,
+ 0x62, 0x85, 0x93, 0xb4, 0x0c, 0xa1, 0xe1, 0x9c,
+ 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25,
+ 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47,
+ 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9,
+ 0xcc, 0xda, 0x27, 0x10, 0xac, 0xad, 0xe2, 0x56,
+};
+static const uint8_t ae_data_aes_gcm_vect9_tag[] = {
+ 0x99, 0x24, 0xa7, 0xc8, 0x58, 0x73, 0x36, 0xbf,
+ 0xb1, 0x18, 0x02, 0x4d, 0xb8, 0x67, 0x4a, 0x14,
+};
+
+/* Test case 10 */
+static const uint8_t ae_data_aes_gcm_vect10_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+};
+static const uint8_t ae_data_aes_gcm_vect10_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+ 0xde, 0xca, 0xf8, 0x88,
+};
+static const uint8_t ae_data_aes_gcm_vect10_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2,
+};
+static const uint8_t ae_data_aes_gcm_vect10_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39,
+};
+static const uint8_t ae_data_aes_gcm_vect10_ctx[] = {
+ 0x39, 0x80, 0xca, 0x0b, 0x3c, 0x00, 0xe8, 0x41,
+ 0xeb, 0x06, 0xfa, 0xc4, 0x87, 0x2a, 0x27, 0x57,
+ 0x85, 0x9e, 0x1c, 0xea, 0xa6, 0xef, 0xd9, 0x84,
+ 0x62, 0x85, 0x93, 0xb4, 0x0c, 0xa1, 0xe1, 0x9c,
+ 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25,
+ 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47,
+ 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9,
+ 0xcc, 0xda, 0x27, 0x10,
+};
+static const uint8_t ae_data_aes_gcm_vect10_tag[] = {
+ 0x25, 0x19, 0x49, 0x8e, 0x80, 0xf1, 0x47, 0x8f,
+ 0x37, 0xba, 0x55, 0xbd, 0x6d, 0x27, 0x61, 0x8c,
+};
+
+/* Test case 11 */
+static const uint8_t ae_data_aes_gcm_vect11_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+};
+static const uint8_t ae_data_aes_gcm_vect11_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+};
+static const uint8_t ae_data_aes_gcm_vect11_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2,
+};
+static const uint8_t ae_data_aes_gcm_vect11_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39,
+};
+static const uint8_t ae_data_aes_gcm_vect11_ctx[] = {
+ 0x0f, 0x10, 0xf5, 0x99, 0xae, 0x14, 0xa1, 0x54,
+ 0xed, 0x24, 0xb3, 0x6e, 0x25, 0x32, 0x4d, 0xb8,
+ 0xc5, 0x66, 0x63, 0x2e, 0xf2, 0xbb, 0xb3, 0x4f,
+ 0x83, 0x47, 0x28, 0x0f, 0xc4, 0x50, 0x70, 0x57,
+ 0xfd, 0xdc, 0x29, 0xdf, 0x9a, 0x47, 0x1f, 0x75,
+ 0xc6, 0x65, 0x41, 0xd4, 0xd4, 0xda, 0xd1, 0xc9,
+ 0xe9, 0x3a, 0x19, 0xa5, 0x8e, 0x8b, 0x47, 0x3f,
+ 0xa0, 0xf0, 0x62, 0xf7,
+};
+static const uint8_t ae_data_aes_gcm_vect11_tag[] = {
+ 0x65, 0xdc, 0xc5, 0x7f, 0xcf, 0x62, 0x3a, 0x24,
+ 0x09, 0x4f, 0xcc, 0xa4, 0x0d, 0x35, 0x33, 0xf8,
+};
+
+/* Test case 12 */
+static const uint8_t ae_data_aes_gcm_vect12_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+};
+static const uint8_t ae_data_aes_gcm_vect12_nonce[] = {
+ 0x93, 0x13, 0x22, 0x5d, 0xf8, 0x84, 0x06, 0xe5,
+ 0x55, 0x90, 0x9c, 0x5a, 0xff, 0x52, 0x69, 0xaa,
+ 0x6a, 0x7a, 0x95, 0x38, 0x53, 0x4f, 0x7d, 0xa1,
+ 0xe4, 0xc3, 0x03, 0xd2, 0xa3, 0x18, 0xa7, 0x28,
+ 0xc3, 0xc0, 0xc9, 0x51, 0x56, 0x80, 0x95, 0x39,
+ 0xfc, 0xf0, 0xe2, 0x42, 0x9a, 0x6b, 0x52, 0x54,
+ 0x16, 0xae, 0xdb, 0xf5, 0xa0, 0xde, 0x6a, 0x57,
+ 0xa6, 0x37, 0xb3, 0x9b,
+};
+static const uint8_t ae_data_aes_gcm_vect12_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2,
+};
+static const uint8_t ae_data_aes_gcm_vect12_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39,
+};
+static const uint8_t ae_data_aes_gcm_vect12_ctx[] = {
+ 0xd2, 0x7e, 0x88, 0x68, 0x1c, 0xe3, 0x24, 0x3c,
+ 0x48, 0x30, 0x16, 0x5a, 0x8f, 0xdc, 0xf9, 0xff,
+ 0x1d, 0xe9, 0xa1, 0xd8, 0xe6, 0xb4, 0x47, 0xef,
+ 0x6e, 0xf7, 0xb7, 0x98, 0x28, 0x66, 0x6e, 0x45,
+ 0x81, 0xe7, 0x90, 0x12, 0xaf, 0x34, 0xdd, 0xd9,
+ 0xe2, 0xf0, 0x37, 0x58, 0x9b, 0x29, 0x2d, 0xb3,
+ 0xe6, 0x7c, 0x03, 0x67, 0x45, 0xfa, 0x22, 0xe7,
+ 0xe9, 0xb7, 0x37, 0x3b,
+};
+static const uint8_t ae_data_aes_gcm_vect12_tag[] = {
+ 0xdc, 0xf5, 0x66, 0xff, 0x29, 0x1c, 0x25, 0xbb,
+ 0xb8, 0x56, 0x8f, 0xc3, 0xd3, 0x76, 0xa6, 0xd9,
+};
+
+/* Test case 13 */
+static const uint8_t ae_data_aes_gcm_vect13_key[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+static const uint8_t ae_data_aes_gcm_vect13_nonce[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
+#define ae_data_aes_gcm_vect13_aad NULL
+#define ae_data_aes_gcm_vect13_ptx NULL
+#define ae_data_aes_gcm_vect13_ctx NULL
+static const uint8_t ae_data_aes_gcm_vect13_tag[] = {
+ 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9,
+ 0xa9, 0x63, 0xb4, 0xf1, 0xc4, 0xcb, 0x73, 0x8b,
+};
+
+/* Test case 14 */
+static const uint8_t ae_data_aes_gcm_vect14_key[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+static const uint8_t ae_data_aes_gcm_vect14_nonce[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
+#define ae_data_aes_gcm_vect14_aad NULL
+static const uint8_t ae_data_aes_gcm_vect14_ptx[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+static const uint8_t ae_data_aes_gcm_vect14_ctx[] = {
+ 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e,
+ 0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18,
+};
+static const uint8_t ae_data_aes_gcm_vect14_tag[] = {
+ 0xd0, 0xd1, 0xc8, 0xa7, 0x99, 0x99, 0x6b, 0xf0,
+ 0x26, 0x5b, 0x98, 0xb5, 0xd4, 0x8a, 0xb9, 0x19,
+};
+
+/* Test case 15 */
+static const uint8_t ae_data_aes_gcm_vect15_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+};
+static const uint8_t ae_data_aes_gcm_vect15_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+ 0xde, 0xca, 0xf8, 0x88,
+};
+#define ae_data_aes_gcm_vect15_aad NULL
+static const uint8_t ae_data_aes_gcm_vect15_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55,
+};
+static const uint8_t ae_data_aes_gcm_vect15_ctx[] = {
+ 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07,
+ 0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d,
+ 0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9,
+ 0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, 0xd1, 0xaa,
+ 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d,
+ 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38,
+ 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a,
+ 0xbc, 0xc9, 0xf6, 0x62, 0x89, 0x80, 0x15, 0xad,
+};
+static const uint8_t ae_data_aes_gcm_vect15_tag[] = {
+ 0xb0, 0x94, 0xda, 0xc5, 0xd9, 0x34, 0x71, 0xbd,
+ 0xec, 0x1a, 0x50, 0x22, 0x70, 0xe3, 0xcc, 0x6c,
+};
+
+/* Test case 16 */
+static const uint8_t ae_data_aes_gcm_vect16_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+};
+static const uint8_t ae_data_aes_gcm_vect16_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+ 0xde, 0xca, 0xf8, 0x88,
+};
+static const uint8_t ae_data_aes_gcm_vect16_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2,
+};
+static const uint8_t ae_data_aes_gcm_vect16_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39,
+};
+static const uint8_t ae_data_aes_gcm_vect16_ctx[] = {
+ 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07,
+ 0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d,
+ 0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9,
+ 0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, 0xd1, 0xaa,
+ 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d,
+ 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38,
+ 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a,
+ 0xbc, 0xc9, 0xf6, 0x62,
+};
+static const uint8_t ae_data_aes_gcm_vect16_tag[] = {
+ 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68,
+ 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b,
+};
+
+/* Test case 17 */
+static const uint8_t ae_data_aes_gcm_vect17_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+};
+static const uint8_t ae_data_aes_gcm_vect17_nonce[] = {
+ 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+};
+static const uint8_t ae_data_aes_gcm_vect17_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2,
+};
+static const uint8_t ae_data_aes_gcm_vect17_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39,
+};
+static const uint8_t ae_data_aes_gcm_vect17_ctx[] = {
+ 0xc3, 0x76, 0x2d, 0xf1, 0xca, 0x78, 0x7d, 0x32,
+ 0xae, 0x47, 0xc1, 0x3b, 0xf1, 0x98, 0x44, 0xcb,
+ 0xaf, 0x1a, 0xe1, 0x4d, 0x0b, 0x97, 0x6a, 0xfa,
+ 0xc5, 0x2f, 0xf7, 0xd7, 0x9b, 0xba, 0x9d, 0xe0,
+ 0xfe, 0xb5, 0x82, 0xd3, 0x39, 0x34, 0xa4, 0xf0,
+ 0x95, 0x4c, 0xc2, 0x36, 0x3b, 0xc7, 0x3f, 0x78,
+ 0x62, 0xac, 0x43, 0x0e, 0x64, 0xab, 0xe4, 0x99,
+ 0xf4, 0x7c, 0x9b, 0x1f,
+};
+static const uint8_t ae_data_aes_gcm_vect17_tag[] = {
+ 0x3a, 0x33, 0x7d, 0xbf, 0x46, 0xa7, 0x92, 0xc4,
+ 0x5e, 0x45, 0x49, 0x13, 0xfe, 0x2e, 0xa8, 0xf2,
+};
+
+/* Test case 18 */
+static const uint8_t ae_data_aes_gcm_vect18_key[] = {
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+ 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+ 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+};
+static const uint8_t ae_data_aes_gcm_vect18_nonce[] = {
+ 0x93, 0x13, 0x22, 0x5d, 0xf8, 0x84, 0x06, 0xe5,
+ 0x55, 0x90, 0x9c, 0x5a, 0xff, 0x52, 0x69, 0xaa,
+ 0x6a, 0x7a, 0x95, 0x38, 0x53, 0x4f, 0x7d, 0xa1,
+ 0xe4, 0xc3, 0x03, 0xd2, 0xa3, 0x18, 0xa7, 0x28,
+ 0xc3, 0xc0, 0xc9, 0x51, 0x56, 0x80, 0x95, 0x39,
+ 0xfc, 0xf0, 0xe2, 0x42, 0x9a, 0x6b, 0x52, 0x54,
+ 0x16, 0xae, 0xdb, 0xf5, 0xa0, 0xde, 0x6a, 0x57,
+ 0xa6, 0x37, 0xb3, 0x9b,
+};
+static const uint8_t ae_data_aes_gcm_vect18_aad[] = {
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+ 0xab, 0xad, 0xda, 0xd2,
+};
+static const uint8_t ae_data_aes_gcm_vect18_ptx[] = {
+ 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+ 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+ 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+ 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+ 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+ 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+ 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+ 0xba, 0x63, 0x7b, 0x39,
+};
+static const uint8_t ae_data_aes_gcm_vect18_ctx[] = {
+ 0x5a, 0x8d, 0xef, 0x2f, 0x0c, 0x9e, 0x53, 0xf1,
+ 0xf7, 0x5d, 0x78, 0x53, 0x65, 0x9e, 0x2a, 0x20,
+ 0xee, 0xb2, 0xb2, 0x2a, 0xaf, 0xde, 0x64, 0x19,
+ 0xa0, 0x58, 0xab, 0x4f, 0x6f, 0x74, 0x6b, 0xf4,
+ 0x0f, 0xc0, 0xc3, 0xb7, 0x80, 0xf2, 0x44, 0x45,
+ 0x2d, 0xa3, 0xeb, 0xf1, 0xc5, 0xd8, 0x2c, 0xde,
+ 0xa2, 0x41, 0x89, 0x97, 0x20, 0x0e, 0xf8, 0x2e,
+ 0x44, 0xae, 0x7e, 0x3f,
+};
+static const uint8_t ae_data_aes_gcm_vect18_tag[] = {
+ 0xa4, 0x4a, 0x82, 0x66, 0xee, 0x1c, 0x8e, 0xb0,
+ 0xc8, 0xb5, 0xd4, 0xcf, 0x5a, 0xe9, 0xf1, 0x9a,
+};
+
+/*
+ * Test data generated with
+ * http://www.mobilefish.com/services/rsa_key_generation/rsa_key_generation.php
+ * selecting 1024 bit key
+ */
+static const uint8_t ac_rsassa_vect1_modulus[] = {
+ 0xab, 0x42, 0x30, 0x54, 0x02, 0x15, 0x19, 0x4f, 0x03, 0x15, 0x73, 0xdf,
+ 0x96, 0x4c, 0x23, 0xeb, 0xd3, 0xd5, 0xf2, 0xff, 0x17, 0xf4, 0x1f, 0x5c,
+ 0x41, 0x26, 0x3e, 0x20, 0x15, 0x6d, 0x0a, 0x70, 0x8d, 0x9e, 0x9e, 0x67,
+ 0x47, 0x87, 0x6a, 0x15, 0xb5, 0x40, 0x38, 0x99, 0x64, 0x90, 0xc1, 0x32,
+ 0x32, 0x95, 0xc7, 0x63, 0x0a, 0xac, 0x5b, 0xcc, 0x21, 0x6b, 0x51, 0x7b,
+ 0xa5, 0xef, 0x7b, 0x62, 0x12, 0x34, 0x2d, 0x8d, 0xb6, 0x0d, 0x24, 0x92,
+ 0xa4, 0x83, 0xd4, 0x3b, 0xa5, 0x29, 0xe2, 0x94, 0xfc, 0xcd, 0x5e, 0xcb,
+ 0xc6, 0x52, 0x7b, 0xf7, 0x65, 0x80, 0x1f, 0x63, 0xcb, 0x4f, 0x40, 0x27,
+ 0x5b, 0x2d, 0x2a, 0x9f, 0xce, 0x9b, 0x33, 0x97, 0xeb, 0xbe, 0xcb, 0x34,
+ 0x22, 0xff, 0x5f, 0x21, 0x21, 0xba, 0x75, 0xb3, 0xba, 0x8f, 0x00, 0x9e,
+ 0x08, 0x66, 0x86, 0x4a, 0x8e, 0x40, 0xb2, 0x5f
+};
+static const uint8_t ac_rsassa_vect1_pub_exp[] = {
+ 0x01, 0x00, 0x01
+};
+static const uint8_t ac_rsassa_vect1_priv_exp[] = {
+ 0x91, 0xaa, 0x4f, 0xae, 0xf4, 0xc2, 0x7b, 0x6f, 0x60, 0x21, 0x1c, 0x18,
+ 0xde, 0x1e, 0xcf, 0x22, 0xe4, 0x60, 0x83, 0x3a, 0x04, 0x66, 0xc9, 0x51,
+ 0xcf, 0xbc, 0x36, 0x75, 0x55, 0xa4, 0x14, 0x90, 0x1d, 0x75, 0x00, 0x28,
+ 0xba, 0x87, 0x6c, 0x6d, 0x20, 0x68, 0x8a, 0x7b, 0xb6, 0x35, 0x05, 0x8e,
+ 0xab, 0xc6, 0x07, 0xfc, 0xae, 0xf4, 0x61, 0x74, 0x24, 0x2c, 0xc2, 0xf6,
+ 0xd7, 0xf1, 0xf5, 0x4f, 0xd3, 0x68, 0x86, 0x9b, 0x40, 0x47, 0x74, 0x51,
+ 0x2a, 0xe3, 0x87, 0xe3, 0x6f, 0x8c, 0x2e, 0x71, 0xb9, 0xe1, 0x49, 0x62,
+ 0x8b, 0x1f, 0x00, 0x92, 0x51, 0x82, 0x5b, 0x56, 0xeb, 0x55, 0x4e, 0x17,
+ 0x67, 0x91, 0x74, 0xc3, 0x01, 0xdc, 0x34, 0xda, 0x56, 0x03, 0x3c, 0x5d,
+ 0x50, 0xb5, 0xa5, 0xf5, 0xd0, 0xe1, 0x84, 0x7f, 0x2c, 0x16, 0x86, 0x34,
+ 0x1d, 0xb1, 0x8f, 0xd9, 0xb4, 0x0b, 0x35, 0x79
+};
+static const uint8_t ac_rsassa_vect1_prime1[] = {
+ 0xec, 0xbb, 0x19, 0x15, 0xc6, 0x52, 0xee, 0xf2, 0x75, 0x0b, 0x2f, 0x4f,
+ 0x1b, 0x2e, 0xd5, 0x14, 0x13, 0x26, 0xb4, 0xb4, 0x8d, 0x1d, 0xbd, 0x27,
+ 0xbb, 0x38, 0xba, 0x2f, 0xa7, 0xc7, 0xb6, 0x76, 0x88, 0xad, 0x73, 0x24,
+ 0x56, 0xe4, 0xd6, 0x9e, 0xe1, 0x20, 0x50, 0x4e, 0x90, 0x09, 0xb1, 0xf7,
+ 0x58, 0x1f, 0x47, 0x82, 0x88, 0xe7, 0xd8, 0xab, 0x3c, 0x1c, 0x9d, 0xc1,
+ 0xa7, 0x79, 0x5c, 0x65
+};
+static const uint8_t ac_rsassa_vect1_prime2[] = {
+ 0xb9, 0x32, 0xce, 0x2d, 0x38, 0xb4, 0x21, 0x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bd, 0x71, 0x80, 0x10,
+ 0x1d, 0x82, 0x21, 0x66, 0x58, 0x01, 0x90, 0xfd, 0xdc, 0xcc, 0x11, 0xe2,
+ 0x3c, 0x19, 0x69, 0x55
+};
+static const uint8_t ac_rsassa_vect1_coeff[] = {
+ 0x2b, 0x9b, 0x48, 0xc0, 0xe1, 0xcb, 0x28, 0x9c, 0x03, 0xb2, 0xcf, 0xc6,
+ 0xf6, 0xbb, 0xbe, 0x1b, 0xad, 0xe6, 0x3b, 0xd3, 0x65, 0xbb, 0xca, 0xb7,
+ 0x43, 0x17, 0x8e, 0x3d, 0xb1, 0x6d, 0xc3, 0x06, 0xad, 0x7d, 0xe8, 0x81,
+ 0xb9, 0x5a, 0x13, 0xad, 0x18, 0x46, 0xcd, 0x93, 0xb6, 0x44, 0x1f, 0xd0,
+ 0x4d, 0x73, 0xb1, 0x00, 0x4d, 0x46, 0xc8, 0x22, 0x4a, 0x7e, 0xb8, 0xe6,
+ 0xdd, 0xae, 0x5f, 0x40
+};
+static const uint8_t ac_rsassa_vect1_ptx[] = {
+ 0x91, 0x07, 0xf4, 0x49, 0x0a, 0xf9, 0x99, 0x12, 0xaa, 0x95, 0x02, 0x76,
+ 0x95, 0x1b, 0xfa, 0x94, 0x32, 0xbf
+};
+static const uint8_t ac_rsassa_vect1_out[] = {
+ 0x5f, 0xf8, 0xc0, 0x00, 0x4b, 0xd6, 0x5a, 0x3b, 0xf9, 0x34, 0xad, 0xca,
+ 0x24, 0x8f, 0x8f, 0x99, 0xba, 0x24, 0xb3, 0x84, 0x1b, 0x82, 0xff, 0xdb,
+ 0x35, 0x00, 0xa0, 0x66, 0x62, 0xc3, 0x85, 0x4d, 0xfc, 0x4b, 0x42, 0xce,
+ 0xd1, 0x29, 0x39, 0x04, 0x16, 0xcb, 0xa2, 0x53, 0x12, 0x5d, 0x71, 0x5c,
+ 0xcd, 0x37, 0xcb, 0x0a, 0x5d, 0x07, 0xdd, 0xb2, 0x18, 0x94, 0x47, 0x2a,
+ 0x82, 0x64, 0x7a, 0xd3, 0xbb, 0x83, 0xc5, 0x9c, 0x50, 0x85, 0x65, 0x94,
+ 0x0f, 0x01, 0xfe, 0x20, 0xa0, 0x83, 0x4f, 0x3b, 0x78, 0x99, 0x48, 0x94,
+ 0x36, 0xaf, 0x4a, 0xac, 0x89, 0xfa, 0xf6, 0xf8, 0x42, 0x86, 0xa5, 0xbe,
+ 0x0d, 0xb3, 0x39, 0x42, 0xa0, 0x70, 0x56, 0x5f, 0xea, 0xc6, 0x8f, 0x31,
+ 0xfe, 0x56, 0x56, 0xac, 0xf7, 0x4c, 0x9b, 0x8a, 0x06, 0x5a, 0xbd, 0x61,
+ 0x92, 0xfc, 0xef, 0x4b, 0x26, 0x36, 0x6d, 0x91
+};
+
+
+/*
+ * Test data generated with
+ * http://www.mobilefish.com/services/rsa_key_generation/rsa_key_generation.php
+ * selecting 2048 bit key
+ */
+static const uint8_t ac_rsassa_vect2_modulus[] = {
+ 0x9a, 0x83, 0xda, 0x0e, 0xfb, 0xa1, 0x77, 0xc5, 0x34, 0x88, 0xac, 0x3d,
+ 0xd1, 0x3e, 0x89, 0x3e, 0xca, 0xad, 0x40, 0x47, 0xdc, 0xff, 0xc6, 0x18,
+ 0xc3, 0x1a, 0x95, 0xd3, 0x82, 0xb9, 0x98, 0xa8, 0xec, 0x90, 0xbe, 0xab,
+ 0xef, 0x74, 0xb7, 0x58, 0xa0, 0x0d, 0x0f, 0xb5, 0x13, 0xb8, 0x7e, 0xf7,
+ 0xdb, 0x19, 0x77, 0x55, 0xc5, 0xed, 0xa6, 0x60, 0xa7, 0xaf, 0xea, 0x83,
+ 0x69, 0xcf, 0xcf, 0x50, 0x51, 0x94, 0xa7, 0xc0, 0x96, 0x68, 0xe6, 0x63,
+ 0xef, 0xdf, 0xa8, 0x28, 0x4a, 0x50, 0xbf, 0xd7, 0x44, 0xbf, 0x0b, 0x0a,
+ 0x41, 0xd6, 0x02, 0xfc, 0x3f, 0x06, 0x51, 0x82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1e, 0x65, 0x65, 0xde, 0x2e, 0xdc, 0x93, 0x02, 0xc2,
+ 0xbb, 0x9f, 0x7e, 0xec, 0xa3, 0xc4, 0x8f, 0x05, 0x07, 0xce, 0xbb, 0x9a,
+ 0x53, 0x1c, 0x57, 0x77, 0x89, 0xff, 0x6c, 0xcb, 0xf8, 0xa1, 0xde, 0xbe,
+ 0x14, 0x4b, 0xee, 0xd6, 0xad, 0x27, 0x04, 0x99
+};
+static const uint8_t ac_rsassa_vect2_prime2[] = {
+ 0xc0, 0x05, 0x4f, 0x58, 0xa0, 0x22, 0x58, 0x60, 0x7b, 0xef, 0x87, 0x1f,
+ 0x87, 0x39, 0x47, 0x48, 0xa8, 0x86, 0x15, 0xd5, 0xf9, 0xb5, 0xf8, 0x71,
+ 0x81, 0xf9, 0xb7, 0x3e, 0x4a, 0xe8, 0x5d, 0xbc, 0xbf, 0x8f, 0x17, 0xc0,
+ 0x96, 0xdc, 0xc2, 0x7f, 0x5e, 0x60, 0x65, 0xe7, 0xa2, 0xc6, 0x30, 0x25,
+ 0x8b, 0xe9, 0xdb, 0x28, 0x10, 0xac, 0x02, 0x0e, 0x23, 0x0f, 0x14, 0x6b,
+ 0xff, 0xd4, 0x09, 0xdd, 0x7c, 0x06, 0x5d, 0xb2, 0x6e, 0x32, 0x49, 0x62,
+ 0xb7, 0x93, 0x5d, 0x24, 0x99, 0x03, 0x69, 0x9b, 0x60, 0x2e, 0x34, 0xa3,
+ 0x9f, 0x62, 0x33, 0xaf, 0xc5, 0xdc, 0x8f, 0x10, 0x61, 0xfa, 0xc5, 0x8d,
+ 0xa9, 0xcc, 0x86, 0x93, 0x7d, 0x1e, 0xa6, 0x7d, 0xcb, 0x6e, 0x69, 0xfe,
+ 0xe1, 0x3c, 0x64, 0x01, 0x58, 0xd8, 0x1a, 0x0f, 0xf8, 0xcc, 0x34, 0xe5,
+ 0x01, 0x2c, 0xb8, 0xf9, 0x90, 0x71, 0xe5, 0x35
+};
+static const uint8_t ac_rsass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 0xbc, 0xad, 0xf7, 0xe1, 0xdd, 0x48, 0xfd, 0x98, 0x82,
+ 0x06, 0x11, 0xac, 0xc5, 0x74, 0xb5, 0xa9, 0x16, 0x4a, 0x6c, 0xc1, 0xae,
+ 0x25, 0x70, 0xde, 0x96, 0xcf, 0xad, 0x2a, 0x8b, 0x89, 0x39, 0x77, 0x94,
+ 0xae, 0x4b, 0x84, 0x02, 0x92, 0x0c, 0x05, 0x42
+};
+static const uint8_t ac_rsassa_vect2_ptx[] = {
+ 0x91, 0x07, 0xf4, 0x49, 0x0a, 0xf9, 0x99, 0x12, 0xaa, 0x95, 0x02, 0x76,
+ 0x95, 0x1b, 0xfa, 0x94, 0x32, 0xbf
+};
+static const uint8_t ac_rsassa_vect2_out[] = {
+ 0x47, 0x16, 0xe1, 0xee, 0x54, 0xb7, 0xe0, 0x8a, 0xcc, 0x5d, 0x1b, 0xae,
+ 0xde, 0xc1, 0x43, 0x09, 0xd8, 0x4d, 0xe3, 0xcd, 0x5f, 0xd5, 0x48, 0x51,
+ 0xd3, 0x1c, 0x62, 0x5d, 0x1c, 0x13, 0x0b, 0x05, 0x89, 0x77, 0xd6, 0x95,
+ 0x4e, 0x8f, 0x4a, 0x0a, 0x51, 0xc2, 0x0c, 0xcf, 0xfe, 0x4c, 0x24, 0x6d,
+ 0x0c, 0x73, 0x33, 0x46, 0xd9, 0xdf, 0xfe, 0x6e, 0x06, 0xcb, 0x8c, 0x79,
+ 0x32, 0x3f, 0xbd, 0x1d, 0x10, 0x3a, 0x60, 0x3c, 0xe8, 0x1c, 0xbe, 0xd9,
+ 0xa8, 0x00, 0x76, 0x5b, 0x6d, 0x7a, 0x62, 0xdd, 0x3c, 0x21, 0x53, 0x16,
+ 0xab, 0x0b, 0x6c, 0x8d, 0x43, 0xfd, 0xba, 0x9a, 0xd9, 0x9a, 0xc1, 0x21,
+ 0x0c, 0x79, 0x78, 0x93, 0x86, 0xbd, 0xdf, 0x63, 0xca, 0xc8, 0xd6, 0xc6,
+ 0x20, 0xc9, 0x08, 0xf6, 0xc8, 0xfe, 0x22, 0xa4, 0xc6, 0xe3, 0x49, 0xe4,
+ 0x63, 0x01, 0x03, 0x5b, 0x78, 0x63, 0x3a, 0x02, 0x9c, 0xa1, 0xed, 0x20,
+ 0x01, 0x10, 0x79, 0x2e, 0x8d, 0xe5, 0x70, 0xae, 0x1a, 0x5f, 0x72, 0x9e,
+ 0x31, 0xab, 0x21, 0xd3, 0xd7, 0x59, 0x5f, 0x26, 0xbf, 0x45, 0x31, 0x6d,
+ 0xc3, 0xa6, 0x45, 0x7b, 0x6d, 0x8e, 0x3c, 0xb0, 0x42, 0xb4, 0xeb, 0x09,
+ 0xcf, 0x54, 0x0a, 0x72, 0x38, 0xf8, 0x67, 0x83, 0xa7, 0x7b, 0xce, 0x52,
+ 0x74, 0x0f, 0x03, 0x9d, 0x09, 0x1f, 0xe7, 0xf0, 0x85, 0x27, 0x3e, 0x1d,
+ 0x2f, 0xea, 0x2d, 0xa8, 0xdc, 0x58, 0x00, 0x9b, 0xdc, 0x10, 0x95, 0xe4,
+ 0x5f, 0x69, 0x20, 0x11, 0x1c, 0x3c, 0x58, 0x27, 0xcd, 0x1f, 0x23, 0xc9,
+ 0x28, 0xfa, 0x98, 0x53, 0xce, 0xa6, 0xe6, 0x64, 0x20, 0x2e, 0xe1, 0x2b,
+ 0x35, 0x30, 0x4e, 0xb2, 0x14, 0xaa, 0x7f, 0x89, 0x6f, 0xa8, 0xb1, 0xd6,
+ 0x30, 0x2c, 0x7c, 0xe5, 0x26, 0xe4, 0xce, 0x61, 0x6c, 0xc6, 0x06, 0xbc,
+ 0xea, 0x26, 0x6f, 0xe4
+};
+
+/*
+ * Test data from ftp://ftp.rsa.com/pub/rsalabs/tmp/pkcs1v15sign-vectors.txt
+ *
+ * As specified in PKCS#1, the block type for this operation
+ * is 1. The digest algorithm is SHA-1; i.e. the given message
+ * must be hashed and the SHA-1 hash must be encapsulated in a
+ * DigestInfo structure as specified in PKCS#1 v1.5.
+ */
+
+/* PKCS#1 v1.5 Signature Example 1 1024-bit RSA key pair */
+static const uint8_t ac_rsassa_example1_modulus[] = {
+ 0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51, 0x87, 0xdc,
+ 0x7e, 0xa8, 0x41, 0xd1,
+ 0x56, 0xf2, 0xec, 0x0e, 0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6,
+ 0x1f, 0x7a, 0xd9, 0x91,
+ 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62, 0xb4, 0xc0, 0xf2, 0x83,
+ 0xa1, 0x2a, 0x88, 0xa3,
+ 0x94, 0xdf, 0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
+ 0xfc, 0xe0, 0xb1, 0xdf,
+ 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d, 0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6,
+ 0x71, 0xef, 0x63, 0x77,
+ 0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59, 0x8e, 0x6f,
+ 0xf8, 0x9d, 0x19, 0xf1,
+ 0x05, 0xac, 0xc2, 0xd3, 0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38,
+ 0x6b, 0x6f, 0x64, 0xc4,
+ 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8, 0xcf, 0xfb, 0x22, 0x49,
+ 0xbd, 0x9a, 0x21, 0x37,
+};
+static const uint8_t ac_rsassa_example1_pub_exp[] = {
+ 0x01, 0x00, 0x01
+};
+static const uint8_t ac_rsassa_example1_priv_exp[] = {
+ 0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51, 0xca, 0x9b,
+ 0xbb, 0xd0, 0xb4, 0x47,
+ 0x71, 0x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, 0x3e,
+ 0xda, 0x8e, 0x64, 0x43,
+};
+static const uint8_t ac_rsassa_example1_prime2[] = {
+ 0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7, 0x5b, 0x90,
+ 0xfc, 0xca, 0x87, 0x4a,
+ 0xbc, 0xde, 0x12, 0x3f, 0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b,
+ 0x6e, 0x48, 0xde, 0x8d,
+ 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba, 0x27, 0x58, 0x74, 0xf5,
+ 0x42, 0xcd, 0x20, 0xdc,
+ 0x72, 0x3e, 0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
+ 0x9a, 0x67, 0x99, 0xfd,
+};
+static const uint8_t ac_rsassa_example1_exp1[] = {
+ 0x28, 0xfa, 0x13, 0x93, 0x86, 0x55, 0xbe, 0x1f, 0x8a, 0x15, 0x9c, 0xba,
+ 0xca, 0x5a, 0x72, 0xea,
+ 0x19, 0x0c, 0x30, 0x08, 0x9e, 0x19, 0xcd, 0x27, 0x4a, 0x55, 0x6f, 0x36,
+ 0xc4, 0xf6, 0xe1, 0x9f,
+ 0x55, 0x4b, 0x34, 0xc0, 0x77, 0x79, 0x04, 0x27, 0xbb, 0xdd, 0x8d, 0xd3,
+ 0xed, 0xe2, 0x44, 0x83,
+ 0x28, 0xf3, 0x85, 0xd8, 0x1b, 0x30, 0xe8, 0xe4, 0x3b, 0x2f, 0xff, 0xa0,
+ 0x27, 0x86, 0x19, 0x79,
+};
+static const uint8_t ac_rsassa_example1_exp2[] = {
+ 0x1a, 0x8b, 0x38, 0xf3, 0x98, 0xfa, 0x71, 0x20, 0x49, 0x89, 0x8d, 0x7f,
+ 0xb7, 0x9e, 0xe0, 0xa7,
+ 0x76, 0x68, 0x79, 0x12, 0x99, 0xcd, 0xfa, 0x09, 0xef, 0xc0, 0xe5, 0x07,
+ 0xac, 0xb2, 0x1e, 0xd7,
+ 0x43, 0x01, 0xef, 0x5b, 0xfd, 0x48, 0xbe, 0x45, 0x5e, 0xae, 0xb6, 0xe1,
+ 0x67, 0x82, 0x55, 0x82,
+ 0x75, 0x80, 0xa8, 0xe4, 0xe8, 0xe1, 0x41, 0x51, 0xd1, 0x51, 0x0a, 0x82,
+ 0xa3, 0xf2, 0xe7, 0x29,
+};
+static const uint8_t ac_rsassa_example1_coeff[] = {
+ 0x27, 0x15, 0x6a, 0xba, 0x41, 0x26, 0xd2, 0x4a, 0x81, 0xf3, 0xa5, 0x28,
+ 0xcb, 0xfb, 0x27, 0xf5,
+ 0x68, 0x86, 0xf8, 0x40, 0xa9, 0xf6, 0xe8, 0x6e, 0x17, 0xa4, 0x4b, 0x94,
+ 0xfe, 0x93, 0x19, 0x58,
+ 0x4b, 0x8e, 0x22, 0xfd, 0xde, 0x1e, 0x5a, 0x2e, 0x3b, 0xd8, 0xaa, 0x5b,
+ 0xa8, 0xd8, 0x58, 0x41,
+ 0x94, 0xeb, 0x21, 0x90, 0xac, 0xf8, 0x32, 0xb8, 0x47, 0xf1, 0x3a, 0x3d,
+ 0x24, 0xa7, 0x9f, 0x4d,
+};
+
+/* PKCS#1 v1.5 Signature Example 1.1 */
+#define ac_rsassa_vect3_modulus ac_rsassa_example1_modulus
+#define ac_rsassa_vect3_pub_exp ac_rsassa_example1_pub_exp
+#define ac_rsassa_vect3_priv_exp ac_rsassa_example1_priv_exp
+#define ac_rsassa_vect3_prime1 ac_rsassa_example1_prime1
+#define ac_rsassa_vect3_prime2 ac_rsassa_example1_prime2
+#define ac_rsassa_vect3_exp1 ac_rsassa_example1_exp1
+#define ac_rsassa_vect3_exp2 ac_rsassa_example1_exp2
+#define ac_rsassa_vect3_coeff ac_rsassa_example1_coeff
+static const uint8_t ac_rsassa_vect3_ptx[] = {
+ 0xcd, 0xc8, 0x7d, 0xa2, 0x23, 0xd7, 0x86, 0xdf, 0x3b, 0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 */
+#define ac_rsassa_vect4_modulus ac_rsassa_example1_modulus
+#define ac_rsassa_vect4_pub_exp ac_rsassa_example1_pub_exp
+#define ac_rsassa_vect4_priv_exp ac_rsassa_example1_priv_exp
+#define ac_rsassa_vect4_prime1 ac_rsassa_example1_prime1
+#define ac_rsassa_vect4_prime2 ac_rsassa_example1_prime2
+#define ac_rsassa_vect4_exp1 ac_rsassa_example1_exp1
+#define ac_rsassa_vect4_exp2 ac_rsassa_example1_exp2
+#define ac_rsassa_vect4_coeff ac_rsassa_example1_coeff
+static const uint8_t ac_rsassa_vect4_ptx[] = {
+ 0x85, 0x13, 0x84, 0xcd, 0xfe, 0x81, 0x9c, 0x22, 0xed, 0x6c, 0x4c, 0xcb,
+ 0x30, 0xda, 0xeb, 0x5c,
+ 0xf0, 0x59, 0xbc, 0x8e, 0x11, 0x66, 0xb7, 0xe3, 0x53, 0x0c, 0x4c, 0x23,
+ 0x3e, 0x2b, 0x5f, 0x8f,
+ 0x71, 0xa1, 0xcc, 0xa5, 0x82, 0xd4, 0x3e, 0xcc, 0x72, 0xb1, 0xbc, 0xa1,
+ 0x6d, 0xfc, 0x70, 0x13,
+ 0x22, 0x6b, 0x9e,
+};
+static const uint8_t ac_rsassa_vect4_out[] = {
+ 0x84, 0xfd, 0x2c, 0xe7, 0x34, 0xec, 0x1d, 0xa8, 0x28, 0xd0, 0xf1, 0x5b,
+ 0xf4, 0x9a, 0x87, 0x07,
+ 0xc1, 0x5d, 0x05, 0x94, 0x81, 0x36, 0xde, 0x53, 0x7a, 0x3d, 0xb4, 0x21,
+ 0x38, 0x41, 0x67, 0xc8,
+ 0x6f, 0xae, 0x02, 0x25, 0x87, 0xee, 0x9e, 0x13, 0x7d, 0xae, 0xe7, 0x54,
+ 0x73, 0x82, 0x62, 0x93,
+ 0x2d, 0x27, 0x1c, 0x74, 0x4c, 0x6d, 0x3a, 0x18, 0x9a, 0xd4, 0x31, 0x1b,
+ 0xdb, 0x02, 0x04, 0x92,
+ 0xe3, 0x22, 0xfb, 0xdd, 0xc4, 0x04, 0x06, 0xea, 0x86, 0x0d, 0x4e, 0x8e,
+ 0xa2, 0xa4, 0x08, 0x4a,
+ 0xa9, 0x8b, 0x96, 0x22, 0xa4, 0x46, 0x75, 0x6f, 0xdb, 0x74, 0x0d, 0xdb,
+ 0x3d, 0x91, 0xdb, 0x76,
+ 0x70, 0xe2, 0x11, 0x66, 0x1b, 0xbf, 0x87, 0x09, 0xb1, 0x1c, 0x08, 0xa7,
+ 0x07, 0x71, 0x42, 0x2d,
+ 0x1a, 0x12, 0xde, 0xf2, 0x9f, 0x06, 0x88, 0xa1, 0x92, 0xae, 0xbd, 0x89,
+ 0xe0, 0xf8, 0x96, 0xf8,
+};
+
+/* PKCS#1 v1.5 Signature Example 1.3 */
+#define ac_rsassa_vect5_modulus ac_rsassa_example1_modulus
+#define ac_rsassa_vect5_pub_exp ac_rsassa_example1_pub_exp
+#define ac_rsassa_vect5_priv_exp ac_rsassa_example1_priv_exp
+#define ac_rsassa_vect5_prime1 ac_rsassa_example1_prime1
+#define ac_rsassa_vect5_prime2 ac_rsassa_example1_prime2
+#define ac_rsassa_vect5_exp1 ac_rsassa_example1_exp1
+#define ac_rsassa_vect5_exp2 ac_rsassa_example1_exp2
+#define ac_rsassa_vect5_coeff ac_rsassa_example1_coeff
+static const uint8_t ac_rsassa_vect5_ptx[] = {
+ 0xa4, 0xb1, 0x59, 0x94, 0x17, 0x61, 0xc4, 0x0c, 0x6a, 0x82, 0xf2, 0xb8,
+ 0x0d, 0x1b, 0x94, 0xf5,
+ 0xaa, 0x26, 0x54, 0xfd, 0x17, 0xe1, 0x2d, 0x58, 0x88, 0x64, 0x67, 0x9b,
+ 0x54, 0xcd, 0x04, 0xef,
+ 0x8b, 0xd0, 0x30, 0x12, 0xbe, 0x8d, 0xc3, 0x7f, 0x4b, 0x83, 0xaf, 0x79,
+ 0x63, 0xfa, 0xff, 0x0d,
+ 0xfa, 0x22, 0x54, 0x77, 0x43, 0x7c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, 0x70
+};
+static const uint8_t ac_rsassa_vect5_out[] = {
+ 0x0b, 0x1f, 0x2e, 0x51, 0x80, 0xe5, 0xc7, 0xb4, 0xb5, 0xe6, 0x72, 0x92,
+ 0x9f, 0x66, 0x4c, 0x48,
+ 0x96, 0xe5, 0x0c, 0x35, 0x13, 0x4b, 0x6d, 0xe4, 0xd5, 0xa9, 0x34, 0x25,
+ 0x2a, 0x3a, 0x24, 0x5f,
+ 0xf4, 0x83, 0x40, 0x92, 0x0e, 0x10, 0x34, 0xb7, 0xd5, 0xa5, 0xb5, 0x24,
+ 0xeb, 0x0e, 0x1c, 0xf1,
+ 0x2b, 0xef, 0xef, 0x49, 0xb2, 0x7b, 0x73, 0x2d, 0x2c, 0x19, 0xe1, 0xc4,
+ 0x32, 0x17, 0xd6, 0xe1,
+ 0x41, 0x73, 0x81, 0x11, 0x1a, 0x1d, 0x36, 0xde, 0x63, 0x75, 0xcf, 0x45,
+ 0x5b, 0x3c, 0x98, 0x12,
+ 0x63, 0x9d, 0xbc, 0x27, 0x60, 0x0c, 0x75, 0x19, 0x94, 0xfb, 0x61, 0x79,
+ 0x9e, 0xcf, 0x7d, 0xa6,
+ 0xbc, 0xf5, 0x15, 0x40, 0xaf, 0xd0, 0x17, 0x4d, 0xb4, 0x03, 0x31, 0x88,
+ 0x55, 0x66, 0x75, 0xb1,
+ 0xd7, 0x63, 0x36, 0x0a, 0xf4, 0x6f, 0xee, 0xca, 0x5b, 0x60, 0xf8, 0x82,
+ 0x82, 0x9e, 0xe7, 0xb2,
+};
+
+/* PKCS#1 v1.5 Signature Example 1.4 */
+#define ac_rsassa_vect6_modulus ac_rsassa_example1_modulus
+#define ac_rsassa_vect6_pub_exp ac_rsassa_example1_pub_exp
+#define ac_rsassa_vect6_priv_exp ac_rsassa_example1_priv_exp
+#define ac_rsassa_vect6_prime1 ac_rsassa_example1_prime1
+#define ac_rsassa_vect6_prime2 ac_rsassa_example1_prime2
+#define ac_rsassa_vect6_exp1 ac_rsassa_example1_exp1
+#define ac_rsassa_vect6_exp2 ac_rsassa_example1_exp2
+#define ac_rsassa_vect6_coeff ac_rsassa_example1_coeff
+static const uint8_t ac_rsassa_vect6_ptx[] = {
+ 0xbc, 0x65, 0x67, 0x47, 0xfa, 0x9e, 0xaf, 0xb3, 0xf0
+};
+static const uint8_t ac_rsassa_vect6_out[] = {
+ 0x45, 0x60, 0x7a, 0xd6, 0x11, 0xcf, 0x57, 0x47, 0xa4, 0x1a, 0xc9, 0x4d,
+ 0x0f, 0xfe, 0xc8, 0x78,
+ 0xbd, 0xaf, 0x63, 0xf6, 0xb5, 0x7a, 0x4b, 0x08, 0x8b, 0xf3, 0x6e, 0x34,
+ 0xe1, 0x09, 0xf8, 0x40,
+ 0xf2, 0x4b, 0x74, 0x2a, 0xda, 0x16, 0x10, 0x2d, 0xab, 0xf9, 0x51, 0xcb,
+ 0xc4, 0x4f, 0x89, 0x82,
+ 0xe9, 0x4e, 0xd4, 0xcd, 0x09, 0x44, 0x8d, 0x20, 0xec, 0x0e, 0xfa, 0x73,
+ 0x54, 0x5f, 0x80, 0xb6,
+ 0x54, 0x06, 0xbe, 0xd6, 0x19, 0x4a, 0x61, 0xc3, 0x40, 0xb4, 0xad, 0x15,
+ 0x68, 0xcb, 0xb7, 0x58,
+ 0x51, 0x04, 0x9f, 0x11, 0xaf, 0x17, 0x34, 0x96, 0x40, 0x76, 0xe0, 0x20,
+ 0x29, 0xae, 0xe2, 0x00,
+ 0xe4, 0x0e, 0x80, 0xbe, 0x0f, 0x43, 0x61, 0xf6, 0x98, 0x41, 0xc4, 0xf9,
+ 0x2a, 0x44, 0x50, 0xa2,
+ 0x28, 0x6d, 0x43, 0x28, 0x9b, 0x40, 0x55, 0x54, 0xc5, 0x4d, 0x25, 0xc6,
+ 0xec, 0xb5, 0x84, 0xf4,
+};
+
+/* PKCS#1 v1.5 Signature Example 7 1025-bit RSA key pair */
+static const uint8_t ac_rsassa_example2_modulus[] = {
+ 0x01, 0x69, 0x34, 0xcd, 0xff, 0x48, 0x50, 0xb6, 0x00, 0x2c, 0xc0, 0xf0,
+ 0xf4, 0x01, 0x0a, 0x32,
+ 0xc6, 0x55, 0xe5, 0xcf, 0x6e, 0x7c, 0x89, 0x93, 0x7f, 0xd7, 0x55, 0xef,
+ 0x6a, 0xbe, 0x37, 0x9d,
+ 0xad, 0xde, 0x70, 0xcc, 0x21, 0x77, 0x51, 0xf1, 0x4c, 0xba, 0x6d, 0x90,
+ 0xfe, 0x52, 0xdc, 0x0a,
+ 0xf5, 0x8b, 0x25, 0x2f, 0x26, 0xbf, 0x72, 0xda, 0x57, 0x9f, 0xda, 0xf5,
+ 0x7d, 0xdd, 0x6c, 0xd6,
+ 0x02, 0x18, 0x79, 0x94, 0x9a, 0x02, 0x76, 0xb4, 0x43, 0x3f, 0xf0, 0x1e,
+ 0xfc, 0xcc, 0xf3, 0x5a,
+ 0x11, 0xe7, 0xc7, 0x7b, 0x38, 0xc1, 0x8c, 0xca, 0x94, 0xae, 0x01, 0x2d,
+ 0x0f, 0x37, 0x04, 0x21,
+ 0x49, 0x1c, 0x52, 0xad, 0x15, 0xac, 0x76, 0xb1, 0x2e, 0xcd, 0x21, 0x8f,
+ 0x52, 0xe7, 0x57, 0x86,
+ 0x6e, 0x08, 0x9d, 0xd8, 0xad, 0xbb, 0x48, 0xe9, 0xba, 0x89, 0x43, 0x36,
+ 0xc5, 0x75, 0xc4, 0x06,
+ 0x55
+};
+static const uint8_t ac_rsassa_example2_pub_exp[] = {
+ 0x01, 0x00, 0x01
+};
+static const uint8_t ac_rsassa_example2_priv_exp[] = {
+ 0x0d, 0x17, 0x19, 0xe5, 0xbd, 0x47, 0x6d, 0x87, 0xc7, 0xec, 0xc3, 0x1e,
+ 0xb8, 0xab, 0x42, 0x5d,
+ 0x4f, 0xe4, 0xc8, 0xf5, 0xc7, 0xae, 0x23, 0x0a, 0x10, 0x47, 0x55, 0x3f,
+ 0xfb, 0x53, 0x9f, 0xd3,
+ 0x85, 0x5a, 0xf5, 0xa4, 0x3b, 0x2d, 0xdd, 0x4e, 0x95, 0xa2, 0xb3, 0x0d,
+ 0x40, 0x7a, 0xa8, 0x81,
+ 0x59, 0xbb, 0xad, 0x2a, 0x87, 0x3d, 0x80, 0x93, 0xb4, 0x8a, 0x4b, 0xce,
+ 0x20, 0xad, 0x99, 0x26,
+ 0x25, 0x3e, 0xd3, 0x39, 0xac, 0x3b, 0x54, 0x3f, 0xc7, 0x42, 0x96, 0x95,
+ 0x33, 0x8d, 0xb0, 0xbc,
+ 0x1d, 0xc3, 0x68, 0x6c, 0xfd, 0x13, 0x9b, 0xb5, 0xb2, 0x87, 0x36, 0xbc,
+ 0x16, 0x60, 0xa9, 0x53,
+ 0x48, 0xfc, 0x91, 0xc3, 0x25, 0xd0, 0x3a, 0x7f, 0xb2, 0x16, 0xd2, 0xd9,
+ 0xcd, 0x93, 0x64, 0xde,
+ 0x4e, 0xe7, 0xd2, 0x11, 0x9c, 0x3b, 0x0f, 0xbb, 0xa8, 0xa7, 0x1f, 0x0d,
+ 0x3f, 0x5a, 0xb9, 0xb9,
+};
+static const uint8_t ac_rsassa_example2_prime1[] = {
+ 0x01, 0x58, 0xc0, 0x24, 0x6c, 0xd1, 0x69, 0xfc, 0x59, 0x3b, 0x25, 0x8b,
+ 0xbf, 0x45, 0x23, 0xab,
+ 0x2b, 0x55, 0xc4, 0x60, 0x73, 0x3a, 0x7f, 0xb4, 0x69, 0x10, 0x90, 0x77,
+ 0xb3, 0x0e, 0x4d, 0x35,
+ 0xf2, 0x1a, 0x35, 0xb1, 0xf4, 0x1e, 0x42, 0x04, 0xe8, 0x1d, 0x2e, 0x4c,
+ 0x46, 0x3c, 0x24, 0x11,
+ 0x39, 0x34, 0x09, 0x8b, 0x45, 0x2d, 0xab, 0x4b, 0xe1, 0x59, 0x97, 0x20,
+ 0xef, 0x68, 0x72, 0x83,
+ 0x3d
+};
+static const uint8_t ac_rsassa_example2_prime2[] = {
+ 0x01, 0x0c, 0x38, 0x2d, 0xea, 0x5e, 0x7d, 0x79, 0x29, 0x8c, 0x64, 0x1f,
+ 0xb2, 0xe4, 0xfa, 0x09,
+ 0xf2, 0x4f, 0x6a, 0x7a, 0x45, 0x9a, 0x88, 0x2c, 0x87, 0xa8, 0x03, 0x49,
+ 0x5f, 0x05, 0x6e, 0xcc,
+ 0x3b, 0x43, 0xc5, 0x37, 0x73, 0x1f, 0x85, 0xef, 0xc8, 0xfb, 0x53, 0x87,
+ 0xad, 0x67, 0x31, 0xa6,
+ 0x43, 0x53, 0x32, 0x15, 0xde, 0xcc, 0x38, 0x7d, 0x96, 0x76, 0x12, 0x2c,
+ 0x17, 0x0e, 0x91, 0xe0,
+ 0xf9
+};
+static const uint8_t ac_rsassa_example2_exp1[] = {
+ 0xd5, 0x78, 0xdc, 0xd5, 0x38, 0xf2, 0xfc, 0xdc, 0x30, 0x00, 0xb6, 0xc0,
+ 0xf0, 0x49, 0xfe, 0xe2,
+ 0xad, 0x90, 0x14, 0xfd, 0x24, 0xfb, 0x10, 0xb6, 0x82, 0x18, 0x42, 0xd6,
+ 0x70, 0x03, 0xa5, 0x64,
+ 0xcd, 0x8f, 0xf4, 0x2a, 0x2a, 0x56, 0x4c, 0xfd, 0x81, 0x9c, 0x3a, 0x84,
+ 0xbf, 0x16, 0xc2, 0x47,
+ 0x7e, 0x8e, 0x6e, 0x5b, 0x9e, 0xc4, 0xd4, 0x0e, 0xad, 0x50, 0x24, 0x87,
+ 0xba, 0x50, 0x36, 0x2d,
+};
+static const uint8_t ac_rsassa_example2_exp2[] = {
+ 0x88, 0x88, 0xdc, 0x8e, 0xae, 0x94, 0xee, 0xa5, 0x80, 0xca, 0xc2, 0xfc,
+ 0x1c, 0xe5, 0x4f, 0x44,
+ 0xe2, 0xba, 0x50, 0x0d, 0xb8, 0x71, 0x53, 0x41, 0xa6, 0xfc, 0x2d, 0x50,
+ 0x4a, 0x82, 0xb1, 0x42,
+ 0x05, 0xe8, 0x91, 0xa6, 0x6f, 0xc8, 0x8d, 0x5c, 0x60, 0xdb, 0x8f, 0x78,
+ 0x6c, 0xcc, 0x70, 0x57,
+ 0x5b, 0x35, 0x66, 0xbe, 0xa8, 0x74, 0xa5, 0x31, 0x7f, 0x5f, 0x16, 0xc4,
+ 0x91, 0xed, 0x1e, 0x79,
+};
+static const uint8_t ac_rsassa_example2_coeff[] = {
+ 0x17, 0xb0, 0xd6, 0x23, 0x36, 0x19, 0x1e, 0x63, 0xbc, 0xa1, 0x59, 0x93,
+ 0x4d, 0x06, 0x16, 0xcb,
+ 0x89, 0x97, 0x40, 0x9c, 0xbf, 0xca, 0x37, 0x05, 0x69, 0x5b, 0x14, 0xfb,
+ 0x64, 0xa0, 0x81, 0xc1,
+ 0xc9, 0xf5, 0x86, 0x19, 0x3e, 0x52, 0x3a, 0xbd, 0x0b, 0xeb, 0x8d, 0x72,
+ 0x0c, 0xfe, 0x53, 0x7d,
+ 0xfa, 0x1e, 0xde, 0xc4, 0xa6, 0x64, 0x37, 0xd2, 0x41, 0x19, 0x6b, 0x7a,
+ 0x2c, 0xe5, 0x56, 0xc4,
+};
+
+
+/* PKCS#1 v1.5 Signature Example 7.1 */
+#define ac_rsassa_vect7_modulus ac_rsassa_example2_modulus
+#define ac_rsassa_vect7_pub_exp ac_rsassa_example2_pub_exp
+#define ac_rsassa_vect7_priv_exp ac_rsassa_example2_priv_exp
+#define ac_rsassa_vect7_prime1 ac_rsassa_example2_prime1
+#define ac_rsassa_vect7_prime2 ac_rsassa_example2_prime2
+#define ac_rsassa_vect7_exp1 ac_rsassa_example2_exp1
+#define ac_rsassa_vect7_exp2 ac_rsassa_example2_exp2
+#define ac_rsassa_vect7_coeff ac_rsassa_example2_coeff
+static const uint8_t ac_rsassa_vect7_ptx[] = {
+ 0x35, 0x39, 0x99, 0x7a, 0xe7, 0x09, 0xfe, 0x32, 0xc1, 0x03, 0x6a, 0x13,
+ 0x27, 0x57, 0xf2, 0xa1,
+ 0x66, 0x7a, 0x91, 0xcc, 0x83,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a2, 0x90, 0xb2,
+ 0x3a, 0xba, 0xab, 0x51, 0x8f, 0x09, 0x44, 0x7e, 0x45, 0xae, 0xe6, 0xf3,
+ 0xbd, 0x06, 0x10, 0x24,
+ 0x44, 0x36, 0xa4, 0x73, 0x01, 0x60, 0xe6, 0xa6, 0x72, 0x11, 0x0c, 0x01,
+ 0xae, 0xb5, 0x62, 0x4b,
+ 0x71, 0x8d, 0xc7, 0xc0, 0x86, 0x1e, 0x58, 0x6b, 0xa8, 0xb6, 0x0a, 0x29,
+ 0xd6, 0xa5, 0x75, 0x5c,
+ 0xd2, 0xcc, 0x50, 0x85, 0x99, 0xc6, 0xe2, 0x8d, 0x73, 0x55, 0xb2, 0x7e,
+ 0x40, 0xb7, 0x40, 0xc6,
+ 0xfb, 0xbb, 0xb1, 0xa9, 0x18, 0x23, 0xb1, 0xc1, 0x24, 0x2b, 0xa6, 0x93,
+ 0xd4, 0x52, 0x69, 0x51,
+ 0x47, 0xdb, 0xb2, 0x3e, 0xa8, 0x9c, 0xbf, 0x11, 0xeb, 0x8b, 0x07, 0xec,
+ 0x3a, 0x02, 0x7b, 0x0f,
+ 0x17
+};
+
+/*
+ * Test data from 186-2rsatestvectors.zip SigVet15_186-3.rsp with CRT
+ * parameters created with:
+ * http://sourceforge.net/projects/rsaconverter/
+ */
+
+/* SigGen15_186-2.txt line 9 mod 1024 */
+static const uint8_t ac_siggen15_186_2_modulus[] = {
+ 0xc8, 0xa2, 0x06, 0x91, 0x82, 0x39, 0x4a, 0x2a, 0xb7, 0xc3, 0xf4, 0x19,
+ 0x0c, 0x15, 0x58, 0x9c, 0x56, 0xa2, 0xd4, 0xbc, 0x42, 0xdc, 0xa6, 0x75,
+ 0xb3, 0x4c, 0xc9, 0x50, 0xe2, 0x46, 0x63, 0x04, 0x84, 0x41, 0xe8, 0xaa,
+ 0x59, 0x3b, 0x2b, 0xc5, 0x9e, 0x19, 0x8b, 0x8c, 0x25, 0x7e, 0x88, 0x21,
+ 0x20, 0xc6, 0x23, 0x36, 0xe5, 0xcc, 0x74, 0x50, 0x12, 0xc7, 0xff, 0xb0,
+ 0x63, 0xee, 0xbe, 0x53, 0xf3, 0xc6, 0x50, 0x4c, 0xba, 0x6c, 0xfe, 0x51,
+ 0xba, 0xa3, 0xb6, 0xd1, 0x07, 0x4b, 0x2f, 0x39, 0x81, 0x71, 0xf4, 0xb1,
+ 0x98, 0x2f, 0x4d, 0x65, 0xca, 0xf8, 0x82, 0xea, 0x4d, 0x56, 0xf3, 0x2a,
+ 0xb5, 0x7d, 0x0c, 0x44, 0xe6, 0xad, 0x4e, 0x9c, 0xf5, 0x7a, 0x43, 0x39,
+ 0xeb, 0x69, 0x62, 0x40, 0x6e, 0x35, 0x0c, 0x1b, 0x15, 0x39, 0x71, 0x83,
+ 0xfb, 0xf1, 0xf0, 0x35, 0x3c, 0x9f, 0xc9, 0x91
+};
+static const uint8_t ac_siggen15_186_2_pub_exp[] = {
+ 0x01, 0x00, 0x01
+};
+static const uint8_t ac_siggen15_186_2_priv_exp[] = {
+ 0x5d, 0xfc, 0xb1, 0x11, 0x07, 0x2d, 0x29, 0x56, 0x5b, 0xa1, 0xdb, 0x3e,
+ 0xc4, 0x8f, 0x57, 0x64, 0x5d, 0x9d, 0x88, 0x04, 0xed, 0x59, 0x8a, 0x4d,
+ 0x47, 0x02, 0x68, 0xa8, 0x90, 0x67, 0xa2, 0xc9, 0x21, 0xdf, 0xf2, 0x4b,
+ 0xa2, 0xe3, 0x7a, 0x3c, 0xe8, 0x34, 0x55, 0x50, 0x00, 0xdc, 0x86, 0x8e,
+ 0xe6, 0x58, 0x8b, 0x74, 0x93, 0x30, 0x35, 0x28, 0xb1, 0xb3, 0xa9, 0x4f,
+ 0x0b, 0x71, 0x73, 0x0c, 0xf1, 0xe8, 0x6f, 0xca, 0x5a, 0xee, 0xdc, 0x3a,
+ 0xfa, 0x16, 0xf6, 0x5c, 0x01, 0x89, 0xd8, 0x10, 0xdd, 0xcd, 0x81, 0x04,
+ 0x9e, 0xbb, 0xd0, 0x39, 0x18, 0x68, 0xc5, 0x0e, 0xde, 0xc9, 0x58, 0xb3,
+ 0xa2, 0xaa, 0xef, 0xf6, 0xa5, 0x75, 0x89, 0x7e, 0x2f, 0x20, 0xa3, 0xab,
+ 0x54, 0x55, 0xc1, 0xbf, 0xa5, 0x50, 0x10, 0xac, 0x51, 0xa7, 0x79, 0x9b,
+ 0x1f, 0xf8, 0x48, 0x36, 0x44, 0xa3, 0xd4, 0x25
+};
+static const uint8_t ac_siggen15_186_2_prime1[] = {
+ 0xF6, 0x6A, 0x24, 0x68, 0xB1, 0x48, 0x1A, 0x0D, 0x6B, 0x60, 0x49, 0x67,
+ 0xF0, 0x58, 0x03, 0x89, 0xD6, 0x06, 0x1F, 0x03, 0x3A, 0x9B, 0x57, 0xB7,
+ 0x4D, 0x1B, 0xEF, 0xE8, 0x10, 0x11, 0x98, 0x94, 0x5B, 0x80, 0x93, 0x04,
+ 0x24, 0x1D, 0x02, 0xFD, 0x5F, 0x92, 0x1F, 0xE9, 0x59, 0xFB, 0xEC, 0xDB,
+ 0x18, 0x00, 0x54, 0x86, 0x9A, 0xDB, 0x17, 0xD3, 0x21, 0xF9, 0xD5, 0xD5,
+ 0x98, 0x12, 0x3E, 0x73
+};
+static const uint8_t ac_siggen15_186_2_prime2[] = {
+ 0xD0, 0x6F, 0xFA, 0x56, 0x3B, 0xD0, 0xB8, 0xB9, 0x7F, 0x00, 0x72, 0xEA,
+ 0x07, 0x51, 0x03, 0xEC, 0x1F, 0xF0, 0xB1, 0x7F, 0xD6, 0xBD, 0xAF, 0x94,
+ 0xA7, 0x5A, 0xE6, 0x03, 0x59, 0x82, 0xF6, 0x80, 0x24, 0x9D, 0x77, 0xCC,
+ 0x15, 0x96, 0xA6, 0x54, 0xF1, 0x4C, 0x51, 0x7A, 0x13, 0xB9, 0x5F, 0x1A,
+ 0x8C, 0x5D, 0xE8, 0xCC, 0x84, 0xAD, 0x38, 0xD2, 0xE6, 0xAA, 0x4F, 0xCD,
+ 0x54, 0x1A, 0x32, 0xEB
+};
+static const uint8_t ac_siggen15_186_2_exp1[] = {
+ 0xD4, 0xD4, 0xB6, 0x9F, 0xCA, 0x47, 0x89, 0x60, 0xFF, 0xD6, 0x49, 0x70,
+ 0xC1, 0xD1, 0x73, 0x34, 0xF1, 0x2B, 0x96, 0x4B, 0xB6, 0xAA, 0x07, 0xA8,
+ 0x25, 0xAC, 0xB4, 0x98, 0xCE, 0x90, 0x34, 0x26, 0x27, 0xA6, 0x34, 0xD5,
+ 0x05, 0xD0, 0x1D, 0x0D, 0xF5, 0x27, 0x03, 0xF3, 0x0C, 0x2A, 0xA0, 0xD8,
+ 0x57, 0xB1, 0xA9, 0x50, 0x1D, 0x9E, 0x90, 0xC4, 0x66, 0x7B, 0x20, 0x6B,
+ 0x7D, 0x0E, 0x7C, 0xEB
+};
+static const uint8_t ac_siggen15_186_2_exp2[] = {
+ 0x28, 0x4F, 0xEF, 0xE7, 0xAB, 0xAB, 0xE3, 0x7E, 0x24, 0xBC, 0xEE, 0x7C,
+ 0xAA, 0xAB, 0x95, 0x89, 0x9E, 0x67, 0xCB, 0xBC, 0x80, 0xC8, 0xB0, 0xE3,
+ 0x9C, 0x36, 0x6D, 0x53, 0xEA, 0x84, 0xF4, 0xAD, 0xB5, 0xE7, 0x2A, 0x9B,
+ 0x32, 0xF5, 0xAE, 0xF7, 0xB0, 0xAF, 0x64, 0xF6, 0xAA, 0x47, 0xE8, 0xC7,
+ 0xD6, 0xAB, 0xF6, 0xF1, 0x4F, 0x1B, 0xBD, 0x68, 0xB4, 0xA9, 0xED, 0xC3,
+ 0x35, 0x67, 0xD7, 0xBF
+};
+static const uint8_t ac_siggen15_186_2_coeff[] = {
+ 0xE3, 0xBD, 0x88, 0x1C, 0x5A, 0x8F, 0x4A, 0xFC, 0xA0, 0x8C, 0xBC, 0x04,
+ 0x7C, 0xF0, 0xE3, 0x89, 0x7C, 0x85, 0x18, 0x9A, 0xF4, 0xF9, 0xA7, 0x00,
+ 0x93, 0x2C, 0xF4, 0x9E, 0x72, 0xF6, 0x44, 0x04, 0x39, 0x0D, 0xA5, 0x04,
+ 0x82, 0x79, 0xCE, 0x47, 0xF5, 0xAF, 0x58, 0x9B, 0x1B, 0xE9, 0xE4, 0x61,
+ 0xBB, 0xD8, 0xCC, 0x07, 0xAB, 0x8B, 0xC6, 0x8B, 0xAF, 0x6C, 0xC9, 0x13,
+ 0xB2, 0xE6, 0x26, 0x72
+};
+
+/* SigGen15_186-2.txt line 13 SHA-1*/
+#define ac_rsassa_vect8_modulus ac_siggen15_186_2_modulus
+#define ac_rsassa_vect8_pub_exp ac_siggen15_186_2_pub_exp
+#define ac_rsassa_vect8_priv_exp ac_siggen15_186_2_priv_exp
+#define ac_rsassa_vect8_prime1 ac_siggen15_186_2_prime1
+#define ac_rsassa_vect8_prime2 ac_siggen15_186_2_prime2
+#define ac_rsassa_vect8_exp1 ac_siggen15_186_2_exp1
+#define ac_rsassa_vect8_exp2 ac_siggen15_186_2_exp2
+#define ac_rsassa_vect8_coeff ac_siggen15_186_2_coeff
+static const uint8_t ac_rsassa_vect8_ptx[] = {
+ 0xe8, 0x31, 0x27, 0x42, 0xae, 0x23, 0xc4, 0x56, 0xef, 0x28, 0xa2, 0x31,
+ 0x42, 0xc4, 0x49, 0x08, 0x95, 0x83, 0x27, 0x65, 0xda, 0xdc, 0xe0, 0x2a,
+ 0xfe, 0x5b, 0xe5, 0xd3, 0x1b, 0x00, 0x48, 0xfb, 0xee, 0xe2, 0xcf, 0x21,
+ 0x8b, 0x17, 0x47, 0xad, 0x4f, 0xd8, 0x1a, 0x2e, 0x17, 0xe1, 0x24, 0xe6,
+ 0xaf, 0x17, 0xc3, 0x88, 0x8e, 0x6d, 0x2d, 0x40, 0xc0, 0x08, 0x07, 0xf4,
+ 0x23, 0xa2, 0x33, 0xca, 0xd6, 0x2c, 0xe9, 0xea, 0xef, 0xb7, 0x09, 0x85,
+ 0x6c, 0x94, 0xaf, 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,
+ 0xd8, 0xd0, 0x49, 0xef, 0xb3, 0x6b, 0xb3, 0x5f
+};
+
+/* SigGen15_186-2.txt line 54 SHA-224*/
+#define ac_rsassa_vect16_modulus ac_siggen15_186_2_modulus
+#define ac_rsassa_vect16_pub_exp ac_siggen15_186_2_pub_exp
+#define ac_rsassa_vect16_priv_exp ac_siggen15_186_2_priv_exp
+#define ac_rsassa_vect16_prime1 ac_siggen15_186_2_prime1
+#define ac_rsassa_vect16_prime2 ac_siggen15_186_2_prime2
+#define ac_rsassa_vect16_exp1 ac_siggen15_186_2_exp1
+#define ac_rsassa_vect16_exp2 ac_siggen15_186_2_exp2
+#define ac_rsassa_vect16_coeff ac_siggen15_186_2_coeff
+static const uint8_t ac_rsassa_vect16_ptx[] = {
+ 0xe5, 0x67, 0xa3, 0x9a, 0xe4, 0xe5, 0xef, 0x9b, 0x68, 0x01, 0xea, 0x05,
+ 0x61, 0xb7, 0x2a, 0x5d, 0x4b, 0x5f, 0x38, 0x5f, 0x05, 0x32, 0xfc, 0x9f,
+ 0xe1, 0x0a, 0x75, 0x70, 0xf8, 0x69, 0xae, 0x05, 0xc0, 0xbd, 0xed, 0xd6,
+ 0xe0, 0xe2, 0x2d, 0x45, 0x42, 0xe9, 0xce, 0x82, 0x6a, 0x18, 0x8c, 0xac,
+ 0x07, 0x31, 0xae, 0x39, 0xc8, 0xf8, 0x7f, 0x97, 0x71, 0xef, 0x02, 0x13,
+ 0x2e, 0x64, 0xe2, 0xfb, 0x27, 0xad, 0xa8, 0xff, 0x54, 0xb3, 0x30, 0xdd,
+ 0x93, 0xad, 0x5e, 0x3e, 0xf8, 0x2e, 0x0d, 0xda, 0x64, 0x62, 0x48, 0xe3,
+ 0x59, 0x94, 0xbd, 0xa1, 0x0c, 0xf4, 0x6e, 0x5a, 0xbc, 0x98, 0xaa, 0x74,
+ 0x43, 0xc0, 0x3c, 0xdd, 0xeb, 0x5e, 0xe2, 0xab, 0x82, 0xd6, 0x01, 0x00,
+ 0xb1, 0x02, 0x96, 0x31, 0x89, 0x79, 0x70, 0x27, 0x5f, 0x11, 0x9d, 0x05,
+ 0xda, 0xa2, 0x22, 0x0a, 0x4a, 0x0d, 0xef, 0xba
+};
+static const uint8_t ac_rsassa_vect16_out[] = {
+ 0x5a, 0xa5, 0x03, 0x33, 0x81, 0xbd, 0xd0, 0xac, 0xce, 0x33, 0x2d, 0xd3,
+ 0x14, 0xda, 0xf0, 0x08, 0xac, 0xaa, 0x9e, 0x83, 0x5f, 0x83, 0x29, 0x79,
+ 0x89, 0x1d, 0x1b, 0xda, 0x2b, 0x55, 0xd5, 0xea, 0xe3, 0x5c, 0x47, 0x9c,
+ 0x06, 0xca, 0xc5, 0xbf, 0x33, 0xf4, 0x32, 0xc8, 0xc0, 0xa5, 0x54, 0x9d,
+ 0x1d, 0x1b, 0x29, 0xc5, 0xe2, 0x58, 0x90, 0x24, 0xd2, 0x78, 0x00, 0xa0,
+ 0xc2, 0x35, 0xa6, 0x15, 0x32, 0xc2, 0x03, 0xcb, 0xc4, 0x06, 0xac, 0x6e,
+ 0xcf, 0x63, 0xf5, 0x2a, 0xe7, 0x71, 0xb9, 0x7c, 0x08, 0xe4, 0xb1, 0x08,
+ 0xec, 0x91, 0x69, 0x00, 0xe5, 0xa1, 0x1b, 0x1d, 0x48, 0xcc, 0xa8, 0x6c,
+ 0xa5, 0xa5, 0xa7, 0x99, 0xed, 0x32, 0xe9, 0x9c, 0x81, 0x5c, 0xef, 0x04,
+ 0xcf, 0x8e, 0xb5, 0x52, 0x23, 0xbf, 0xd4, 0xd9, 0xc3, 0x44, 0x92, 0x64,
+ 0xb6, 0x00, 0x61, 0xbc, 0x36, 0x84, 0xbc, 0x82
+};
+
+/* SigGen15_186-2.txt line 93 SHA-256 */
+#define ac_rsassa_vect9_modulus ac_siggen15_186_2_modulus
+#define ac_rsassa_vect9_pub_exp ac_siggen15_186_2_pub_exp
+#define ac_rsassa_vect9_priv_exp ac_siggen15_186_2_priv_exp
+#define ac_rsassa_vect9_prime1 ac_siggen15_186_2_prime1
+#define ac_rsassa_vect9_prime2 ac_siggen15_186_2_prime2
+#define ac_rsassa_vect9_exp1 ac_siggen15_186_2_exp1
+#define ac_rsassa_vect9_exp2 ac_siggen15_186_2_exp2
+#define ac_rsassa_vect9_coeff ac_siggen15_186_2_coeff
+static const uint8_t ac_rsassa_vect9_ptx[] = {
+ 0xe5, 0x67, 0xa3, 0x9a, 0xe4, 0xe5, 0xef, 0x9b, 0x68, 0x01, 0xea, 0x05,
+ 0x61, 0xb7, 0x2a, 0x5d, 0x4b, 0x5f, 0x38, 0x5f, 0x05, 0x32, 0xfc, 0x9f,
+ 0xe1, 0x0a, 0x75, 0x70, 0xf8, 0x69, 0xae, 0x05, 0xc0, 0xbd, 0xed, 0xd6,
+ 0xe0, 0xe2, 0x2d, 0x45, 0x42, 0xe9, 0xce, 0x82, 0x6a, 0x18, 0x8c, 0xac,
+ 0x07, 0x31, 0xae, 0x39, 0xc8, 0xf8, 0x7f, 0x97, 0x71, 0xef, 0x02, 0x13,
+ 0x2e, 0x64, 0xe2, 0xfb, 0x27, 0xad, 0xa8, 0xff, 0x54, 0xb3, 0x30, 0xdd,
+ 0x93, 0xad, 0x5e, 0x3e, 0xf8, 0x2e, 0x0d, 0xda, 0x64, 0x62, 0x48, 0xe3,
+ 0x59, 0x94, 0xbd, 0xa1, 0x0c, 0xf4, 0x6e, 0x5a, 0xbc, 0x98, 0xaa, 0x74,
+ 0x43, 0xc0, 0x3c, 0xdd, 0xeb, 0x5e, 0xe2, 0xab, 0x82, 0xd6, 0x01, 0x00,
+ 0xb1, 0x02, 0x96, 0x31, 0x89, 0x79, 0x70, 0x27, 0x5f, 0x11, 0x9d, 0x05,
+ 0xda, 0xa2, 0x22, 0x0a, 0x4a, 0x0d, 0xef, 0xba
+};
+static const uint8_t ac_rsassa_vect9_out[] = {
+ 0x0e, 0x7c, 0xdd, 0x12, 0x1e, 0x40, 0x32, 0x3c, 0xa6, 0x11, 0x5d, 0x1e,
+ 0xc6, 0xd1, 0xf9, 0x56, 0x17, 0x38, 0x45, 0x5f, 0x0e, 0x9e, 0x1c, 0xd8,
+ 0x58, 0xe8, 0xb5, 0x66, 0xae, 0x2d, 0xa5, 0xe8, 0xee, 0x63, 0xd8, 0xf1,
+ 0x5c, 0x3c, 0xdd, 0x88, 0x02, 0x7e, 0x13, 0x40, 0x6d, 0xb6, 0x09, 0x36,
+ 0x9c, 0x88, 0xca, 0x99, 0xb3, 0x4f, 0xa1, 0x56, 0xc7, 0xee, 0x62, 0xbc,
+ 0x5a, 0x39, 0x23, 0xbb, 0x5a, 0x1e, 0xda, 0xbd, 0x45, 0xc1, 0xa4, 0x22,
+ 0xaa, 0xfc, 0xbb, 0x47, 0xe0, 0x94, 0x7f, 0x35, 0xcf, 0xef, 0x87, 0x97,
+ 0x0b, 0x4b, 0x71, 0x31, 0x62, 0xb2, 0x19, 0x16, 0xca, 0xfb, 0x8c, 0x86,
+ 0x4a, 0x3e, 0x5b, 0x9f, 0xfc, 0x98, 0x94, 0x01, 0xd4, 0xea, 0xe9, 0x92,
+ 0x31, 0x2a, 0x32, 0xc5, 0xbc, 0x88, 0xab, 0xbb, 0x45, 0xf9, 0x9a, 0xc8,
+ 0x85, 0xb5, 0x4d, 0x6b, 0x8e, 0x61, 0xb6, 0xec
+};
+
+/* SigGen15_186-2.txt line 133 SHA-384*/
+#define ac_rsassa_vect10_modulus ac_siggen15_186_2_modulus
+#define ac_rsassa_vect10_pub_exp ac_siggen15_186_2_pub_exp
+#define ac_rsassa_vect10_priv_exp ac_siggen15_186_2_priv_exp
+#define ac_rsassa_vect10_prime1 ac_siggen15_186_2_prime1
+#define ac_rsassa_vect10_prime2 ac_siggen15_186_2_prime2
+#define ac_rsassa_vect10_exp1 ac_siggen15_186_2_exp1
+#define ac_rsassa_vect10_exp2 ac_siggen15_186_2_exp2
+#define ac_rsassa_vect10_coeff ac_siggen15_186_2_coeff
+static const uint8_t ac_rsassa_vect10_ptx[] = {
+ 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 0x43, 0x36,
+ 0x1e, 0x9e, 0xb6, 0xb1, 0xa3, 0x7c, 0x49, 0xa8, 0xf3, 0xc7, 0xc7, 0xae,
+ 0x7e, 0x78, 0x4d, 0x19, 0xa6, 0x21, 0x38, 0x74, 0x12, 0x93, 0xe4, 0x9b,
+ 0x18, 0x31, 0xc0, 0xc3, 0x61, 0x7e, 0xb4, 0x3c, 0x56, 0x70, 0x6d, 0x83,
+ 0x31, 0x49, 0x53, 0x47, 0x06, 0x36, 0x44, 0x10, 0x86, 0x41, 0x9a, 0xb9,
+ 0xe6, 0xfd, 0x1e, 0xc4, 0xf9, 0xd5, 0xcc, 0x65, 0x44, 0x81, 0x5d, 0x1e,
+ 0x02, 0xed, 0x96, 0xa3, 0xae, 0x64, 0xc6, 0x99, 0x8b, 0x2c, 0xf2, 0x38,
+ 0xe7, 0x9a, 0x12, 0x16, 0x43, 0x52, 0xd1, 0x2a
+};
+
+/* SigGen15_186-2.txt line 173 SHA-512*/
+#define ac_rsassa_vect11_modulus ac_siggen15_186_2_modulus
+#define ac_rsassa_vect11_pub_exp ac_siggen15_186_2_pub_exp
+#define ac_rsassa_vect11_priv_exp ac_siggen15_186_2_priv_exp
+#define ac_rsassa_vect11_prime1 ac_siggen15_186_2_prime1
+#define ac_rsassa_vect11_prime2 ac_siggen15_186_2_prime2
+#define ac_rsassa_vect11_exp1 ac_siggen15_186_2_exp1
+#define ac_rsassa_vect11_exp2 ac_siggen15_186_2_exp2
+#define ac_rsassa_vect11_coeff ac_siggen15_186_2_coeff
+static const uint8_t ac_rsassa_vect11_ptx[] = {
+ 0xe5, 0x67, 0xa3, 0x9a, 0xe4, 0xe5, 0xef, 0x9b, 0x68, 0x01, 0xea, 0x05,
+ 0x61, 0xb7, 0x2a, 0x5d, 0x4b, 0x5f, 0x38, 0x5f, 0x05, 0x32, 0xfc, 0x9f,
+ 0xe1, 0x0a, 0x75, 0x70, 0xf8, 0x69, 0xae, 0x05, 0xc0, 0xbd, 0xed, 0xd6,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 0x0e, 0x6d, 0x81,
+ 0x79, 0x07, 0x5b, 0x7d, 0xc7, 0x9e, 0xe7, 0x6b
+};
+static const uint8_t ac_siggenpss_186_2_pub_exp[] = {
+ 0x01, 0x00, 0x01
+};
+static const uint8_t ac_siggenpss_186_2_priv_exp[] = {
+ 0x38, 0x3a, 0x6f, 0x19, 0xe1, 0xea, 0x27, 0xfd, 0x08, 0xc7, 0xfb, 0xc3,
+ 0xbf, 0xa6, 0x84, 0xbd, 0x63, 0x29, 0x88, 0x8c, 0x0b, 0xbe, 0x4c, 0x98,
+ 0x62, 0x5e, 0x71, 0x81, 0xf4, 0x11, 0xcf, 0xd0, 0x85, 0x31, 0x44, 0xa3,
+ 0x03, 0x94, 0x04, 0xdd, 0xa4, 0x1b, 0xce, 0x2e, 0x31, 0xd5, 0x88, 0xec,
+ 0x57, 0xc0, 0xe1, 0x48, 0x14, 0x6f, 0x0f, 0xa6, 0x5b, 0x39, 0x00, 0x8b,
+ 0xa5, 0x83, 0x5f, 0x82, 0x9b, 0xa3, 0x5a, 0xe2, 0xf1, 0x55, 0xd6, 0x1b,
+ 0x8a, 0x12, 0x58, 0x1b, 0x99, 0xc9, 0x27, 0xfd, 0x2f, 0x22, 0x25, 0x2c,
+ 0x5e, 0x73, 0xcb, 0xa4, 0xa6, 0x10, 0xdb, 0x39, 0x73, 0xe0, 0x19, 0xee,
+ 0x0f, 0x95, 0x13, 0x0d, 0x43, 0x19, 0xed, 0x41, 0x34, 0x32, 0xf2, 0xe5,
+ 0xe2, 0x0d, 0x52, 0x15, 0xcd, 0xd2, 0x7c, 0x21, 0x64, 0x20, 0x6b, 0x3f,
+ 0x80, 0xed, 0xee, 0x51, 0x93, 0x8a, 0x25, 0xc1
+};
+static const uint8_t ac_siggenpss_186_2_prime1[] = {
+ 0xE5, 0x56, 0x3B, 0x14, 0x5D, 0xB6, 0xFF, 0x5A, 0x16, 0x28, 0x0D, 0x3E,
+ 0x80, 0xEF, 0xF0, 0x2F, 0x18, 0x1D, 0xBD, 0x03, 0x32, 0x4E, 0xF2, 0x47,
+ 0xF5, 0x96, 0xA4, 0xD4, 0xA7, 0xB8, 0xDA, 0xA3, 0x2B, 0x99, 0x34, 0xE3,
+ 0xC7, 0xF4, 0xDC, 0xF6, 0xA3, 0x10, 0x54, 0x62, 0xDE, 0xC6, 0x38, 0x39,
+ 0x63, 0x86, 0x18, 0x41, 0x8B, 0x51, 0xDB, 0x02, 0x69, 0x3F, 0xAB, 0xB4,
+ 0xE6, 0x83, 0x87, 0x25
+};
+static const uint8_t ac_siggenpss_186_2_prime2[] = {
+ 0xD2, 0xA4, 0xEC, 0x0F, 0xA2, 0x22, 0x6C, 0xDE, 0x82, 0xDA, 0x77, 0x65,
+ 0x3B, 0x07, 0x2C, 0xD0, 0x98, 0x53, 0x5D, 0x3E, 0x90, 0xED, 0x4D, 0x72,
+ 0x24, 0xDC, 0xB8, 0xCB, 0x8B, 0x93, 0x14, 0x76, 0x8D, 0xC5, 0x17, 0xE2,
+ 0x2D, 0x7C, 0x8F, 0xA1, 0x3F, 0x25, 0x3D, 0xAA, 0x74, 0x65, 0xA7, 0x99,
+ 0x56, 0x09, 0x8A, 0xA4, 0xCC, 0x3A, 0x6E, 0x35, 0xE8, 0xB1, 0xFC, 0xC4,
+ 0xF9, 0x7E, 0x77, 0x4F
+};
+static const uint8_t ac_siggenpss_186_2_exp1[] = {
+ 0x1F, 0x6A, 0xCA, 0xB9, 0x25, 0x85, 0x76, 0x41, 0xCF, 0x1B, 0x39, 0x85,
+ 0x40, 0x80, 0x9E, 0x34, 0xB5, 0x67, 0x0D, 0x87, 0xAC, 0x92, 0xA8, 0x1A,
+ 0x37, 0x88, 0xA5, 0x98, 0x04, 0x4A, 0x0C, 0x99, 0xA1, 0xD5, 0x61, 0x2B,
+ 0x7B, 0x2F, 0x0E, 0x3E, 0x33, 0x64, 0x7F, 0x4A, 0xF4, 0x1D, 0xCF, 0x81,
+ 0xFD, 0x22, 0x57, 0x9C, 0x53, 0x0B, 0xA9, 0xA7, 0x10, 0xE8, 0x0A, 0x0B,
+ 0xC4, 0x30, 0x6C, 0x89
+};
+static const uint8_t ac_siggenpss_186_2_exp2[] = {
+ 0x59, 0xF2, 0x84, 0xBE, 0xD4, 0x3C, 0x21, 0x03, 0x0F, 0x1B, 0x5C, 0xDA,
+ 0x84, 0x4F, 0x37, 0x0A, 0xC7, 0xD0, 0xE9, 0x43, 0x3B, 0x3D, 0xA9, 0xD1,
+ 0x70, 0xFE, 0x33, 0x86, 0xEF, 0x4D, 0xD9, 0xF2, 0x19, 0xED, 0xAC, 0x9A,
+ 0x2F, 0x54, 0x3E, 0x3C, 0xDB, 0xAA, 0xFA, 0x5F, 0x1C, 0x1F, 0x00, 0x67,
+ 0x50, 0xBE, 0xF8, 0x4E, 0x10, 0xCB, 0x6E, 0x9E, 0x64, 0x84, 0x04, 0x6C,
+ 0xD4, 0x20, 0xF5, 0xAF
+};
+static const uint8_t ac_siggenpss_186_2_coeff[] = {
+ 0x83, 0x5F, 0xC1, 0xB6, 0x52, 0x1C, 0x83, 0xE7, 0x6F, 0x80, 0x64, 0xFF,
+ 0xF8, 0x38, 0x80, 0xE1, 0xC9, 0x8F, 0x81, 0x13, 0x1E, 0xE8, 0x6E, 0x5D,
+ 0xF8, 0x57, 0x6A, 0xDA, 0x7D, 0x75, 0xC2, 0x6F, 0x8D, 0xB8, 0xBA, 0x8B,
+ 0x46, 0xF4, 0x6C, 0x69, 0xA5, 0x9D, 0xC5, 0xF2, 0x11, 0x8A, 0x9A, 0x90,
+ 0x8E, 0xC0, 0x8F, 0x45, 0xB0, 0x50, 0x4D, 0x2A, 0x42, 0x86, 0x49, 0x5E,
+ 0x2A, 0x1B, 0x78, 0x2E
+};
+/* Salt: 6f2841166a64471d4f0b8ed0dbb7db32161da13b */
+#define ac_siggenpss_186_2_salt_len 20
+
+
+/* SigGen15_186-2.txt line 173 SHA-1 */
+#define ac_rsassa_vect12_modulus ac_siggenpss_186_2_modulus
+#define ac_rsassa_vect12_pub_exp ac_siggenpss_186_2_pub_exp
+#define ac_rsassa_vect12_priv_exp ac_siggenpss_186_2_priv_exp
+#define ac_rsassa_vect12_prime1 ac_siggenpss_186_2_prime1
+#define ac_rsassa_vect12_prime2 ac_siggenpss_186_2_prime2
+#define ac_rsassa_vect12_exp1 ac_siggenpss_186_2_exp1
+#define ac_rsassa_vect12_exp2 ac_siggenpss_186_2_exp2
+#define ac_rsassa_vect12_coeff ac_siggenpss_186_2_coeff
+#define ac_rsassa_vect12_salt_len ac_siggenpss_186_2_salt_len
+static const uint8_t ac_rsassa_vect12_ptx[] = {
+ 0x12, 0x48, 0xf6, 0x2a, 0x43, 0x89, 0xf4, 0x2f, 0x7b, 0x4b, 0xb1, 0x31,
+ 0x05, 0x3d, 0x6c, 0x88, 0xa9, 0x94, 0xdb, 0x20, 0x75, 0xb9, 0x12, 0xcc,
+ 0xbe, 0x3e, 0xa7, 0xdc, 0x61, 0x17, 0x14, 0xf1, 0x4e, 0x07, 0x5c, 0x10,
+ 0x48, 0x58, 0xf2, 0xf6, 0xe6, 0xcf, 0xd6, 0xab, 0xde, 0xdf, 0x01, 0x5a,
+ 0x82, 0x1d, 0x03, 0x60, 0x8b, 0xf4, 0xeb, 0xa3, 0x16, 0x9a, 0x67, 0x25,
+ 0xec, 0x42, 0x2c, 0xd9, 0x06, 0x94, 0x98, 0xb5, 0x51, 0x5a, 0x96, 0x08,
+ 0xae, 0x7c, 0xc3, 0x0e, 0x3d, 0x2e, 0xcf, 0xc1, 0xdb, 0x68, 0x25, 0xf3,
+ 0xe9, 0x96, 0xce, 0x9a, 0x50, 0x92, 0x92, 0x6b, 0xc1, 0xcf, 0x61, 0xaa,
+ 0x42, 0xd7, 0xf2, 0x40, 0xe6, 0xf7, 0xaa, 0x0e, 0xdb, 0x38, 0xbf, 0x81,
+ 0xaa, 0x92, 0x9d, 0x66, 0xbb, 0x5d, 0x89, 0x00, 0x18, 0x08, 0x84, 0x58,
+ 0x72, 0x0d, 0x72, 0xd5, 0x69, 0x24, 0x7b, 0x0c
+};
+static const uint8_t ac_rsassa_vect12_out[] = {
+ 0x68, 0x2c, 0xf5, 0x3c, 0x11, 0x45, 0xd2, 0x2a, 0x50, 0xca, 0xa9, 0xeb,
+ 0x1a, 0x9b, 0xa7, 0x06, 0x70, 0xc5, 0x91, 0x5e, 0x0f, 0xdf, 0xde, 0x64,
+ 0x57, 0xa7, 0x65, 0xde, 0x2a, 0x8f, 0xe1, 0x2d, 0xe9, 0x79, 0x41, 0x72,
+ 0xa7, 0x8d, 0x14, 0xe6, 0x68, 0xd4, 0x98, 0xac, 0xed, 0xad, 0x61, 0x65,
+ 0x04, 0xbb, 0x17, 0x64, 0xd0, 0x94, 0x60, 0x70, 0x70, 0x08, 0x05, 0x92,
+ 0xc3, 0xa6, 0x9c, 0x34, 0x3d, 0x98, 0x2b, 0xd7, 0x78, 0x65, 0x87, 0x3d,
+ 0x35, 0xe2, 0x48, 0x22, 0xca, 0xf4, 0x34, 0x43, 0xcc, 0x10, 0x24, 0x9a,
+ 0xf6, 0xa1, 0xe2, 0x6e, 0xf3, 0x44, 0xf2, 0x8b, 0x9e, 0xf6, 0xf1, 0x4e,
+ 0x09, 0xad, 0x83, 0x97, 0x48, 0xe5, 0x14, 0x8b, 0xcc, 0xeb, 0x0f, 0xd2,
+ 0xaa, 0x63, 0x70, 0x9c, 0xb4, 0x89, 0x75, 0xcb, 0xf9, 0xc7, 0xb4, 0x9a,
+ 0xbc, 0x66, 0xa1, 0xdc, 0x6c, 0xb5, 0xb3, 0x1a
+};
+
+/* SigGenPSS_186-2.txt line 66 SHA-224 */
+#define ac_rsassa_vect17_modulus ac_siggenpss_186_2_modulus
+#define ac_rsassa_vect17_pub_exp ac_siggenpss_186_2_pub_exp
+#define ac_rsassa_vect17_priv_exp ac_siggenpss_186_2_priv_exp
+#define ac_rsassa_vect17_prime1 ac_siggenpss_186_2_prime1
+#define ac_rsassa_vect17_prime2 ac_siggenpss_186_2_prime2
+#define ac_rsassa_vect17_exp1 ac_siggenpss_186_2_exp1
+#define ac_rsassa_vect17_exp2 ac_siggenpss_186_2_exp2
+#define ac_rsassa_vect17_coeff ac_siggenpss_186_2_coeff
+#define ac_rsassa_vect17_salt_len ac_siggenpss_186_2_salt_len
+static const uint8_t ac_rsassa_vect17_ptx[] = {
+ 0x12, 0x48, 0xf6, 0x2a, 0x43, 0x89, 0xf4, 0x2f, 0x7b, 0x4b, 0xb1, 0x31,
+ 0x05, 0x3d, 0x6c, 0x88, 0xa9, 0x94, 0xdb, 0x20, 0x75, 0xb9, 0x12, 0xcc,
+ 0xbe, 0x3e, 0xa7, 0xdc, 0x61, 0x17, 0x14, 0xf1, 0x4e, 0x07, 0x5c, 0x10,
+ 0x48, 0x58, 0xf2, 0xf6, 0xe6, 0xcf, 0xd6, 0xab, 0xde, 0xdf, 0x01, 0x5a,
+ 0x82, 0x1d, 0x03, 0x60, 0x8b, 0xf4, 0xeb, 0xa3, 0x16, 0x9a, 0x67, 0x25,
+ 0xec, 0x42, 0x2c, 0xd9, 0x06, 0x94, 0x98, 0xb5, 0x51, 0x5a, 0x96, 0x08,
+ 0xae, 0x7c, 0xc3, 0x0e, 0x3d, 0x2e, 0xcf, 0xc1, 0xdb, 0x68, 0x25, 0xf3,
+ 0xe9, 0x96, 0xce, 0x9a, 0x50, 0x92, 0x92, 0x6b, 0xc1, 0xcf, 0x61, 0xaa,
+ 0x42, 0xd7, 0xf2, 0x40, 0xe6, 0xf7, 0xaa, 0x0e, 0xdb, 0x38, 0xbf, 0x81,
+ 0xaa, 0x92, 0x9d, 0x66, 0xbb, 0x5d, 0x89, 0x00, 0x18, 0x08, 0x84, 0x58,
+ 0x72, 0x0d, 0x72, 0xd5, 0x69, 0x24, 0x7b, 0x0c,
+};
+static const uint8_t ac_rsassa_vect17_out[] = {
+ 0x53, 0xd8, 0x59, 0xc9, 0xf1, 0x0a, 0xbf, 0x1c, 0x00, 0x28, 0x4a, 0x4b,
+ 0x55, 0xbf, 0x2b, 0xd8, 0x4d, 0x8e, 0x31, 0x3b, 0x4f, 0x3c, 0x35, 0xb8,
+ 0xde, 0xc7, 0xbc, 0x3a, 0xfe, 0x39, 0xb9, 0xb8, 0xa1, 0x55, 0x41, 0x8e,
+ 0xad, 0x19, 0x31, 0x89, 0x57, 0x69, 0xce, 0x23, 0x40, 0xbe, 0x20, 0x91,
+ 0xf2, 0x38, 0x5b, 0xbc, 0xf1, 0x0d, 0x9e, 0x92, 0xbc, 0xf5, 0xd0, 0xe2,
+ 0x96, 0x0d, 0x10, 0xe7, 0x92, 0xe7, 0xd8, 0x65, 0xc6, 0x4e, 0x50, 0xd1,
+ 0x9f, 0xfa, 0x13, 0xe5, 0x28, 0x17, 0xd7, 0xd8, 0xd8, 0xdb, 0x34, 0x39,
+ 0x2c, 0x23, 0x74, 0xa2, 0xe9, 0xb6, 0x91, 0x84, 0xf9, 0x2a, 0x4a, 0xd9,
+ 0xb1, 0xb8, 0xba, 0xe9, 0x9c, 0xa6, 0x14, 0xd2, 0x04, 0xb6, 0x5a, 0x43,
+ 0x8e, 0x38, 0xdb, 0xbf, 0xc8, 0xc7, 0xcc, 0x44, 0xed, 0x56, 0x77, 0xaf,
+ 0x70, 0xce, 0x6c, 0x4f, 0x95, 0x1f, 0x02, 0x44,
+};
+
+/* SigGen15_186-2.txt line 114 SHA-256 */
+#define ac_rsassa_vect13_modulus ac_siggenpss_186_2_modulus
+#define ac_rsassa_vect13_pub_exp ac_siggenpss_186_2_pub_exp
+#define ac_rsassa_vect13_priv_exp ac_siggenpss_186_2_priv_exp
+#define ac_rsassa_vect13_prime1 ac_siggenpss_186_2_prime1
+#define ac_rsassa_vect13_prime2 ac_siggenpss_186_2_prime2
+#define ac_rsassa_vect13_exp1 ac_siggenpss_186_2_exp1
+#define ac_rsassa_vect13_exp2 ac_siggenpss_186_2_exp2
+#define ac_rsassa_vect13_coeff ac_siggenpss_186_2_coeff
+#define ac_rsassa_vect13_salt_len ac_siggenpss_186_2_salt_len
+static const uint8_t ac_rsassa_vect13_ptx[] = {
+ 0x12, 0x48, 0xf6, 0x2a, 0x43, 0x89, 0xf4, 0x2f, 0x7b, 0x4b, 0xb1, 0x31,
+ 0x05, 0x3d, 0x6c, 0x88, 0xa9, 0x94, 0xdb, 0x20, 0x75, 0xb9, 0x12, 0xcc,
+ 0xbe, 0x3e, 0xa7, 0xdc, 0x61, 0x17, 0x14, 0xf1, 0x4e, 0x07, 0x5c, 0x10,
+ 0x48, 0x58, 0xf2, 0xf6, 0xe6, 0xcf, 0xd6, 0xab, 0xde, 0xdf, 0x01, 0x5a,
+ 0x82, 0x1d, 0x03, 0x60, 0x8b, 0xf4, 0xeb, 0xa3, 0x16, 0x9a, 0x67, 0x25,
+ 0xec, 0x42, 0x2c, 0xd9, 0x06, 0x94, 0x98, 0xb5, 0x51, 0x5a, 0x96, 0x08,
+ 0xae, 0x7c, 0xc3, 0x0e, 0x3d, 0x2e, 0xcf, 0xc1, 0xdb, 0x68, 0x25, 0xf3,
+ 0xe9, 0x96, 0xce, 0x9a, 0x50, 0x92, 0x92, 0x6b, 0xc1, 0xcf, 0x61, 0xaa,
+ 0x42, 0xd7, 0xf2, 0x40, 0xe6, 0xf7, 0xaa, 0x0e, 0xdb, 0x38, 0xbf, 0x81,
+ 0xaa, 0x92, 0x9d, 0x66, 0xbb, 0x5d, 0x89, 0x00, 0x18, 0x08, 0x84, 0x58,
+ 0x72, 0x0d, 0x72, 0xd5, 0x69, 0x24, 0x7b, 0x0c
+};
+static const uint8_t ac_rsassa_vect13_out[] = {
+ 0x7b, 0x1d, 0x37, 0x27, 0x8e, 0x54, 0x98, 0x98, 0xd4, 0x08, 0x4e, 0x22,
+ 0x10, 0xc4, 0xa9, 0x96, 0x1e, 0xdf, 0xe7, 0xb5, 0x96, 0x35, 0x50, 0xcc,
+ 0xa1, 0x90, 0x42, 0x48, 0xc8, 0x68, 0x15, 0x13, 0x53, 0x90, 0x17, 0x82,
+ 0x0f, 0x0e, 0x9b, 0xd0, 0x74, 0xb9, 0xf8, 0xa0, 0x67, 0xb9, 0xfe, 0xff,
+ 0xf7, 0xf1, 0xfa, 0x20, 0xbf, 0x2d, 0x0c, 0x75, 0x01, 0x5f, 0xf0, 0x20,
+ 0xb2, 0x21, 0x0c, 0xc7, 0xf7, 0x90, 0x34, 0xfe, 0xdf, 0x68, 0xe8, 0xd4,
+ 0x4a, 0x00, 0x7a, 0xbf, 0x4d, 0xd8, 0x2c, 0x26, 0xe8, 0xb0, 0x03, 0x93,
+ 0x72, 0x3a, 0xea, 0x15, 0xab, 0xfb, 0xc2, 0x29, 0x41, 0xc8, 0xcf, 0x79,
+ 0x48, 0x17, 0x18, 0xc0, 0x08, 0xda, 0x71, 0x3f, 0xb8, 0xf5, 0x4c, 0xb3,
+ 0xfc, 0xa8, 0x90, 0xbd, 0xe1, 0x13, 0x73, 0x14, 0x33, 0x4b, 0x9b, 0x0a,
+ 0x18, 0x51, 0x5b, 0xfa, 0x48, 0xe5, 0xcc, 0xd0
+};
+
+/* SigGen15_186-2.txt line 164 SHA-384 */
+#define ac_rsassa_vect14_modulus ac_siggenpss_186_2_modulus
+#define ac_rsassa_vect14_pub_exp ac_siggenpss_186_2_pub_exp
+#define ac_rsassa_vect14_priv_exp ac_siggenpss_186_2_priv_exp
+#define ac_rsassa_vect14_prime1 ac_siggenpss_186_2_prime1
+#define ac_rsassa_vect14_prime2 ac_siggenpss_186_2_prime2
+#define ac_rsassa_vect14_exp1 ac_siggenpss_186_2_exp1
+#define ac_rsassa_vect14_exp2 ac_siggenpss_186_2_exp2
+#define ac_rsassa_vect14_coeff ac_siggenpss_186_2_coeff
+#define ac_rsassa_vect14_salt_len ac_siggenpss_186_2_salt_len
+static const uint8_t ac_rsassa_vect14_ptx[] = {
+ 0x12, 0x48, 0xf6, 0x2a, 0x43, 0x89, 0xf4, 0x2f, 0x7b, 0x4b, 0xb1, 0x31,
+ 0x05, 0x3d, 0x6c, 0x88, 0xa9, 0x94, 0xdb, 0x20, 0x75, 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 0xc1, 0x5c, 0xa3, 0xaf, 0xe4, 0xa7, 0x8c,
+ 0x14, 0x4c, 0xb6, 0x88, 0x5c, 0x1c, 0xc8, 0x15, 0xf7, 0xf9, 0x89, 0x25,
+ 0xbc, 0x04, 0xad, 0x2f, 0xf2, 0x0f, 0xc1, 0x06, 0x8b, 0x04, 0x5d, 0x94,
+ 0x50, 0xe2, 0xa1, 0xdc, 0xf5, 0xa1, 0x61, 0xce, 0xab, 0xba, 0x2b, 0x0b,
+ 0x66, 0xc7, 0x35, 0x4f, 0xdb, 0x80, 0xfa, 0x1d, 0x72, 0x9e, 0x5f, 0x97,
+ 0x63, 0x87, 0xf2, 0x4a, 0x69, 0x7a, 0x7e, 0x56
+};
+
+/* SigGen15_186-2.txt line 214 SHA-512 */
+#define ac_rsassa_vect15_modulus ac_siggenpss_186_2_modulus
+#define ac_rsassa_vect15_pub_exp ac_siggenpss_186_2_pub_exp
+#define ac_rsassa_vect15_priv_exp ac_siggenpss_186_2_priv_exp
+#define ac_rsassa_vect15_prime1 ac_siggenpss_186_2_prime1
+#define ac_rsassa_vect15_prime2 ac_siggenpss_186_2_prime2
+#define ac_rsassa_vect15_exp1 ac_siggenpss_186_2_exp1
+#define ac_rsassa_vect15_exp2 ac_siggenpss_186_2_exp2
+#define ac_rsassa_vect15_coeff ac_siggenpss_186_2_coeff
+#define ac_rsassa_vect15_salt_len ac_siggenpss_186_2_salt_len
+static const uint8_t ac_rsassa_vect15_ptx[] = {
+ 0x12, 0x48, 0xf6, 0x2a, 0x43, 0x89, 0xf4, 0x2f, 0x7b, 0x4b, 0xb1, 0x31,
+ 0x05, 0x3d, 0x6c, 0x88, 0xa9, 0x94, 0xdb, 0x20, 0x75, 0xb9, 0x12, 0xcc,
+ 0xbe, 0x3e, 0xa7, 0xdc, 0x61, 0x17, 0x14, 0xf1, 0x4e, 0x07, 0x5c, 0x10,
+ 0x48, 0x58, 0xf2, 0xf6, 0xe6, 0xcf, 0xd6, 0xab, 0xde, 0xdf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, 0x82, 0xd3, 0x90, 0x7b, 0xe6, 0x02, 0x40,
+ 0xf5, 0x6b, 0x6a, 0x42, 0x59, 0xcc, 0x96, 0xdf, 0xd8, 0xfe, 0x02, 0xa0,
+ 0xbf, 0xa2, 0x6e, 0x02, 0x23, 0xf6, 0x82, 0x14, 0x42, 0x8f, 0xff, 0x0a,
+ 0xe4, 0x01, 0x62, 0x19, 0x8c, 0xc5, 0xcb, 0xd1
+};
+
+/*
+ * Test data from 186-3dsatestvectors.zip SigGen.txt
+ */
+
+/* SigGen.txt line 12 SHA-1 */
+static const uint8_t ac_dsa_vect1_prime[] = {
+ 0xa8, 0xf9, 0xcd, 0x20, 0x1e, 0x5e, 0x35, 0xd8, 0x92, 0xf8, 0x5f, 0x80,
+ 0xe4, 0xdb, 0x25, 0x99, 0xa5, 0x67, 0x6a, 0x3b, 0x1d, 0x4f, 0x19, 0x03,
+ 0x30, 0xed, 0x32, 0x56, 0xb2, 0x6d, 0x0e, 0x80, 0xa0, 0xe4, 0x9a, 0x8f,
+ 0xff, 0xaa, 0xad, 0x2a, 0x24, 0xf4, 0x72, 0xd2, 0x57, 0x32, 0x41, 0xd4,
+ 0xd6, 0xd6, 0xc7, 0x48, 0x0c, 0x80, 0xb4, 0xc6, 0x7b, 0xb4, 0x47, 0x9c,
+ 0x15, 0xad, 0xa7, 0xea, 0x84, 0x24, 0xd2, 0x50, 0x2f, 0xa0, 0x14, 0x72,
+ 0xe7, 0x60, 0x24, 0x17, 0x13, 0xda, 0xb0, 0x25, 0xae, 0x1b, 0x02, 0xe1,
+ 0x70, 0x3a, 0x14, 0x35, 0xf6, 0x2d, 0xdf, 0x4e, 0xe4, 0xc1, 0xb6, 0x64,
+ 0x06, 0x6e, 0xb2, 0x2f, 0x2e, 0x3b, 0xf2, 0x8b, 0xb7, 0x0a, 0x2a, 0x76,
+ 0xe4, 0xfd, 0x5e, 0xbe, 0x2d, 0x12, 0x29, 0x68, 0x1b, 0x5b, 0x06, 0x43,
+ 0x9a, 0xc9, 0xc7, 0xe9, 0xd8, 0xbd, 0xe2, 0x83
+};
+static const uint8_t ac_dsa_vect1_sub_prime[] = {
+ 0xf8, 0x5f, 0x0f, 0x83, 0xac, 0x4d, 0xf7, 0xea, 0x0c, 0xdf, 0x8f, 0x46,
+ 0x9b, 0xfe, 0xea, 0xea, 0x14, 0x15, 0x64, 0x95
+};
+static const uint8_t ac_dsa_vect1_base[] = {
+ 0x2b, 0x31, 0x52, 0xff, 0x6c, 0x62, 0xf1, 0x46, 0x22, 0xb8, 0xf4, 0x8e,
+ 0x59, 0xf8, 0xaf, 0x46, 0x88, 0x3b, 0x38, 0xe7, 0x9b, 0x8c, 0x74, 0xde,
+ 0xea, 0xe9, 0xdf, 0x13, 0x1f, 0x8b, 0x85, 0x6e, 0x3a, 0xd6, 0xc8, 0x45,
+ 0x5d, 0xab, 0x87, 0xcc, 0x0d, 0xa8, 0xac, 0x97, 0x34, 0x17, 0xce, 0x4f,
+ 0x78, 0x78, 0x55, 0x7d, 0x6c, 0xdf, 0x40, 0xb3, 0x5b, 0x4a, 0x0c, 0xa3,
+ 0xeb, 0x31, 0x0c, 0x6a, 0x95, 0xd6, 0x8c, 0xe2, 0x84, 0xad, 0x4e, 0x25,
+ 0xea, 0x28, 0x59, 0x16, 0x11, 0xee, 0x08, 0xb8, 0x44, 0x4b, 0xd6, 0x4b,
+ 0x25, 0xf3, 0xf7, 0xc5, 0x72, 0x41, 0x0d, 0xdf, 0xb3, 0x9c, 0xc7, 0x28,
+ 0xb9, 0xc9, 0x36, 0xf8, 0x5f, 0x41, 0x91, 0x29, 0x86, 0x99, 0x29, 0xcd,
+ 0xb9, 0x09, 0xa6, 0xa3, 0xa9, 0x9b, 0xbe, 0x08, 0x92, 0x16, 0x36, 0x81,
+ 0x71, 0xbd, 0x0b, 0xa8, 0x1d, 0xe4, 0xfe, 0x33
+};
+static const uint8_t ac_dsa_vect1_pub_val[] = {
+ 0x31, 0x3f, 0xd9, 0xeb, 0xca, 0x91, 0x57, 0x4e, 0x1c, 0x2e, 0xeb, 0xe1,
+ 0x51, 0x7c, 0x57, 0xe0, 0xc2, 0x1b, 0x02, 0x09, 0x87, 0x21, 0x40, 0xc5,
+ 0x32, 0x87, 0x61, 0xbb, 0xb2, 0x45, 0x0b, 0x33, 0xf1, 0xb1, 0x8b, 0x40,
+ 0x9c, 0xe9, 0xab, 0x7c, 0x4c, 0xd8, 0xfd, 0xa3, 0x39, 0x1e, 0x8e, 0x34,
+ 0x86, 0x83, 0x57, 0xc1, 0x99, 0xe1, 0x6a, 0x6b, 0x2e, 0xba, 0x06, 0xd6,
+ 0x74, 0x9d, 0xef, 0x79, 0x1d, 0x79, 0xe9, 0x5d, 0x3a, 0x4d, 0x09, 0xb2,
+ 0x4c, 0x39, 0x2a, 0xd8, 0x9d, 0xbf, 0x10, 0x09, 0x95, 0xae, 0x19, 0xc0,
+ 0x10, 0x62, 0x05, 0x6b, 0xb1, 0x4b, 0xce, 0x00, 0x5e, 0x87, 0x31, 0xef,
+ 0xde, 0x17, 0x5f, 0x95, 0xb9, 0x75, 0x08, 0x9b, 0xdc, 0xda, 0xea, 0x56,
+ 0x2b, 0x32, 0x78, 0x6d, 0x96, 0xf5, 0xa3, 0x1a, 0xed, 0xf7, 0x53, 0x64,
+ 0x00, 0x8a, 0xd4, 0xff, 0xfe, 0xbb, 0x97, 0x0b
+};
+static const uint8_t ac_dsa_vect1_priv_val[] = {
+ 0xc5, 0x3e, 0xae, 0x6d, 0x45, 0x32, 0x31, 0x64, 0xc7, 0xd0, 0x7a, 0xf5,
+ 0x71, 0x57, 0x03, 0x74, 0x4a, 0x63, 0xfc, 0x3a
+};
+/* K = 98cbcc4969d845e2461b5f66383dd503712bbcfa */
+static const uint8_t ac_dsa_vect1_ptx[] = {
+ 0x3b, 0x46, 0x73, 0x6d, 0x55, 0x9b, 0xd4, 0xe0, 0xc2, 0xc1, 0xb2, 0x55,
+ 0x3a, 0x33, 0xad, 0x3c, 0x6c, 0xf2, 0x3c, 0xac, 0x99, 0x8d, 0x3d, 0x0c,
+ 0x0e, 0x8f, 0xa4, 0xb1, 0x9b, 0xca, 0x06, 0xf2, 0xf3, 0x86, 0xdb, 0x2d,
+ 0xcf, 0xf9, 0xdc, 0xa4, 0xf4, 0x0a, 0xd8, 0xf5, 0x61, 0xff, 0xc3, 0x08,
+ 0xb4, 0x6c, 0x5f, 0x31, 0xa7, 0x73, 0x5b, 0x5f, 0xa7, 0xe0, 0xf9, 0xe6,
+ 0xcb, 0x51, 0x2e, 0x63, 0xd7, 0xee, 0xa0, 0x55, 0x38, 0xd6, 0x6a, 0x75,
+ 0xcd, 0x0d, 0x42, 0x34, 0xb5, 0xcc, 0xf6, 0xc1, 0x71, 0x5c, 0xca, 0xaf,
+ 0x9c, 0xdc, 0x0a, 0x22, 0x28, 0x13, 0x5f, 0x71, 0x6e, 0xe9, 0xbd, 0xee,
+ 0x7f, 0xc1, 0x3e, 0xc2, 0x7a, 0x03, 0xa6, 0xd1, 0x1c, 0x5c, 0x5b, 0x36,
+ 0x85, 0xf5, 0x19, 0x00, 0xb1, 0x33, 0x71, 0x53, 0xbc, 0x6c, 0x4e, 0x8f,
+ 0x52, 0x92, 0x0c, 0x33, 0xfa, 0x37, 0xf4, 0xe7
+};
+static const uint8_t ac_dsa_vect1_out[] = {
+/* R */
+ 0x50, 0xed, 0x0e, 0x81, 0x0e, 0x3f, 0x1c, 0x7c, 0xb6, 0xac, 0x62, 0x33,
+ 0x20, 0x58, 0x44, 0x8b, 0xd8, 0xb2, 0x84, 0xc0,
+/* S */
+ 0xc6, 0xad, 0xed, 0x17, 0x21, 0x6b, 0x46, 0xb7, 0xe4, 0xb6, 0xf2, 0xa9,
+ 0x7c, 0x1a, 0xd7, 0xcc, 0x3d, 0xa8, 0x3f, 0xde
+};
+
+/* SigGen.txt line 563 SHA-1 */
+#define ac_dsa_vect2_prime ac_dsa_vect1_prime
+#define ac_dsa_vect2_sub_prime ac_dsa_vect1_sub_prime
+#define ac_dsa_vect2_base ac_dsa_vect1_base
+static const uint8_t ac_dsa_vect2_pub_val[] = {
+ 0x29, 0xbd, 0xd7, 0x59, 0xaa, 0xa6, 0x2d, 0x4b, 0xf1, 0x6b, 0x48, 0x61,
+ 0xc8, 0x1c, 0xf4, 0x2e, 0xac, 0x2e, 0x16, 0x37, 0xb9, 0xec, 0xba, 0x51,
+ 0x2b, 0xdb, 0xc1, 0x3a, 0xc1, 0x2a, 0x80, 0xae, 0x8d, 0xe2, 0x52, 0x6b,
+ 0x89, 0x9a, 0xe5, 0xe4, 0xa2, 0x31, 0xae, 0xf8, 0x84, 0x19, 0x7c, 0x94,
+ 0x4c, 0x73, 0x26, 0x93, 0xa6, 0x34, 0xd7, 0x65, 0x9a, 0xbc, 0x69, 0x75,
+ 0xa7, 0x73, 0xf8, 0xd3, 0xcd, 0x5a, 0x36, 0x1f, 0xe2, 0x49, 0x23, 0x86,
+ 0xa3, 0xc0, 0x9a, 0xae, 0xf1, 0x2e, 0x4a, 0x7e, 0x73, 0xad, 0x7d, 0xfc,
+ 0x36, 0x37, 0xf7, 0xb0, 0x93, 0xf2, 0xc4, 0x0d, 0x62, 0x23, 0xa1, 0x95,
+ 0xc1, 0x36, 0xad, 0xf2, 0xea, 0x3f, 0xbf, 0x87, 0x04, 0xa6, 0x75, 0xaa,
+ 0x78, 0x17, 0xaa, 0x7e, 0xc7, 0xf9, 0xad, 0xfb, 0x28, 0x54, 0xd4, 0xe0,
+ 0x5c, 0x3c, 0xe7, 0xf7, 0x65, 0x60, 0x31, 0x3b
+};
+static const uint8_t ac_dsa_vect2_priv_val[] = {
+ 0xe6, 0x51, 0x31, 0xd7, 0x34, 0x70, 0xf6, 0xad, 0x2e, 0x58, 0x78, 0xbd,
+ 0xc9, 0xbe, 0xf5, 0x36, 0xfa, 0xf7, 0x88, 0x31
+};
+/* K = 87256a64e98cf5be1034ecfa766f9d25d1ac7ceb */
+static const uint8_t ac_dsa_vect2_ptx[] = {
+ 0xd2, 0xbc, 0xb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ftp.rsa.com/pub/rsalabs/tmp/pkcs1v15crypt-vectors.txt
+ *
+ * As specified in PKCS#1, the block type for this operation is 2.
+ * The seed value of each example provides the pseudo random bytes
+ * to be used for padding. This makes the result predictable.
+ */
+
+/* PKCS#1 v1.5 Signature Example 1 1024-bit RSA key pair */
+static const uint8_t ac_rsaes_pkcs1_v1_5_example1_modulus[] = {
+ 0xa8, 0xb3, 0xb2, 0x84, 0xaf, 0x8e, 0xb5, 0x0b, 0x38, 0x70, 0x34, 0xa8,
+ 0x60, 0xf1, 0x46, 0xc4, 0x91, 0x9f, 0x31, 0x87, 0x63, 0xcd, 0x6c, 0x55,
+ 0x98, 0xc8, 0xae, 0x48, 0x11, 0xa1, 0xe0, 0xab, 0xc4, 0xc7, 0xe0, 0xb0,
+ 0x82, 0xd6, 0x93, 0xa5, 0xe7, 0xfc, 0xed, 0x67, 0x5c, 0xf4, 0x66, 0x85,
+ 0x12, 0x77, 0x2c, 0x0c, 0xbc, 0x64, 0xa7, 0x42, 0xc6, 0xc6, 0x30, 0xf5,
+ 0x33, 0xc8, 0xcc, 0x72, 0xf6, 0x2a, 0xe8, 0x33, 0xc4, 0x0b, 0xf2, 0x58,
+ 0x42, 0xe9, 0x84, 0xbb, 0x78, 0xbd, 0xbf, 0x97, 0xc0, 0x10, 0x7d, 0x55,
+ 0xbd, 0xb6, 0x62, 0xf5, 0xc4, 0xe0, 0xfa, 0xb9, 0x84, 0x5c, 0xb5, 0x14,
+ 0x8e, 0xf7, 0x39, 0x2d, 0xd3, 0xaa, 0xff, 0x93, 0xae, 0x1e, 0x6b, 0x66,
+ 0x7b, 0xb3, 0xd4, 0x24, 0x76, 0x16, 0xd4, 0xf5, 0xba, 0x10, 0xd4, 0xcf,
+ 0xd2, 0x26, 0xde, 0x88, 0xd3, 0x9f, 0x16, 0xfb
+};
+static const uint8_t ac_rsaes_pkcs1_v1_5_example1_pub_exp[] = {
+ 0x01, 0x00, 0x01
+};
+static const uint8_t ac_rsaes_pkcs1_v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x59, 0x8d, 0x41, 0x3a, 0x17, 0x2e, 0xfb, 0x80, 0x2c, 0x21, 0xac, 0xf1,
+ 0xc1, 0x1c, 0x52, 0x0c, 0x2f, 0x26, 0xa4, 0x71, 0xdc, 0xad, 0x21, 0x2e,
+ 0xac, 0x7c, 0xa3, 0x9d
+};
+static const uint8_t ac_rsaes_pkcs1_v1_5_example1_prime2[] = {
+ 0xcc, 0x88, 0x53, 0xd1, 0xd5, 0x4d, 0xa6, 0x30, 0xfa, 0xc0, 0x04, 0xf4,
+ 0x71, 0xf2, 0x81, 0xc7, 0xb8, 0x98, 0x2d, 0x82, 0x24, 0xa4, 0x90, 0xed,
+ 0xbe, 0xb3, 0x3d, 0x3e, 0x3d, 0x5c, 0xc9, 0x3c, 0x47, 0x65, 0x70, 0x3d,
+ 0x1d, 0xd7, 0x91, 0x64, 0x2f, 0x1f, 0x11, 0x6a, 0x0d, 0xd8, 0x52, 0xbe,
+ 0x24, 0x19, 0xb2, 0xaf, 0x72, 0xbf, 0xe9, 0xa0, 0x30, 0xe8, 0x60, 0xb0,
+ 0x28, 0x8b, 0x5d, 0x77
+};
+static const uint8_t ac_rsaes_pkcs1_v1_5_example1_exp1[] = {
+ 0x0e, 0x12, 0xbf, 0x17, 0x18, 0xe9, 0xce, 0xf5, 0x59, 0x9b, 0xa1, 0xc3,
+ 0x88, 0x2f, 0xe8, 0x04, 0x6a, 0x90, 0x87, 0x4e, 0xef, 0xce, 0x8f, 0x2c,
+ 0xcc, 0x20, 0xe4, 0xf2, 0x74, 0x1f, 0xb0, 0xa3, 0x3a, 0x38, 0x48, 0xae,
+ 0xc9, 0xc9, 0x30, 0x5f, 0xbe, 0xcb, 0xd2, 0xd7, 0x68, 0x19, 0x96, 0x7d,
+ 0x46, 0x71, 0xac, 0xc6, 0x43, 0x1e, 0x40, 0x37, 0x96, 0x8d, 0xb3, 0x78,
+ 0x78, 0xe6, 0x95, 0xc1
+};
+static const uint8_t ac_rsaes_pkcs1_v1_5_example1_exp2[] = {
+ 0x95, 0x29, 0x7b, 0x0f, 0x95, 0xa2, 0xfa, 0x67, 0xd0, 0x07, 0x07, 0xd6,
+ 0x09, 0xdf, 0xd4, 0xfc, 0x05, 0xc8, 0x9d, 0xaf, 0xc2, 0xef, 0x6d, 0x6e,
+ 0xa5, 0x5b, 0xec, 0x77, 0x1e, 0xa3, 0x33, 0x73, 0x4d, 0x92, 0x51, 0xe7,
+ 0x90, 0x82, 0xec, 0xda, 0x86, 0x6e, 0xfe, 0xf1, 0x3c, 0x45, 0x9e, 0x1a,
+ 0x63, 0x13, 0x86, 0xb7, 0xe3, 0x54, 0xc8, 0x99, 0xf5, 0xf1, 0x12, 0xca,
+ 0x85, 0xd7, 0x15, 0x83
+};
+static const uint8_t ac_rsaes_pkcs1_v1_5_example1_coeff[] = {
+ 0x4f, 0x45, 0x6c, 0x50, 0x24, 0x93, 0xbd, 0xc0, 0xed, 0x2a, 0xb7, 0x56,
+ 0xa3, 0xa6, 0xed, 0x4d, 0x67, 0x35, 0x2a, 0x69, 0x7d, 0x42, 0x16, 0xe9,
+ 0x32, 0x12, 0xb1, 0x27, 0xa6, 0x3d, 0x54, 0x11, 0xce, 0x6f, 0xa9, 0x8d,
+ 0x5d, 0xbe, 0xfd, 0x73, 0x26, 0x3e, 0x37, 0x28, 0x14, 0x27, 0x43, 0x81,
+ 0x81, 0x66, 0xed, 0x7d, 0xd6, 0x36, 0x87, 0xdd, 0x2a, 0x8c, 0xa1, 0xd2,
+ 0xf4, 0xfb, 0xd8, 0xe1
+};
+
+
+/* PKCS#1 v1.5 Encrypt Example 1.1 */
+#define ac_rsaes_pkcs1_v1_5_vect1_modulus ac_rsaes_pkcs1_v1_5_example1_modulus
+#define ac_rsaes_pkcs1_v1_5_vect1_pub_exp ac_rsaes_pkcs1_v1_5_example1_pub_exp
+#define ac_rsaes_pkcs1_v1_5_vect1_priv_exp ac_rsaes_pkcs1_v1_5_example1_priv_exp
+#define ac_rsaes_pkcs1_v1_5_vect1_prime1 ac_rsaes_pkcs1_v1_5_example1_prime1
+#define ac_rsaes_pkcs1_v1_5_vect1_prime2 ac_rsaes_pkcs1_v1_5_example1_prime2
+#define ac_rsaes_pkcs1_v1_5_vect1_exp1 ac_rsaes_pkcs1_v1_5_example1_exp1
+#define ac_rsaes_pkcs1_v1_5_vect1_exp2 ac_rsaes_pkcs1_v1_5_example1_exp2
+#define ac_rsaes_pkcs1_v1_5_vect1_coeff ac_rsaes_pkcs1_v1_5_example1_coeff
+static const uint8_t ac_rsaes_pkcs1_v1_5_vect1_ptx[] = {
+ 0x66, 0x28, 0x19, 0x4e, 0x12, 0x07, 0x3d, 0xb0, 0x3b, 0xa9, 0x4c, 0xda,
+ 0x9e, 0xf9, 0x53, 0x23,
+ 0x97, 0xd5, 0x0d, 0xba, 0x79, 0xb9, 0x87, 0x00, 0x4a, 0xfe, 0xfe, 0x34,
+};
+static const uint8_t ac_rsaes_pkcs1_v1_5_vect1_out[] = {
+ 0x50, 0xb4, 0xc1, 0x41, 0x36, 0xbd, 0x19, 0x8c, 0x2f, 0x3c, 0x3e, 0xd2,
+ 0x43, 0xfc, 0xe0, 0x36,
+ 0xe1, 0x68, 0xd5, 0x65, 0x17, 0x98, 0x4a, 0x26, 0x3c, 0xd6, 0x64, 0x92,
+ 0xb8, 0x08, 0x04, 0xf1,
+ 0x69, 0xd2, 0x10, 0xf2, 0xb9, 0xbd, 0xfb, 0x48, 0xb1, 0x2f, 0x9e, 0xa0,
+ 0x50, 0x09, 0xc7, 0x7d,
+ 0xa2, 0x57, 0xcc, 0x60, 0x0c, 0xce, 0xfe, 0x3a, 0x62, 0x83, 0x78, 0x9d,
+ 0x8e, 0xa0, 0xe6, 0x07,
+ 0xac, 0x58, 0xe2, 0x69, 0x0e, 0xc4, 0xeb, 0xc1, 0x01, 0x46, 0xe8, 0xcb,
+ 0xaa, 0x5e, 0xd4, 0xd5,
+ 0xcc, 0xe6, 0xfe, 0x7b, 0x0f, 0xf9, 0xef, 0xc1, 0xea, 0xbb, 0x56, 0x4d,
+ 0xbf, 0x49, 0x82, 0x85,
+ 0xf4, 0x49, 0xee, 0x61, 0xdd, 0x7b, 0x42, 0xee, 0x5b, 0x58, 0x92, 0xcb,
+ 0x90, 0x60, 0x1f, 0x30,
+ 0xcd, 0xa0, 0x7b, 0xf2, 0x64, 0x89, 0x31, 0x0b, 0xcd, 0x23, 0xb5, 0x28,
+ 0xce, 0xab, 0x3c, 0x31,
+};
+
+
+/* PKCS#1 v1.5 Encrypt Example 1.2 */
+#define ac_rsaes_pkcs1_v1_5_vect2_modulus ac_rsaes_pkcs1_v1_5_example1_modulus
+#define ac_rsaes_pkcs1_v1_5_vect2_pub_exp ac_rsaes_pkcs1_v1_5_example1_pub_exp
+#define ac_rsaes_pkcs1_v1_5_vect2_priv_exp ac_rsaes_pkcs1_v1_5_example1_priv_exp
+#define ac_rsaes_pkcs1_v1_5_vect2_prime1 ac_rsaes_pkcs1_v1_5_example1_prime1
+#define ac_rsaes_pkcs1_v1_5_vect2_prime2 ac_rsaes_pkcs1_v1_5_example1_prime2
+#define ac_rsaes_pkcs1_v1_5_vect2_exp1 ac_rsaes_pkcs1_v1_5_example1_exp1
+#define ac_rsaes_pkcs1_v1_5_vect2_exp2 ac_rsaes_pkcs1_v1_5_example1_exp2
+#define ac_rsaes_pkcs1_v1_5_vect2_coeff ac_rsaes_pkcs1_v1_5_example1_coeff
+static const uint8_t ac_rsaes_pkcs1_v1_5_vect2_ptx[] = {
+ 0x75, 0x0c, 0x40, 0x47, 0xf5, 0x47, 0xe8, 0xe4, 0x14, 0x11, 0x85, 0x65,
+ 0x23, 0x29, 0x8a, 0xc9, 0xba, 0xe2, 0x45, 0xef, 0xaf, 0x13, 0x97, 0xfb,
+ 0xe5, 0x6f, 0x9d, 0xd5
+};
+static const uint8_t ac_rsaes_pkcs1_v1_5_vect2_out[] = {
+ 0x68, 0x42, 0xe5, 0xe2, 0xcc, 0x00, 0x41, 0xd6, 0xb0, 0xc8, 0x1a, 0x56,
+ 0x2c, 0x39, 0xa6, 0x17, 0x37, 0x9a, 0x51, 0x5c, 0xab, 0x74, 0xab, 0xcb,
+ 0x26, 0x19, 0xc7, 0x74, 0x0a, 0x54, 0x1d, 0x95, 0x55, 0xdd, 0x91, 0x65,
+ 0x97, 0x5b, 0xf8, 0xa3, 0xeb, 0xd0, 0xd0, 0x45, 0x66, 0x61, 0xdf, 0xb1,
+ 0xa6, 0x86, 0x1b, 0xa2, 0x33, 0x22, 0x69, 0x93, 0x0e, 0x0d, 0xb5, 0x14,
+ 0xfc, 0xa0, 0x73, 0x3e, 0xeb, 0x9c, 0x40, 0x57, 0x13, 0xeb, 0x1f, 0x9d,
+ 0x76, 0x80, 0x33, 0xed, 0x29, 0x3e, 0x1e, 0x08, 0x1a, 0x12, 0x5f, 0x32,
+ 0xdd, 0xb9, 0xea, 0x52, 0xed, 0xbe, 0x27, 0x5c, 0x4a, 0xf6, 0x0f, 0x8a,
+ 0x7b, 0xf8, 0x32, 0xbd, 0x22, 0x75, 0x61, 0xc2, 0x08, 0xdc, 0x00, 0x31,
+ 0xa8, 0x4b, 0x50, 0x12, 0xc9, 0xdd, 0x9f, 0x74, 0x45, 0x9d, 0xcb, 0x07,
+ 0x0b, 0xdb, 0xe1, 0x3c, 0xfa, 0x8c, 0x2d, 0x50
+};
+
+/*
+ * Test data from ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip
+ *
+ * The underlying hash function is SHA-1; the mask generation function is
+ * MGF1 with SHA-1 as specified in PKCS #1 v2.1.
+ */
+
+/* Example 1: A 1024-bit RSA Key Pair */
+#define ac_rsaes_oaep_example1_modulus ac_rsaes_pkcs1_v1_5_example1_modulus
+#define ac_rsaes_oaep_example1_pub_exp ac_rsaes_pkcs1_v1_5_example1_pub_exp
+#define ac_rsaes_oaep_example1_priv_exp ac_rsaes_pkcs1_v1_5_example1_priv_exp
+#define ac_rsaes_oaep_example1_prime1 ac_rsaes_pkcs1_v1_5_example1_prime1
+#define ac_rsaes_oaep_example1_prime2 ac_rsaes_pkcs1_v1_5_example1_prime2
+#define ac_rsaes_oaep_example1_exp1 ac_rsaes_pkcs1_v1_5_example1_exp1
+#define ac_rsaes_oaep_example1_exp2 ac_rsaes_pkcs1_v1_5_example1_exp2
+#define ac_rsaes_oaep_example1_coeff ac_rsaes_pkcs1_v1_5_example1_coeff
+
+
+/* RSAES-OAEP Encryption Example 1.1 */
+#define ac_rsaes_oaep_vect1_modulus ac_rsaes_oaep_example1_modulus
+#define ac_rsaes_oaep_vect1_pub_exp ac_rsaes_oaep_example1_pub_exp
+#define ac_rsaes_oaep_vect1_priv_exp ac_rsaes_oaep_example1_priv_exp
+#define ac_rsaes_oaep_vect1_prime1 ac_rsaes_oaep_example1_prime1
+#define ac_rsaes_oaep_vect1_prime2 ac_rsaes_oaep_example1_prime2
+#define ac_rsaes_oaep_vect1_exp1 ac_rsaes_oaep_example1_exp1
+#define ac_rsaes_oaep_vect1_exp2 ac_rsaes_oaep_example1_exp2
+#define ac_rsaes_oaep_vect1_coeff ac_rsaes_oaep_example1_coeff
+static const uint8_t ac_rsaes_oaep_vect1_ptx[] = {
+ 0x66, 0x28, 0x19, 0x4e, 0x12, 0x07, 0x3d, 0xb0, 0x3b, 0xa9, 0x4c, 0xda,
+ 0x9e, 0xf9, 0x53, 0x23, 0x97, 0xd5, 0x0d, 0xba, 0x79, 0xb9, 0x87, 0x00,
+ 0x4a, 0xfe, 0xfe, 0x34,
+};
+static const uint8_t ac_rsaes_oaep_vect1_out[] = {
+ 0x35, 0x4f, 0xe6, 0x7b, 0x4a, 0x12, 0x6d, 0x5d, 0x35, 0xfe, 0x36, 0xc7,
+ 0x77, 0x79, 0x1a, 0x3f, 0x7b, 0xa1, 0x3d, 0xef, 0x48, 0x4e, 0x2d, 0x39,
+ 0x08, 0xaf, 0xf7, 0x22, 0xfa, 0xd4, 0x68, 0xfb, 0x21, 0x69, 0x6d, 0xe9,
+ 0x5d, 0x0b, 0xe9, 0x11, 0xc2, 0xd3, 0x17, 0x4f, 0x8a, 0xfc, 0xc2, 0x01,
+ 0x03, 0x5f, 0x7b, 0x6d, 0x8e, 0x69, 0x40, 0x2d, 0xe5, 0x45, 0x16, 0x18,
+ 0xc2, 0x1a, 0x53, 0x5f, 0xa9, 0xd7, 0xbf, 0xc5, 0xb8, 0xdd, 0x9f, 0xc2,
+ 0x43, 0xf8, 0xcf, 0x92, 0x7d, 0xb3, 0x13, 0x22, 0xd6, 0xe8, 0x81, 0xea,
+ 0xa9, 0x1a, 0x99, 0x61, 0x70, 0xe6, 0x57, 0xa0, 0x5a, 0x26, 0x64, 0x26,
+ 0xd9, 0x8c, 0x88, 0x00, 0x3f, 0x84, 0x77, 0xc1, 0x22, 0x70, 0x94, 0xa0,
+ 0xd9, 0xfa, 0x1e, 0x8c, 0x40, 0x24, 0x30, 0x9c, 0xe1, 0xec, 0xcc, 0xb5,
+ 0x21, 0x00, 0x35, 0xd4, 0x7a, 0xc7, 0x2e, 0x8a
+};
+
+/* RSAES-OAEP Encryption Example 1.2 */
+#define ac_rsaes_oaep_vect2_modulus ac_rsaes_oaep_example1_modulus
+#define ac_rsaes_oaep_vect2_pub_exp ac_rsaes_oaep_example1_pub_exp
+#define ac_rsaes_oaep_vect2_priv_exp ac_rsaes_oaep_example1_priv_exp
+#define ac_rsaes_oaep_vect2_prime1 ac_rsaes_oaep_example1_prime1
+#define ac_rsaes_oaep_vect2_prime2 ac_rsaes_oaep_example1_prime2
+#define ac_rsaes_oaep_vect2_exp1 ac_rsaes_oaep_example1_exp1
+#define ac_rsaes_oaep_vect2_exp2 ac_rsaes_oaep_example1_exp2
+#define ac_rsaes_oaep_vect2_coeff ac_rsaes_oaep_example1_coeff
+static const uint8_t ac_rsaes_oaep_vect2_ptx[] = {
+ 0x75, 0x0c, 0x40, 0x47, 0xf5, 0x47, 0xe8, 0xe4, 0x14, 0x11, 0x85, 0x65,
+ 0x23, 0x29, 0x8a, 0xc9, 0xba, 0xe2, 0x45, 0xef, 0xaf, 0x13, 0x97, 0xfb,
+ 0xe5, 0x6f, 0x9d, 0xd5
+};
+static const uint8_t ac_rsaes_oaep_vect2_out[] = {
+ 0x64, 0x0d, 0xb1, 0xac, 0xc5, 0x8e, 0x05, 0x68, 0xfe, 0x54, 0x07, 0xe5,
+ 0xf9, 0xb7, 0x01, 0xdf, 0xf8, 0xc3, 0xc9, 0x1e, 0x71, 0x6c, 0x53, 0x6f,
+ 0xc7, 0xfc, 0xec, 0x6c, 0xb5, 0xb7, 0x1c, 0x11, 0x65, 0x98, 0x8d, 0x4a,
+ 0x27, 0x9e, 0x15, 0x77, 0xd7, 0x30, 0xfc, 0x7a, 0x29, 0x93, 0x2e, 0x3f,
+ 0x00, 0xc8, 0x15, 0x15, 0x23, 0x6d, 0x8d, 0x8e, 0x31, 0x01, 0x7a, 0x7a,
+ 0x09, 0xdf, 0x43, 0x52, 0xd9, 0x04, 0xcd, 0xeb, 0x79, 0xaa, 0x58, 0x3a,
+ 0xdc, 0xc3, 0x1e, 0xa6, 0x98, 0xa4, 0xc0, 0x52, 0x83, 0xda, 0xba, 0x90,
+ 0x89, 0xbe, 0x54, 0x91, 0xf6, 0x7c, 0x1a, 0x4e, 0xe4, 0x8d, 0xc7, 0x4b,
+ 0xbb, 0xe6, 0x64, 0x3a, 0xef, 0x84, 0x66, 0x79, 0xb4, 0xcb, 0x39, 0x5a,
+ 0x35, 0x2d, 0x5e, 0xd1, 0x15, 0x91, 0x2d, 0xf6, 0x96, 0xff, 0xe0, 0x70,
+ 0x29, 0x32, 0x94, 0x6d, 0x71, 0x49, 0x2b, 0x44
+};
+
+/*
+ * PKCS#1 v1.5 Signature Example 15 2048-bit RSA key pair
+ * from http://armcryptolib.das-labor.org/trac/browser/testvectors/rsa-pkcs-1v2-1-vec/oaep-vect.txt
+ */
+static const uint8_t ac_rsaes_pkcs1_v1_5_example15_modulus[] = {
+ 0xdc, 0xfa, 0x10, 0xff, 0xa7, 0x46, 0x65, 0xae, 0x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c8, 0xa5, 0x88, 0x36, 0x1d,
+ 0xc4, 0x12, 0x66, 0xa4, 0xb7, 0xed, 0x38, 0xb0, 0x26, 0xce, 0x0d, 0x53, 0x78, 0x64, 0x49, 0xdb,
+ 0xb1, 0x1a, 0x06, 0xea, 0x33, 0xcc, 0xf1, 0xec, 0xa5, 0x75, 0x20, 0x1e, 0xd1, 0xaa, 0x47, 0x3e,
+ 0xd1, 0x18, 0x7e, 0xc1, 0xd8, 0xa7, 0x44, 0xea, 0x34, 0x5b, 0xed, 0x7e, 0xa0, 0x0e, 0xe4, 0xe8,
+ 0x1b, 0xba, 0x46, 0x48, 0x60, 0x1d, 0xd5, 0x37, 0xdc, 0x91, 0x01, 0x5d, 0x31, 0xf0, 0xc2, 0xc1,
+};
+
+static const uint8_t ac_rsaes_pkcs1_v1_5_example15_pub_exp[] = {
+ 0x01, 0x00, 0x01,
+};
+
+static const uint8_t ac_rsaes_pkcs1_v1_5_example15_priv_exp[] = {
+ 0x21, 0x95, 0x08, 0x51, 0xcd, 0xf2, 0x53, 0x20, 0x31, 0x8b, 0x30, 0x5a, 0xfa, 0x0f, 0x37, 0x1f,
+ 0x07, 0xae, 0x5a, 0x44, 0xb3, 0x14, 0xeb, 0xd7, 0x29, 0xf5, 0xdc, 0xb1, 0x5d, 0xa7, 0xfa, 0x39,
+ 0x47, 0xac, 0xdd, 0x91, 0x5d, 0xae, 0xd5, 0x74, 0xbd, 0x16, 0xdf, 0x88, 0xbf, 0x85, 0xf6, 0x10,
+ 0x60, 0xb3, 0x87, 0x17, 0x2f, 0xae, 0x6e, 0x01, 0x26, 0x2b, 0x38, 0x64, 0xc2, 0xd3, 0xc2, 0x2f,
+ 0x94, 0xe0, 0x4a, 0x81, 0x59, 0x42, 0x2b, 0x4e, 0xd2, 0x79, 0xc4, 0x8a, 0x4c, 0x9d, 0x76, 0x7d,
+ 0x49, 0x66, 0x07, 0x1a, 0x5b, 0xbf, 0x5d, 0x04, 0x3e, 0x16, 0xff, 0x46,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0x7c, 0xc2, 0x76, 0x0a,
+ 0xc0, 0xf2, 0xad, 0x4a, 0x2f, 0xcd, 0x0e, 0x84, 0xd7, 0xa1, 0xd9, 0x4d, 0xfd, 0xd2, 0x65, 0x8f,
+ 0xd9, 0xce, 0x18, 0x47, 0x5c, 0x1f, 0xa7, 0x5e, 0xe0, 0xce, 0xba, 0xd0, 0xcf, 0x0a, 0xc0, 0x4d,
+};
+
+static const uint8_t ac_rsaes_pkcs1_v1_5_example15_exp2[] = {
+ 0x52, 0x81, 0x71, 0x23, 0x3c, 0x4e, 0x4a, 0x6c, 0x63, 0xb8, 0x67, 0x64, 0xf5, 0x13, 0x38, 0x84,
+ 0x6a, 0xfd, 0xdb, 0xcb, 0x29, 0x58, 0x34, 0x4c, 0x01, 0xc4, 0x00, 0x4a, 0x1d, 0xd8, 0x28, 0x14,
+ 0x5a, 0x1d, 0x02, 0xa1, 0x50, 0x7d, 0xef, 0x4f, 0x58, 0x24, 0x7a, 0x64, 0xfc, 0x10, 0xc0, 0xa2,
+ 0x88, 0xc1, 0xae, 0x89, 0x57, 0x21, 0xd7, 0x8b, 0x8f, 0x04, 0x4d, 0xb7, 0xc0, 0x0d, 0x86, 0xda,
+ 0x55, 0xa9, 0xb6, 0x54, 0x29, 0x2e, 0xcd, 0x76, 0x82, 0x70, 0xbe, 0x69, 0xe4, 0xbd, 0x59, 0x22,
+ 0xd4, 0xef, 0xfd, 0x1f, 0x70, 0x95, 0x5f, 0x96, 0x27, 0xe3, 0xe1, 0x9b, 0x74, 0x9e, 0x93, 0xb4,
+ 0x0e, 0xf3, 0xdd, 0x1d, 0x61, 0xd9, 0x39, 0x15, 0xe2, 0xb0, 0x9d, 0x93, 0x0b, 0x4b, 0x17, 0x68,
+ 0xbf, 0xac, 0xc0, 0x13, 0x6f, 0x39, 0xb0, 0xcf, 0xdf, 0xb4, 0xd0, 0x50, 0x01, 0x1e, 0x2e, 0x65,
+};
+
+static const uint8_t ac_rsaes_pkcs1_v1_5_example15_coeff[] = {
+ 0xdf, 0x2e, 0xb2, 0x32, 0x2c, 0xc2, 0xda, 0xab, 0xf4, 0xd1, 0x46, 0x55, 0x08, 0xf4, 0x15, 0x21,
+ 0xcd, 0xa7, 0xce, 0xff, 0x23, 0xeb, 0xe6, 0x1d, 0x00, 0xd4, 0x41, 0xee, 0x72, 0x8d, 0xda, 0x5d,
+ 0x16, 0xc7, 0xbf, 0x92, 0x0c, 0xd9, 0x5f, 0x34, 0xbe, 0xb4, 0xfe, 0x32, 0xee, 0x81, 0x7e, 0xf3,
+ 0x36, 0x2e, 0x0b, 0xcd, 0x1d, 0x12, 0x45, 0xf7, 0xb0, 0x77, 0x93, 0xea, 0xa1, 0x90, 0xdc, 0x5a,
+ 0x37, 0xfd, 0xaf, 0x4c, 0x68, 0xe2, 0xca, 0x13, 0x97, 0x2d, 0x7f, 0x51, 0x48, 0xb7, 0x96, 0xb6,
+ 0xfb, 0x6d, 0x7a, 0xdd, 0xa0, 0x7b, 0xd2, 0xcd, 0x13, 0xbe, 0x98, 0xce, 0xbe, 0xd1, 0xed, 0xc6,
+ 0xca, 0x41, 0x2e, 0x39, 0x53, 0x50, 0xc5, 0x9a, 0x1d, 0x84, 0x2b, 0xc4, 0xaa, 0x2f, 0x3c, 0x0b,
+ 0x24, 0x3f, 0xde, 0x7d, 0xfd, 0x95, 0x35, 0x6f, 0x24, 0x39, 0x25, 0x1a, 0x11, 0x72, 0xc4, 0x5e,
+};
+
+/* PKCS#1 v1.5 Encrypt Example 15.9 */
+#define ac_rsaes_pkcs1_v1_5_vect15_modulus ac_rsaes_pkcs1_v1_5_example15_modulus
+#define ac_rsaes_pkcs1_v1_5_vect15_pub_exp ac_rsaes_pkcs1_v1_5_example15_pub_exp
+#define ac_rsaes_pkcs1_v1_5_vect15_priv_exp ac_rsaes_pkcs1_v1_5_example15_priv_exp
+#define ac_rsaes_pkcs1_v1_5_vect15_prime1 ac_rsaes_pkcs1_v1_5_example15_prime1
+#define ac_rsaes_pkcs1_v1_5_vect15_prime2 ac_rsaes_pkcs1_v1_5_example15_prime2
+#define ac_rsaes_pkcs1_v1_5_vect15_exp1 ac_rsaes_pkcs1_v1_5_example15_exp1
+#define ac_rsaes_pkcs1_v1_5_vect15_exp2 ac_rsaes_pkcs1_v1_5_example15_exp2
+#define ac_rsaes_pkcs1_v1_5_vect15_coeff ac_rsaes_pkcs1_v1_5_example15_coeff
+
+/*
+ * PKCS#1 v1.5 Encryption Example 15.9
+ * from ftp://ftp.rsa.com/pub/rsalabs/tmp/pkcs1v15crypt-vectors.txt
+ */
+static const uint8_t ac_rsaes_pkcs1_v1_5_vect15_ptx[] = {
+ 0x9a, 0x13, 0x96, 0x62, 0x2d, 0x06, 0x6c, 0x10, 0x56, 0x08, 0x58, 0xc2, 0xc4, 0xcd, 0x5c, 0x04,
+ 0x44, 0x9e, 0x2b, 0x95, 0x50, 0xc5, 0xbc, 0x92, 0x93, 0x76, 0x1a, 0x91, 0x04, 0x41, 0x1d, 0xa1,
+ 0x8a, 0x57, 0xd9, 0xb6, 0xa9, 0x97, 0x33, 0x3c, 0xdb, 0xce, 0x77, 0xe9, 0xfd, 0xbe, 0x6b, 0xb8,
+ 0x31,
+};
+
+static const uint8_t ac_rsaes_pkcs1_v1_5_vect15_out[] = {
+ 0x10, 0x0e, 0xce, 0x63, 0x45, 0x25, 0xd4, 0x67, 0xf6, 0xd4, 0xa6, 0xb6, 0x6e, 0xde, 0x1c, 0xc2,
+ 0x37, 0xf6, 0x1f, 0xb2, 0xb6, 0x70, 0x23, 0xa8, 0x3d, 0xc4, 0x56, 0xb9, 0x2c, 0xda, 0x18, 0x3e,
+ 0xd6, 0x62, 0x0f, 0xe5, 0x7d, 0x5a, 0x67, 0x33, 0x2c, 0x77, 0x23, 0x3a, 0xc1, 0xe8, 0x72, 0x5b,
+ 0x36, 0xf8, 0xe1, 0xb1, 0x08, 0x41, 0x2c, 0xa6, 0xfb, 0x35, 0xdc, 0xd4, 0xd8, 0x16, 0x77, 0xa2,
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0xc4, 0x50, 0xff, 0xe2, 0x68, 0xfc, 0xab, 0x48, 0x7d, 0x4d, 0x63, 0x01, 0x3e, 0x41,
+};
+
+/*
+ * PKCS#1 v1.5 Encryption Example 10.1
+ * from http://armcryptolib.das-labor.org/trac/browser/testvectors/rsa-pkcs-1v2-1-vec/oaep-vect.txt
+ */
+
+static const uint8_t ac_rsaes_oaep_vect10_modulus[] = {
+ 0xae, 0x45, 0xed, 0x56, 0x01, 0xce, 0xc6, 0xb8, 0xcc, 0x05, 0xf8, 0x03, 0x93, 0x5c, 0x67, 0x4d,
+ 0xdb, 0xe0, 0xd7, 0x5c, 0x4c, 0x09, 0xfd, 0x79, 0x51, 0xfc, 0x6b, 0x0c, 0xae, 0xc3, 0x13, 0xa8,
+ 0xdf, 0x39, 0x97, 0x0c, 0x51, 0x8b, 0xff, 0xba, 0x5e, 0xd6, 0x8f, 0x3f, 0x0d, 0x7f, 0x22, 0xa4,
+ 0x02, 0x9d, 0x41, 0x3f, 0x1a, 0xe0, 0x7e, 0x4e, 0xbe, 0x9e, 0x41, 0x77, 0xce, 0x23, 0xe7, 0xf5,
+ 0x40, 0x4b, 0x56, 0x9e, 0x4e, 0xe1, 0xbd, 0xcf, 0x3c, 0x1f, 0xb0, 0x3e, 0xf1, 0x13, 0x80, 0x2d,
+ 0x4f, 0x85, 0x5e, 0xb9, 0xb5, 0x13, 0x4b, 0x5a, 0x7c, 0x80, 0x85, 0xad, 0xca, 0xe6, 0xfa, 0x2f,
+ 0xa1, 0x41, 0x7e, 0xc3, 0x76, 0x3b, 0xe1, 0x71, 0xb0, 0xc6, 0x2b, 0x76, 0x0e, 0xde, 0x23, 0xc1,
+ 0x2a, 0xd9, 0x2b, 0x98, 0x08, 0x84, 0xc6, 0x41, 0xf5, 0xa8, 0xfa, 0xc2, 0x6b, 0xda, 0xd4, 0xa0,
+ 0x33, 0x81, 0xa2, 0x2f, 0xe1, 0xb7, 0x54, 0x88, 0x50, 0x94, 0xc8, 0x25, 0x06, 0xd4, 0x01, 0x9a,
+ 0x53, 0x5a, 0x28, 0x6a, 0xfe, 0xb2, 0x71, 0xbb, 0x9b, 0xa5, 0x92, 0xde, 0x18, 0xdc, 0xf6, 0x00,
+ 0xc2, 0xae, 0xea, 0xe5, 0x6e, 0x02, 0xf7, 0xcf, 0x79, 0xfc, 0x14, 0xcf, 0x3b, 0xdc, 0x7c, 0xd8,
+ 0x4f, 0xeb, 0xbb, 0xf9, 0x50, 0xca, 0x90, 0x30, 0x4b, 0x22, 0x19, 0xa7, 0xaa, 0x06, 0x3a, 0xef,
+ 0xa2, 0xc3, 0xc1, 0x98, 0x0e, 0x56, 0x0c, 0xd6, 0x4a, 0xfe, 0x77, 0x95, 0x85, 0xb6, 0x10, 0x76,
+ 0x57, 0xb9, 0x57, 0x85, 0x7e, 0xfd, 0xe6, 0x01, 0x09, 0x88, 0xab, 0x7d, 0xe4, 0x17, 0xfc, 0x88,
+ 0xd8, 0xf3, 0x84, 0xc4, 0xe6, 0xe7, 0x2c, 0x3f, 0x94, 0x3e, 0x0c, 0x31, 0xc0, 0xc4, 0xa5, 0xcc,
+ 0x36, 0xf8, 0x79, 0xd8, 0xa3, 0xac, 0x9d, 0x7d, 0x59, 0x86, 0x0e, 0xaa, 0xda, 0x6b, 0x83, 0xbb,
+};
+
+static const uint8_t ac_rsaes_oaep_vect10_pub_exp[] = {
+ 0x01, 0x00, 0x01,
+};
+
+static const uint8_t ac_rsaes_oaep_vect10_priv_exp[] = {
+ 0x05, 0x6b, 0x04, 0x21, 0x6f, 0xe5, 0xf3, 0x54, 0xac, 0x77, 0x25, 0x0a, 0x4b, 0x6b, 0x0c, 0x85,
+ 0x25, 0xa8, 0x5c, 0x59, 0xb0, 0xbd, 0x80, 0xc5, 0x64, 0x50, 0xa2, 0x2d, 0x5f, 0x43, 0x8e, 0x59,
+ 0x6a, 0x33, 0x3a, 0xa8, 0x75, 0xe2, 0x91, 0xdd, 0x43, 0xf4, 0x8c, 0xb8, 0x8b, 0x9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0x01,
+ 0x84, 0x82, 0x98, 0x50, 0x9c, 0x1c, 0x3b, 0xf3, 0xa4, 0x83, 0xe7, 0x27, 0x40, 0x54, 0xe1, 0x5e,
+ 0x97, 0x07, 0x50, 0x36, 0xe9, 0x89, 0xf6, 0x09, 0x32, 0x80, 0x7b, 0x52, 0x57, 0x75, 0x1e, 0x79,
+};
+
+static const uint8_t ac_rsaes_oaep_vect10_prime1[] = {
+ 0xec, 0xf5, 0xae, 0xcd, 0x1e, 0x55, 0x15, 0xff, 0xfa, 0xcb, 0xd7, 0x5a, 0x28, 0x16, 0xc6, 0xeb,
+ 0xf4, 0x90, 0x18, 0xcd, 0xfb, 0x46, 0x38, 0xe1, 0x85, 0xd6, 0x6a, 0x73, 0x96, 0xb6, 0xf8, 0x09,
+ 0x0f, 0x80, 0x18, 0xc7, 0xfd, 0x95, 0xcc, 0x34, 0xb8, 0x57, 0xdc, 0x17, 0xf0, 0xcc, 0x65, 0x16,
+ 0xbb, 0x13, 0x46, 0xab, 0x4d, 0x58, 0x2c, 0xad, 0xad, 0x7b, 0x41, 0x03, 0x35, 0x23, 0x87, 0xb7,
+ 0x03, 0x38, 0xd0, 0x84, 0x04, 0x7c, 0x9d, 0x95, 0x39, 0xb6, 0x49, 0x62, 0x04, 0xb3, 0xdd, 0x6e,
+ 0xa4, 0x42, 0x49, 0x92, 0x07, 0xbe, 0xc0, 0x1f, 0x96, 0x42, 0x87, 0xff, 0x63, 0x36, 0xc3, 0x98,
+ 0x46, 0x58, 0x33, 0x68, 0x46, 0xf5, 0x6e, 0x46, 0x86, 0x18, 0x81, 0xc1, 0x02, 0x33, 0xd2, 0x17,
+ 0x6b, 0xf1, 0x5a, 0x5e, 0x96, 0xdd, 0xc7, 0x80, 0xbc, 0x86, 0x8a, 0xa7, 0x7d, 0x3c, 0xe7, 0x69,
+};
+
+static const uint8_t ac_rsaes_oaep_vect10_prime2[] = {
+ 0xbc, 0x46, 0xc4, 0x64, 0xfc, 0x6a, 0xc4, 0x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c4, 0xcd, 0x9c,
+ 0x5c, 0x3d, 0xb1, 0x7c, 0x6d, 0x6a, 0x57, 0x21, 0x2f, 0x73, 0xae, 0x29, 0xf6, 0x19, 0x32, 0x7b,
+ 0xad, 0x59, 0xb1, 0x53, 0x85, 0x85, 0x85, 0xba, 0x4e, 0x28, 0xb6, 0x0a, 0x62, 0xa4, 0x5e, 0x49,
+};
+
+static const uint8_t ac_rsaes_oaep_vect10_coeff[] = {
+ 0x6f, 0x38, 0x52, 0x6b, 0x39, 0x25, 0x08, 0x55, 0x34, 0xef, 0x3e, 0x41, 0x5a, 0x83, 0x6e, 0xde,
+ 0x8b, 0x86, 0x15, 0x8a, 0x2c, 0x7c, 0xbf, 0xec, 0xcb, 0x0b, 0xd8, 0x34, 0x30, 0x4f, 0xec, 0x68,
+ 0x3b, 0xa8, 0xd4, 0xf4, 0x79, 0xc4, 0x33, 0xd4, 0x34, 0x16, 0xe6, 0x32, 0x69, 0x62, 0x3c, 0xea,
+ 0x10, 0x07, 0x76, 0xd8, 0x5a, 0xff, 0x40, 0x1d, 0x3f, 0xff, 0x61, 0x0e, 0xe6, 0x54, 0x11, 0xce,
+ 0x3b, 0x13, 0x63, 0xd6, 0x3a, 0x97, 0x09, 0xee, 0xde, 0x42, 0x64, 0x7c, 0xea, 0x56, 0x14, 0x93,
+ 0xd5, 0x45, 0x70, 0xa8, 0x79, 0xc1, 0x86, 0x82, 0xcd, 0x97, 0x71, 0x0b, 0x96, 0x20, 0x5e, 0xc3,
+ 0x11, 0x17, 0xd7, 0x3b, 0x5f, 0x36, 0x22, 0x3f, 0xad, 0xd6, 0xe8, 0xba, 0x90, 0xdd, 0x7c, 0x0e,
+ 0xe6, 0x1d, 0x44, 0xe1, 0x63, 0x25, 0x1e, 0x20, 0xc7, 0xf6, 0x6e, 0xb3, 0x05, 0x11, 0x7c, 0xb8,
+};
+
+static const uint8_t ac_rsaes_oaep_vect10_ptx[] = {
+ 0x8b, 0xba, 0x6b, 0xf8, 0x2a,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xcc, 0x29, 0x14, 0x2f, 0x9a, 0x8b, 0xd4, 0x18, 0xe3, 0xc1,
+ 0xfd, 0x67, 0x34, 0x4b, 0x0c, 0xd0, 0x82, 0x9d, 0xf3, 0xb2, 0xbe, 0xc6, 0x02, 0x53, 0x19, 0x62,
+ 0x93, 0xc6, 0xb3, 0x4d, 0x3f, 0x75, 0xd3, 0x2f, 0x21, 0x3d, 0xd4, 0x5c, 0x62, 0x73, 0xd5, 0x05,
+ 0xad, 0xf4, 0xcc, 0xed, 0x10, 0x57, 0xcb, 0x75, 0x8f, 0xc2, 0x6a, 0xee, 0xfa, 0x44, 0x12, 0x55,
+ 0xed, 0x4e, 0x64, 0xc1, 0x99, 0xee, 0x07, 0x5e, 0x7f, 0x16, 0x64, 0x61, 0x82, 0xfd, 0xb4, 0x64,
+ 0x73, 0x9b, 0x68, 0xab, 0x5d, 0xaf, 0xf0, 0xe6, 0x3e, 0x95, 0x52, 0x01, 0x68, 0x24, 0xf0, 0x54,
+ 0xbf, 0x4d, 0x3c, 0x8c, 0x90, 0xa9, 0x7b, 0xb6, 0xb6, 0x55, 0x32, 0x84, 0xeb, 0x42, 0x9f, 0xcc,
+};
+
+/* diffie hellman test data */
+/* p and g testdata generated using the following line:
+ * for i in {256..2048..64}; do openssl dhparam -C -5 $i; done
+ */
+static const uint8_t keygen_dh256_p[] = {
+ 0xB6, 0x73, 0x91, 0xB5, 0xD6, 0xBC, 0x95, 0x73, 0x0D, 0x53, 0x64, 0x13,
+ 0xB0, 0x51, 0xC6, 0xB4, 0xEB, 0x9D, 0x74, 0x57, 0x8D, 0x65, 0x3A, 0x4B,
+ 0x7A, 0xB2, 0x93, 0x27, 0xA6, 0xC1, 0xBC, 0xAB,
+};
+
+static const uint8_t keygen_dh256_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh320_p[] = {
+ 0x80, 0x72, 0x50, 0x4F, 0x85, 0xD2, 0x32, 0x70, 0xA3, 0x11, 0xF4, 0x46,
+ 0x01, 0x72, 0xD0, 0x72, 0x96, 0xA5, 0x1B, 0xFA, 0x8F, 0x35, 0x49, 0x75,
+ 0x04, 0xA5, 0x5A, 0x62, 0xB6, 0x33, 0xD6, 0x3C, 0x46, 0xD1, 0xED, 0xD7,
+ 0xB1, 0xD4, 0xBA, 0xF3,
+};
+
+static const uint8_t keygen_dh320_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh384_p[] = {
+ 0xC2, 0x04, 0xC8, 0x0E, 0xE8, 0x3F, 0x02, 0x1F, 0xDE, 0x0C, 0xAA, 0x2E,
+ 0x67, 0x13, 0xF4, 0x33, 0x67, 0x82, 0x59, 0xE7, 0x80, 0xE5, 0x42, 0xEA,
+ 0x2F, 0xC4, 0x71, 0x93, 0xA7, 0x1C, 0x86, 0xEC, 0x8C, 0x39, 0xF8, 0xC7,
+ 0xF1, 0xE3, 0xE0, 0xEE, 0xC4, 0x55, 0xF5, 0x4F, 0xE7, 0x98, 0xF0, 0x47,
+};
+
+static const uint8_t keygen_dh384_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh448_p[] = {
+ 0x91, 0xB9, 0x28, 0x8F, 0x01, 0x62, 0xA1, 0x40, 0x4D, 0x53, 0xC7, 0xD5,
+ 0xEE, 0x97, 0x40, 0x03, 0x39, 0x39, 0x41, 0x5F, 0x17, 0x0F, 0xA2, 0x78,
+ 0xBF, 0x3D, 0x6B, 0x33, 0x33, 0x39, 0x3B, 0x57, 0x21, 0x5B, 0xF9, 0xB1,
+ 0x6C, 0xE3, 0xB8, 0x19, 0xBE, 0x81, 0xBD, 0xC4, 0xFF, 0x4C, 0xFA, 0x48,
+ 0x63, 0x24, 0x10, 0x33, 0xDE, 0x3A, 0xFD, 0x3B,
+};
+
+static const uint8_t keygen_dh448_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh512_p[] = {
+ 0xCF, 0x09, 0xB8, 0xCD, 0x0B, 0xC5, 0x9D, 0xBD, 0x7A, 0x34, 0x50, 0x55,
+ 0xEC, 0xD4, 0xED, 0x92, 0x9D, 0x63, 0x92, 0xF9, 0x1D, 0x42, 0xF3, 0x64,
+ 0x04, 0x3D, 0xCC, 0xAA, 0x5F, 0xD1, 0xBB, 0xEA, 0x44, 0x12, 0xFC, 0xF0,
+ 0xFB, 0xFF, 0x26, 0x57, 0xE3, 0x6E, 0xA8, 0x3F, 0x45, 0x43, 0x11, 0x81,
+ 0xC6, 0x79, 0xF0, 0x0B, 0x11, 0x23, 0x1D, 0x7B, 0x1E, 0x59, 0xA8, 0xB8,
+ 0x69, 0x44, 0xA7, 0xE3,
+};
+
+static const uint8_t keygen_dh512_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh576_p[] = {
+ 0xEF, 0xA2, 0xD7, 0x81, 0x88, 0xAA, 0xBF, 0x70, 0x03, 0x70, 0xD4, 0x75,
+ 0xA6, 0x3E, 0x5B, 0xCF, 0x73, 0xDE, 0x7D, 0x45, 0x67, 0x47, 0xB1, 0xCF,
+ 0xA8, 0x62, 0xA9, 0x13, 0x9F, 0xC3, 0x9B, 0x96, 0xCE, 0xB9, 0x0C, 0x24,
+ 0xAC, 0xCB, 0xB6, 0x40, 0x30, 0x25, 0x26, 0x4E, 0x9D, 0x50, 0xA7, 0x8F,
+ 0x09, 0x1C, 0x9B, 0xDE, 0x77, 0x8A, 0xE8, 0xAA, 0xDA, 0xC2, 0x31, 0x08,
+ 0x55, 0x2C, 0xC1, 0x13, 0x24, 0x6E, 0x5A, 0xE7, 0xA1, 0xBC, 0xE5, 0x5B,
+};
+
+static const uint8_t keygen_dh576_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh640_p[] = {
+ 0xED, 0xB6, 0x90, 0x9C, 0x72, 0x5C, 0x63, 0x11, 0x17, 0xA9, 0xB6, 0x0E,
+ 0x6C, 0x80, 0xA9, 0xF3, 0x15, 0x36, 0x9D, 0x49, 0x02, 0x2B, 0x4F, 0x12,
+ 0x1A, 0xFD, 0x00, 0xC0, 0x9B, 0x12, 0x10, 0x96, 0x18, 0x55, 0x3F, 0x0C,
+ 0x75, 0x46, 0x6E, 0xDF, 0x0A, 0x58, 0x8E, 0x1B, 0x4B, 0xFF, 0x24, 0x70,
+ 0xFC, 0x29, 0xE8, 0x67, 0x8F, 0x0B, 0x72, 0x14, 0x80, 0x6F, 0xE9, 0xCD,
+ 0x30, 0x3C, 0x16, 0xB9, 0xB0, 0x32, 0xBE, 0x6A, 0x1D, 0x06, 0xEE, 0x6D,
+ 0x15, 0x44, 0x49, 0x55, 0xA8, 0x08, 0x2D, 0x0F,
+};
+
+static const uint8_t keygen_dh640_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh704_p[] = {
+ 0xA6, 0xBF, 0xA1, 0x02, 0x02, 0xA7, 0x7A, 0x6E, 0xFC, 0x48, 0x55, 0x81,
+ 0x23, 0x3F, 0x08, 0x8E, 0x83, 0xE9, 0x10, 0x92, 0x96, 0x82, 0x5F, 0xB8,
+ 0x88, 0x28, 0x0C, 0x6A, 0x04, 0x41, 0xEF, 0x4C, 0xCC, 0x2F, 0x16, 0xCD,
+ 0xA4, 0x2F, 0x24, 0x3B, 0xB6, 0x8A, 0x45, 0x76, 0xB3, 0xFA, 0x23, 0x83,
+ 0x53, 0xB2, 0x8F, 0x0C, 0xAE, 0xF9, 0xE8, 0xDB, 0x46, 0x5B, 0xBF, 0x7E,
+ 0xC3, 0x6F, 0x4F, 0xE6, 0xE7, 0x51, 0x75, 0x49, 0xB5, 0x4B, 0xBE, 0x48,
+ 0x51, 0x64, 0x9F, 0x5D, 0x56, 0xC7, 0x28, 0x9C, 0xC5, 0xBD, 0x0C, 0xD2,
+ 0x3A, 0x63, 0x49, 0x57,
+};
+
+static const uint8_t keygen_dh704_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh768_p[] = {
+ 0xEA, 0x9B, 0x0E, 0xD5, 0xDF, 0xC6, 0x9C, 0x8A, 0x26, 0x29, 0xD4, 0x2A,
+ 0x94, 0x4F, 0xD5,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 0x62,
+ 0x7D, 0x06, 0x06, 0xC5, 0xFB, 0x47, 0xD0, 0x3F, 0x4B, 0xC1, 0x7A, 0xC4,
+ 0x2A, 0xF3, 0x69, 0xF2, 0xDE, 0x77, 0xCD, 0x03,
+};
+
+static const uint8_t keygen_dh832_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh896_p[] = {
+ 0xA8, 0x1A, 0xFB, 0xF4, 0x12, 0xF8, 0x17, 0x16, 0x89, 0x20, 0xAE, 0x6F,
+ 0x07, 0x55, 0x13, 0xCA, 0x99, 0x66, 0xA3, 0x1F, 0x07, 0xAC, 0x32, 0x5C,
+ 0xF5, 0xF0, 0x39, 0xA3, 0xDA, 0xF5, 0x55, 0xF9, 0x3C, 0xF3, 0x15, 0xF8,
+ 0x44, 0xC1, 0x10, 0x6A, 0x3D, 0x2F, 0x97, 0xFD, 0xAC, 0x74, 0x1E, 0xEE,
+ 0xCF, 0xDD, 0xEE, 0x70, 0x57, 0xBA, 0x4B, 0x41, 0xD6, 0x3F, 0xDD, 0x01,
+ 0xFB, 0x0C, 0x26, 0xA9, 0x06, 0xCD, 0x1B, 0xA2, 0xD3, 0x3E, 0xAD, 0x2D,
+ 0x29, 0xFB, 0x79, 0xB8, 0x8E, 0x50, 0xCC, 0xA1, 0x85, 0x37, 0xFA, 0xF1,
+ 0xBB, 0xB1, 0x5D, 0x3B, 0x51, 0x54, 0x16, 0x4C, 0x98, 0x2B, 0x26, 0xAD,
+ 0x70, 0x0B, 0x01, 0x87, 0x5C, 0xF1, 0xE8, 0x02, 0xF3, 0x57, 0xA9, 0x40,
+ 0x5C, 0xC5, 0xE0, 0xFF,
+};
+
+static const uint8_t keygen_dh896_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh960_p[] = {
+ 0xD9, 0x31, 0xE0, 0xF3, 0x80, 0xED, 0xBD, 0xEC, 0x35, 0x99, 0xC9, 0x28,
+ 0xA8, 0x88, 0x3C, 0x84, 0x41, 0x8A, 0x6C, 0x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, 0x91, 0x15, 0x02, 0x79,
+ 0x93, 0x31, 0xE4, 0x3A, 0x17, 0x9D, 0x9F, 0x68, 0xCD, 0x73, 0x28, 0x83,
+ 0xC3, 0x07, 0x43, 0x15, 0x05, 0x50, 0x9F, 0x78, 0x91, 0x2A, 0x98, 0x35,
+ 0xA3, 0xE4, 0x84, 0x84, 0x55, 0xDF, 0x32, 0x29, 0x27, 0x91, 0xC8, 0xFF,
+ 0x8B, 0x7B, 0x4E, 0x1B, 0xA1, 0x02, 0xBA, 0x31, 0x33, 0x79, 0x2E, 0x73,
+ 0x1D, 0x00, 0x30, 0xF2, 0x1E, 0x83, 0xB4, 0x7B, 0xD1, 0x76, 0xD4, 0x9E,
+ 0x2E, 0x32, 0xB6, 0xA5, 0x69, 0xB2, 0x28, 0x8E, 0xC4, 0xE3, 0xB0, 0x33,
+ 0x7E, 0x59, 0x90, 0x92, 0x40, 0x3F, 0x2C, 0x98, 0xC6, 0xEE, 0x26, 0xF1,
+ 0xE0, 0xE2, 0xB0, 0xA6, 0x50, 0xB0, 0x2E, 0xF1, 0xE3, 0x2D, 0x4F, 0xB5,
+ 0x58, 0xDA, 0x07, 0xBE, 0x9D, 0x20, 0x7C, 0x10, 0x23, 0x6D, 0x60, 0x96,
+ 0x11, 0xC9, 0xB4, 0xD4, 0x9C, 0xF0, 0x01, 0x8F, 0x9B, 0xC4, 0x83, 0xC6,
+ 0x47, 0x53, 0x74, 0xDD, 0x74, 0x01, 0x03, 0x9C, 0x99, 0xA0, 0x5E, 0xE2,
+ 0xA0, 0x05, 0x6E, 0x66, 0xB0, 0x01, 0xDD, 0x44, 0xFF, 0xA6, 0x65, 0x96,
+ 0x92, 0x2B, 0x89, 0x57,
+};
+
+static const uint8_t keygen_dh1664_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh1728_p[] = {
+ 0xED, 0x9F, 0xF6, 0x0C, 0xD6, 0x18, 0x33, 0xE8, 0x26, 0x13, 0xF2, 0x56,
+ 0xE7, 0x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 0x52, 0xA3, 0x4D,
+ 0x66, 0x01, 0xE7, 0x28, 0xF4, 0xDC, 0xF2, 0x46, 0xBB, 0x02, 0x95, 0x21,
+ 0x6A, 0x8F, 0x97, 0xA7, 0x3F, 0x06, 0x2E, 0xB2, 0x97, 0xEC, 0x5A, 0xFB,
+};
+
+
+static const uint8_t keygen_dh1728_g[] = {
+ 0x05,
+};
+
+static const uint8_t keygen_dh1792_p[] = {
+ 0x9A, 0x87, 0x16, 0x1D, 0x23, 0x55, 0xC7, 0x06, 0x55, 0xD7, 0xB1, 0xB3,
+ 0x71, 0x66, 0x9A, 0x16, 0x5A, 0xA6, 0x8F, 0x54, 0x50, 0x99, 0xBD, 0x90,
+ 0x8C, 0x84, 0xB3, 0xBC, 0x02, 0xFE, 0xCB, 0x07, 0x3A, 0x7E, 0x97, 0x12,
+ 0x32, 0xEC, 0xA0, 0x0B, 0xEA, 0x96, 0x51, 0xB4, 0x50, 0x4E, 0x3A, 0xCB,
+ 0x27, 0xA9, 0x42, 0x51, 0x49, 0x35, 0x9F, 0x45, 0x6B, 0xDA, 0xE0, 0x6C,
+ 0x10, 0x80, 0x00, 0x41, 0xC2, 0xFC, 0x91, 0xB6, 0x59, 0xCE, 0x76, 0x7F,
+ 0x21, 0xC6, 0x10, 0x8A, 0x68, 0x68, 0x54, 0x76, 0xCE, 0x33, 0xA6, 0x37,
+ 0xCF, 0x80, 0xDF, 0x37, 0x12, 0x77, 0xBA, 0xBF, 0x15, 0x10, 0x22, 0x4A,
+ 0xA1, 0x9B, 0xA6, 0x6B, 0x8E, 0x14, 0x4F, 0x64, 0xF4, 0x87, 0x64, 0xAA,
+ 0x6E, 0xBC, 0xB5, 0xB2, 0x96, 0x27, 0xD1, 0x1A, 0x6E, 0x6D, 0x4B, 0xC6,
+ 0x43, 0x28, 0xE9, 0xFC, 0xA4, 0xCB, 0x61, 0x8F, 0xEA, 0xE8, 0x40, 0xF2,
+ 0x0A, 0x19, 0xBA, 0x17, 0x49, 0x9A,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 0x4B, 0x94, 0x10, 0xFD, 0x24, 0xA3, 0x77, 0x74, 0x77, 0xFA, 0x98, 0x4B,
+ 0x43, 0x0B, 0xB6, 0xEC, 0x7F, 0x5C, 0x7E, 0xBA, 0xB7, 0xC7, 0xAA, 0x72,
+ 0x11, 0x9F, 0x73, 0x14, 0x45, 0x03, 0x7A, 0x4E, 0xE5, 0xE7, 0x5C, 0x64,
+ 0xB8, 0x66, 0x66, 0xCE, 0xEE, 0xF8, 0xFF, 0x61, 0x0F, 0x5D, 0x4E, 0xF6,
+ 0xED, 0xB1, 0xE5, 0x2F, 0x52, 0xAC, 0x2B, 0x8F, 0x34, 0x0D, 0x13, 0xF6,
+ 0x4A, 0x3A, 0x6C, 0x56, 0xB3, 0x3C, 0x52, 0xA8, 0xB9, 0xBC, 0x27, 0xCA,
+ 0x3B, 0xFB, 0x6E, 0xE7, 0x52, 0xFB, 0xB0, 0x2B, 0x4F, 0xC4, 0xBD, 0x24,
+ 0x36, 0xE4, 0x71, 0x07, 0x74, 0x69, 0x5F, 0xE0, 0xB8, 0x59, 0x5F, 0x74,
+ 0x2F, 0xCC, 0x03, 0xB0, 0x6D, 0x90, 0xD8, 0xD3, 0x7C, 0x5A, 0x31, 0x46,
+ 0x5C, 0x7D, 0x1C, 0xC8, 0x0D, 0x18, 0x80, 0x8E, 0x5A, 0xA8, 0x5E, 0x4D,
+ 0x11, 0x2B, 0x76, 0xAC, 0x1E, 0x00, 0x51, 0x80, 0xE3, 0xED, 0x7A, 0xC0,
+ 0x4F, 0x80, 0xFA, 0x5F, 0xD5, 0xD7, 0x4F, 0xA7, 0x14, 0xE1, 0x60, 0x3C,
+ 0x95, 0x77, 0xCA, 0x3B,
+};
+
+static const uint8_t keygen_dh2048_subprime_g[] = {
+ 0x05,
+};
+static const uint32_t keygen_dh256_private_bits;
+
+static const uint32_t keygen_dh320_private_bits = 256;
+
+static const uint32_t keygen_dh384_private_bits;
+
+static const uint32_t keygen_dh448_private_bits = 256;
+
+static const uint32_t keygen_dh512_private_bits;
+
+static const uint32_t keygen_dh576_private_bits = 288;
+
+static const uint32_t keygen_dh640_private_bits;
+
+static const uint32_t keygen_dh704_private_bits = 352;
+
+static const uint32_t keygen_dh768_private_bits;
+
+static const uint32_t keygen_dh832_private_bits = 416;
+
+static const uint32_t keygen_dh896_private_bits;
+
+static const uint32_t keygen_dh960_private_bits = 480;
+
+static const uint32_t keygen_dh1024_private_bits;
+
+static const uint32_t keygen_dh1088_private_bits = 544;
+
+static const uint32_t keygen_dh1152_private_bits;
+
+static const uint32_t keygen_dh1216_private_bits = 608;
+
+static const uint32_t keygen_dh1280_private_bits;
+
+static const uint32_t keygen_dh1344_private_bits = 672;
+
+static const uint32_t keygen_dh1408_private_bits;
+
+static const uint32_t keygen_dh1472_private_bits = 736;
+
+static const uint32_t keygen_dh1536_private_bits;
+
+static const uint32_t keygen_dh1600_private_bits = 800;
+
+static const uint32_t keygen_dh1664_private_bits;
+
+static const uint32_t keygen_dh1728_private_bits = 864;
+
+static const uint32_t keygen_dh1792_private_bits;
+
+static const uint32_t keygen_dh1856_private_bits = 928;
+
+static const uint32_t keygen_dh1920_private_bits;
+
+static const uint32_t keygen_dh1984_private_bits = 992;
+
+static const uint32_t keygen_dh2048_private_bits;
+
+static const uint32_t keygen_dh2048_subprime_private_bits;
+
+static const uint8_t keygen_dh2048_subprime_subprime[] = {
+ 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+/*
+ * Test data from 186-3dsatestvectors.zip KeyPair.rsp
+ * http://csrc.nist.gov/groups/STM/cavp/documents/dss/186-3dsatestvectors.zip
+ */
+/* [mod = L=1024, N=160] */
+static const uint8_t keygen_dsa_test1_p[] = {
+ 0xd3, 0x83, 0x11, 0xe2, 0xcd, 0x38, 0x8c, 0x3e, 0xd6, 0x98, 0xe8, 0x2f,
+ 0xdf, 0x88, 0xeb, 0x92, 0xb5, 0xa9, 0xa4, 0x83, 0xdc, 0x88, 0x00, 0x5d,
+ 0x4b, 0x72, 0x5e, 0xf3, 0x41, 0xea, 0xbb, 0x47, 0xcf, 0x8a, 0x7a, 0x8a,
+ 0x41, 0xe7, 0x92, 0xa1, 0x56, 0xb7, 0xce, 0x97, 0x20, 0x6c, 0x4f, 0x9c,
+ 0x5c, 0xe6, 0xfc, 0x5a, 0xe7, 0x91, 0x21, 0x02, 0xb6, 0xb5, 0x02, 0xe5,
+ 0x90, 0x50, 0xb5, 0xb2, 0x1c, 0xe2, 0x63, 0xdd, 0xdb, 0x20, 0x44, 0xb6,
+ 0x52, 0x23, 0x6f, 0x4d, 0x42, 0xab, 0x4b, 0x5d, 0x6a, 0xa7, 0x31, 0x89,
+ 0xce, 0xf1, 0xac, 0xe7, 0x78, 0xd7, 0x84, 0x5a, 0x5c, 0x1c, 0x1c, 0x71,
+ 0x47, 0x12, 0x31, 0x88, 0xf8, 0xdc, 0x55, 0x10, 0x54, 0xee, 0x16, 0x2b,
+ 0x63, 0x4d, 0x60, 0xf0, 0x97, 0xf7, 0x19, 0x07, 0x66, 0x40, 0xe2, 0x09,
+ 0x80, 0xa0, 0x09, 0x31, 0x13, 0xa8, 0xbd, 0x73
+};
+
+static const uint8_t keygen_dsa_test1_q[] = {
+ 0x96, 0xc5, 0x39, 0x0a, 0x8b, 0x61, 0x2c, 0x0e, 0x42, 0x2b, 0xb2, 0xb0,
+ 0xea, 0x19, 0x4a, 0x3e, 0xc9, 0x35, 0xa2, 0x81
+};
+
+static const uint8_t keygen_dsa_test1_g[] = {
+ 0x06, 0xb7, 0x86, 0x1a, 0xbb, 0xd3, 0x5c, 0xc8, 0x9e, 0x79, 0xc5, 0x2f,
+ 0x68, 0xd2, 0x08, 0x75, 0x38, 0x9b, 0x12, 0x73, 0x61, 0xca, 0x66, 0x82,
+ 0x21, 0x38, 0xce, 0x49, 0x91, 0xd2, 0xb8, 0x62, 0x25, 0x9d, 0x6b, 0x45,
+ 0x48, 0xa6, 0x49, 0x5b, 0x19, 0x5a, 0xa0, 0xe0, 0xb6, 0x13, 0x7c, 0xa3,
+ 0x7e, 0xb2, 0x3b, 0x94, 0x07, 0x4d, 0x3c, 0x3d, 0x30, 0x00, 0x42, 0xbd,
+ 0xf1, 0x57, 0x62, 0x81, 0x2b, 0x63, 0x33, 0xef, 0x7b, 0x07, 0xce, 0xba,
+ 0x78, 0x60, 0x76, 0x10, 0xfc, 0xc9, 0xee, 0x68, 0x49, 0x1d, 0xbc, 0x1e,
+ 0x34, 0xcd, 0x12, 0x61, 0x54, 0x74, 0xe5, 0x2b, 0x18, 0xbc, 0x93, 0x4f,
+ 0xb0, 0x0c, 0x61, 0xd3, 0x9e, 0x7d, 0xa8, 0x90, 0x22, 0x91, 0xc4, 0x43,
+ 0x4a, 0x4e, 0x22, 0x24, 0xc3, 0xf4, 0xfd, 0x9f, 0x93, 0xcd, 0x6f, 0x4f,
+ 0x17, 0xfc, 0x07, 0x63, 0x41, 0xa7, 0xe7, 0xd9
+};
+
+/* for i in {512..1024..64}; do openssl dsaparam -C $i; done */
+static const uint8_t keygen_dsa512_p[] = {
+ 0xC8, 0x6B, 0xB7, 0x91, 0xD6, 0x63, 0xCE, 0xC0, 0xC6, 0xB8, 0xAC, 0x5B,
+ 0xEB, 0xA7, 0xEF, 0x17, 0xBE, 0x1A, 0x1A, 0x36, 0x6B, 0x38, 0x40, 0x0E,
+ 0x69, 0x13, 0x32, 0xD4, 0x4B, 0xBE, 0x00, 0xB5, 0x29, 0x7F, 0x6B, 0x87,
+ 0xAA, 0x1D, 0x98, 0x37, 0xD2, 0xAC, 0x62, 0x26, 0xD7, 0xFD, 0xE1, 0xC9,
+ 0x13, 0x4F, 0x2A, 0xF2, 0x82, 0xEC, 0xA8, 0x83, 0x6F, 0x29, 0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0x90, 0x89, 0xB9, 0x88, 0x19,
+};
+
+static const uint8_t keygen_dsa576_q[] = {
+ 0xF0, 0xD8, 0x71, 0x31, 0xB5, 0x01, 0xC1, 0x6B, 0x09, 0xCE, 0x7D, 0x2F,
+ 0x82, 0x48, 0xB0, 0x21, 0x9C, 0xD6, 0xB5, 0xB1,
+};
+
+static const uint8_t keygen_dsa576_g[] = {
+ 0x33, 0x45, 0xB8, 0x9A, 0x17, 0x4B, 0xBF, 0xD3, 0xB2, 0xBA, 0xD2, 0xE4,
+ 0xAC, 0x54, 0xA0, 0x9B, 0x5F, 0x5D, 0x95, 0x88, 0x9C, 0x0C, 0x59, 0xCE,
+ 0x40, 0x0C, 0x05, 0xFD, 0xC4, 0x9D, 0x22, 0x27, 0xDA, 0xA6, 0xD1, 0x10,
+ 0x61, 0x46, 0x31, 0x5C, 0x7D, 0x4E, 0xF6, 0x01, 0x38, 0x9A, 0x7E, 0x72,
+ 0x4E, 0x7A, 0x07, 0xFB, 0x6D, 0x20, 0x9D, 0x59, 0xC6, 0x33, 0x6A, 0x64,
+ 0xBF, 0x14, 0x30, 0x4E, 0x0C, 0x64, 0x9D, 0x11, 0xCF, 0x64, 0xCE, 0x29,
+};
+
+static const uint8_t keygen_dsa640_p[] = {
+ 0x88, 0x8C, 0x58, 0x99, 0xF4, 0x78, 0xEA, 0x31, 0x56, 0xB7, 0x2C, 0x70,
+ 0xDC, 0x09, 0x5D, 0xB9, 0x13, 0x16, 0xCE, 0xDF, 0xFD, 0x8C, 0x4E, 0xF8,
+ 0x32, 0x59, 0x00, 0x58, 0xD6, 0x44, 0x4F, 0x95, 0xF7, 0x85, 0x14, 0xC3,
+ 0x10, 0x5A, 0xA2, 0x44, 0x2F, 0xA2, 0xC9, 0xB4, 0x88, 0x89, 0xA1, 0xAE,
+ 0x0E, 0x82, 0xE1, 0xC1, 0x45, 0x09, 0x98, 0xF7, 0xCB, 0xF2, 0xD8, 0xA0,
+ 0x6E, 0x32, 0x02, 0xE4, 0x0E, 0x7A, 0x43, 0x3A, 0xE1, 0x04, 0x4C, 0xC5,
+ 0x78, 0x0E, 0x02, 0x27, 0xC4, 0xD0, 0xCA, 0x29,
+};
+
+static const uint8_t keygen_dsa640_q[] = {
+ 0xD7, 0x63, 0x4F, 0x3E, 0x6D, 0x52, 0x93, 0x69, 0xFA, 0xFF, 0xDE, 0x0D,
+ 0x57, 0x3F, 0x24, 0xBB, 0x01, 0xF8, 0x01, 0xAD,
+};
+
+static const uint8_t keygen_dsa640_g[] = {
+ 0x76, 0xCB, 0x07, 0xB9, 0xE9, 0x3F, 0x3C, 0xA5, 0x18, 0x43, 0x83, 0xE6,
+ 0xBC, 0x42, 0x09, 0xD9, 0xC5, 0x1C, 0x56, 0x57, 0x0B, 0x5B, 0x46, 0x65,
+ 0x00, 0x67, 0xCA, 0x33, 0xC0, 0xA6, 0x37, 0xEA, 0x89, 0xAE, 0xDF, 0x1D,
+ 0x79, 0x96, 0xC7, 0x0C, 0xD2, 0xAC, 0xD3, 0x2C, 0x46, 0xC2, 0xA0, 0x9D,
+ 0x4B, 0x06, 0xB5, 0xDF, 0xAE, 0x73, 0xEB, 0x9A, 0x6A, 0x54, 0x39, 0x2C,
+ 0xB1, 0x98, 0xAD, 0x44, 0xF3, 0x29, 0xC9, 0xC5, 0x75, 0xF1, 0x3C, 0xD8,
+ 0x3B, 0xA1, 0x85, 0x29, 0x38, 0xB9, 0x17, 0xA5,
+};
+
+static const uint8_t keygen_dsa704_p[] = {
+ 0xDA, 0xEA, 0x9B, 0x6B, 0x35, 0x06, 0x2E, 0x7E, 0x71, 0xB2, 0x11, 0xD0,
+ 0x37, 0x84, 0x88, 0xC0, 0x50, 0x94, 0x73, 0x78, 0xA8, 0x9C, 0xBD, 0x8C,
+ 0xB1, 0x0A, 0xD5, 0x89, 0x52, 0x39, 0xBF, 0x41, 0xDC, 0xB9, 0xE5, 0x16,
+ 0x1A, 0x86, 0xD5, 0xCF, 0xD6, 0x26, 0x84, 0x95, 0xE9, 0x0D, 0xCD, 0x98,
+ 0x21, 0x6B, 0x3C, 0xFE, 0x6D, 0x2D, 0x42, 0x1A, 0x3F, 0xE0, 0xFF, 0x07,
+ 0x41, 0x82, 0x30, 0x15, 0x17, 0xF3, 0x0F, 0x7B, 0xA0, 0xD3, 0x46, 0xFA,
+ 0x1F, 0x1E, 0xEC, 0xBD, 0x26, 0xCE, 0x4C, 0xE3, 0xBD, 0x73, 0xA3, 0xA6,
+ 0xA0, 0x12, 0xE1, 0xFD,
+};
+
+static const uint8_t keygen_dsa704_q[] = {
+ 0xCE, 0xB3, 0x2E, 0x41, 0xEB, 0xFD, 0x22, 0x2A, 0xCE, 0x9A, 0xAF, 0x24,
+ 0xE3, 0x02, 0x50, 0xDE, 0x47, 0xBC, 0x4C, 0x1F,
+};
+
+static const uint8_t keygen_dsa704_g[] = {
+ 0x08, 0x83, 0x72, 0x6D, 0x0A, 0x8F, 0x19, 0x61, 0xE4, 0x62, 0x40, 0x29,
+ 0x66, 0x6B, 0xDE, 0xBD, 0xAB, 0xE3, 0x5B, 0x58, 0x3F, 0xF5, 0xEA, 0xDE,
+ 0x8E, 0x7A, 0x34, 0xAF, 0x1C, 0x99, 0x03, 0x1A, 0x51, 0x17, 0xFC, 0xE0,
+ 0xA3, 0x22, 0x43, 0x63, 0xB6, 0x7E, 0x29, 0x4B, 0x23, 0x6C, 0xD1, 0xDE,
+ 0x59, 0xEC, 0x1D, 0x67, 0x94, 0xDD, 0x2E, 0x88, 0x86, 0xD3, 0xD6, 0x68,
+ 0x58, 0x36, 0x48, 0xF8, 0xEF, 0x38, 0x3F, 0xF5, 0x87, 0x96, 0x38, 0xD3,
+ 0x48, 0x50, 0x1F, 0xA3, 0x4A, 0xCA, 0xD7, 0x4D, 0xC3, 0x84, 0x83, 0xB1,
+ 0x8A, 0x95, 0xE0, 0xB3,
+};
+
+static const uint8_t keygen_dsa768_p[] = {
+ 0xF0, 0xB1, 0x93, 0xFD, 0x53, 0x98, 0x23, 0x43, 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x64, 0x1E,
+ 0xC5, 0x91, 0x34, 0x60, 0xF2, 0xE2, 0x2D, 0x64, 0x4E, 0x46, 0xAA, 0x00,
+ 0x6F, 0x26, 0xD8, 0x98, 0x97, 0xBF, 0xCC, 0xF1, 0x1B, 0x4A, 0x8A, 0x7D,
+ 0x39, 0xA4, 0xA4, 0x23, 0x82, 0x64, 0x78, 0x40, 0xED, 0x4C, 0x96, 0xB9,
+};
+
+static const uint8_t keygen_dsa832_p[] = {
+ 0x93, 0x47, 0x85, 0x69, 0x79, 0xF2, 0xAA, 0xC2, 0x83, 0xA4, 0x08, 0x2F,
+ 0x3C, 0xE5, 0x4D, 0x3B, 0xFF, 0x4D, 0xC5, 0xF4, 0x03, 0x20, 0xFA, 0x15,
+ 0xA8, 0x27, 0x80, 0x55, 0x29, 0x57, 0x60, 0x0B, 0x75, 0x01, 0x7B, 0x65,
+ 0xCE, 0x4D, 0x7C, 0xF6, 0x7C, 0x4F, 0x1D, 0xC3, 0x67, 0xF2, 0xC1, 0x64,
+ 0x38, 0x49, 0x54, 0x60, 0x57, 0x05, 0xEB, 0x31, 0xFA, 0x7B, 0x50, 0xA1,
+ 0x0F, 0xCB, 0xC4, 0x4E, 0xDF, 0x92, 0x5A, 0x8B, 0x11, 0xBA, 0x6B, 0x7E,
+ 0x7A, 0xB4, 0x80, 0xD0, 0x9A, 0xE2, 0x88, 0x7D, 0x83, 0xA6, 0x81, 0x81,
+ 0x71, 0xD0, 0x06, 0xDE, 0xCC, 0xA4, 0xB9, 0x0A, 0x6B, 0x81, 0x31, 0x28,
+ 0x1D, 0xEF, 0x5F, 0x99, 0xDE, 0xEC, 0xDA, 0x4D,
+};
+
+static const uint8_t keygen_dsa832_q[] = {
+ 0xF8, 0xF5, 0xAF, 0x31, 0x0D, 0xBE, 0x6F, 0x4B, 0x79, 0x87, 0xA2, 0x98,
+ 0xED, 0xF1, 0x2A, 0x93, 0x3D, 0x12, 0x5D, 0x25,
+};
+
+static const uint8_t keygen_dsa832_g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 0xF7, 0x9B, 0x70, 0x22, 0x7F, 0x05, 0xEB, 0xCB, 0x6D, 0x66, 0xDE, 0xFC,
+ 0xED, 0x51, 0xC2, 0x4D,
+};
+
+static const uint8_t keygen_dsa960_p[] = {
+ 0xCA, 0x86, 0x31, 0x0C, 0x62, 0xC7, 0x25, 0x2F, 0xAA, 0x8D, 0xA5, 0x51,
+ 0x97, 0x81, 0xB8, 0xC5, 0xFD, 0xDB, 0x47, 0xC4, 0x8E, 0xDF, 0x06, 0xAA,
+ 0x76, 0xAD, 0x47, 0xDD, 0x56, 0x6C, 0x97, 0xEB, 0x8C, 0xEC, 0x59, 0x79,
+ 0x1B, 0xBF, 0x96, 0x80, 0x50, 0x72, 0x8E, 0x2F, 0x34, 0x71, 0x5B, 0x03,
+ 0x2D, 0xB0, 0x31, 0x37, 0x8C, 0xC4, 0x62, 0x99, 0x9D, 0xC2, 0xDF, 0x68,
+ 0x35, 0xD5, 0x3F, 0xC1, 0x4B, 0xC4, 0x2F, 0xFA, 0xBD, 0x7E, 0xA5, 0x20,
+ 0x8F, 0xB9, 0x5F, 0x98, 0xA9, 0x1B, 0xAF, 0x8A, 0xF8, 0x29, 0xEB, 0x44,
+ 0xB6, 0x50, 0x96, 0xE2, 0xB4, 0x3D, 0x3C, 0xE6, 0x8B, 0xD5, 0x15, 0x39,
+ 0x4F, 0xF4, 0xC3, 0x32, 0xD3, 0xE6, 0x36, 0x0D, 0x23, 0xFF, 0x76, 0x15,
+ 0x05, 0xC1, 0xDF, 0xC2, 0x82, 0xCE, 0xDD, 0x60, 0x05, 0x92, 0x56, 0xE5,
+};
+
+static const uint8_t keygen_dsa960_q[] = {
+ 0xCE, 0x0A, 0x68, 0xA4, 0xAC, 0x5E, 0x8E, 0x4C, 0xA6, 0x8A, 0xAB, 0xA9,
+ 0x39, 0xC7, 0xB4, 0x10, 0xCC, 0xF6, 0x1E, 0x2F,
+};
+
+static const uint8_t keygen_dsa960_g[] = {
+ 0x8A, 0x50, 0x28, 0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 0x11, 0xDB,
+ 0x28, 0x53, 0xA5, 0xBB, 0x22, 0xC5, 0x71, 0x97, 0x09, 0xBC, 0xEE, 0x55,
+ 0x9B, 0x6B, 0x22, 0x64, 0xE4, 0x49, 0x2C, 0xCD, 0x9E, 0xA5, 0x86, 0xF0,
+ 0x3F, 0x08, 0xCD, 0x88, 0x07, 0xF6, 0x6E, 0x3F, 0x8E, 0x99, 0x31, 0xBA,
+ 0x1A, 0xB9, 0x8E, 0xEC, 0xA3, 0x13, 0xC2, 0x85, 0xA5, 0xDC, 0xA4, 0xF0,
+ 0x1F, 0xB2, 0xC8, 0xD5, 0x19, 0x79, 0xCA, 0x6A,
+};
+
+/* derive key test data, taken from GP test specifikation */
+static const uint8_t derive_key_dh_prime[] = {
+ 0xe0, 0x01, 0xe8, 0x96, 0x7d, 0xb4, 0x93, 0x53, 0xe1, 0x6f, 0x8e, 0x89,
+ 0x22, 0x0c, 0xce, 0xfc, 0x5c, 0x5f, 0x12, 0xe3, 0xdf, 0xf8, 0xf1, 0xd1,
+ 0x49, 0x90, 0x12, 0xe6, 0xef, 0x53, 0xe3, 0x1f, 0x02, 0xea, 0xcc, 0x5a,
+ 0xdd, 0xf3, 0x37, 0x89, 0x35, 0xc9, 0x5b, 0x21, 0xea, 0x3d, 0x6f, 0x1c,
+ 0xd7, 0xce, 0x63, 0x75, 0x52, 0xec, 0x38, 0x6c, 0x0e, 0x34, 0xf7, 0x36,
+ 0xad, 0x95, 0x17, 0xef, 0xfe, 0x5e, 0x4d, 0xa7, 0xa8, 0x6a, 0xf9, 0x0e,
+ 0x2c, 0x22, 0x8f, 0xe4, 0xb9, 0xe6, 0xd8, 0xf8, 0xf0, 0x2d, 0x20, 0xaf,
+ 0x78, 0xab, 0xb6, 0x92, 0xac, 0xbc, 0x4b, 0x23, 0xfa, 0xf2, 0xc5, 0xcc,
+ 0xd4, 0x9a, 0x0c, 0x9a, 0x8b, 0xcd, 0x91, 0xac, 0x0c, 0x55, 0x92, 0x01,
+ 0xe6, 0xc2, 0xfd, 0x1f, 0x47, 0xc2, 0xcb, 0x2a, 0x88, 0xa8, 0x3c, 0x21,
+ 0x0f, 0xc0, 0x54, 0xdb, 0x29, 0x2d, 0xbc, 0x45
+};
+
+static const uint8_t derive_key_dh_base[] = {
+ 0x1c, 0xe0, 0xf6, 0x69, 0x26, 0x46, 0x11, 0x97, 0xef, 0x45, 0xc4, 0x65,
+ 0x8b, 0x83, 0xb8, 0xab
+};
+
+static const uint8_t derive_key_dh_public_value[] = {
+ 0xbb, 0xe9, 0x18, 0xdd, 0x4b, 0x2b, 0x94, 0x1b, 0x10, 0x0e, 0x88, 0x35,
+ 0x28, 0x68, 0xfc, 0x62, 0x04, 0x38, 0xa6, 0xdb, 0x32, 0xa6, 0x9e, 0xee,
+ 0x6c, 0x6f, 0x45, 0x1c, 0xa3, 0xa6, 0xd5, 0x37, 0x77, 0x75, 0x5b, 0xc1,
+ 0x37, 0x0a, 0xce, 0xfe, 0x2b, 0x8f, 0x13, 0xa9, 0x14, 0x2c, 0x5b, 0x44,
+ 0x15, 0x78, 0x86, 0x30, 0xd6, 0x95, 0xb1, 0x92, 0x20, 0x63, 0xa3, 0xcf,
+ 0x9d, 0xef, 0x65, 0x61, 0x27, 0x4d, 0x24, 0x01, 0xe7, 0xa1, 0x45, 0xf2,
+ 0xd8, 0xb9, 0x3a, 0x45, 0x17, 0xf4, 0x19, 0xd0, 0x5e, 0xf8, 0xcb, 0x35,
+ 0x59, 0x37, 0x9d, 0x04, 0x20, 0xa3, 0xbf, 0x02, 0xad, 0xfe, 0xa8, 0x60,
+ 0xb2, 0xc3, 0xee, 0x85, 0x58, 0x90, 0xf3, 0xb5, 0x57, 0x2b, 0xb4, 0xef,
+ 0xd7, 0x8f, 0x37, 0x68, 0x78, 0x7c, 0x71, 0x52, 0x9d, 0x5e, 0x0a, 0x61,
+ 0x4f, 0x09, 0x89, 0x92, 0x39, 0xf7, 0x4b, 0x01
+};
+
+static const uint8_t derive_key_dh_private_value[] = {
+ 0x53, 0x8d, 0x3d, 0x64, 0x27, 0x4a, 0x40, 0x05, 0x9b, 0x9c, 0x26, 0xe9,
+ 0x13, 0xe6, 0x91, 0x53, 0x23, 0x7b, 0x55, 0x83
+};
+
+static const uint8_t derive_key_dh_public_value_2[] = {
+ 0xa3, 0xf5, 0x7d, 0xbe, 0x9e, 0x2f, 0x0a, 0xda, 0xa9, 0x4e, 0x4e, 0x6a,
+ 0xf0, 0xe0, 0x71, 0x47, 0x0e, 0x2e, 0x41, 0x2e, 0xde, 0x73, 0x2a, 0x62,
+ 0x14, 0xc3, 0x7c, 0x26, 0xd4, 0xe9, 0x9a, 0x54, 0xba, 0x3d, 0xe7, 0x49,
+ 0x85, 0x95, 0x0e, 0xe9, 0x14, 0xb2, 0x90, 0x22, 0x91, 0xdc, 0xff, 0x61,
+ 0xb2, 0xfc, 0xd1, 0xd0, 0x1b, 0x11, 0x14, 0xb6, 0x02, 0x64, 0x2b, 0x26,
+ 0x5d, 0x88, 0xea, 0x8d, 0xbb, 0xe2, 0x07, 0x0b, 0x48, 0xfb, 0x01, 0x53,
+ 0x55, 0x1e, 0x59, 0x51, 0x36, 0xf2, 0xf9, 0xd1, 0x97, 0xfb, 0x66, 0x12,
+ 0x84, 0x5d, 0xed, 0xb8, 0x9b, 0x2d, 0x3e, 0x2b, 0x8c, 0xeb, 0x2a, 0x72,
+ 0x40, 0x9d, 0x55, 0x4c, 0xed, 0xeb, 0x55, 0x02, 0xff, 0x8c, 0xb0, 0x2e,
+ 0x03, 0x65, 0x3f, 0x41, 0xb1, 0xac, 0xa3, 0x30, 0x6b, 0xff, 0x6d, 0xf4,
+ 0x6d, 0xe6, 0xe1, 0x0f, 0x86, 0x7c, 0x43, 0x64
+};
+
+static const uint8_t derive_key_dh_shared_secret[] = {
+ 0x4e, 0x6a, 0xcf, 0xfd, 0x7d, 0x14, 0x27, 0x65, 0xeb, 0xf4, 0xc7, 0x12,
+ 0x41, 0x4f, 0xe4, 0xb6, 0xab, 0x95, 0x7f, 0x4c, 0xb4, 0x66, 0xb4, 0x66,
+ 0x01, 0x28, 0x9b, 0xb8, 0x20, 0x60, 0x42, 0x82, 0x72, 0x84, 0x2e, 0xe2,
+ 0x8f, 0x11, 0x3c, 0xd1, 0x1f, 0x39, 0x43, 0x1c, 0xbf, 0xfd, 0x82, 0x32,
+ 0x54, 0xce, 0x47, 0x2e, 0x21, 0x05, 0xe4, 0x9b, 0x3d, 0x7f, 0x11, 0x3b,
+ 0x82, 0x50, 0x76, 0xe6, 0x26, 0x45, 0x85, 0x80, 0x7b, 0xc4, 0x64, 0x54,
+ 0x66, 0x5f, 0x27, 0xc5, 0xe4, 0xe1, 0xa4, 0xbd, 0x03, 0x47, 0x04, 0x86,
+ 0x32, 0x29, 0x81, 0xfd, 0xc8, 0x94, 0xcc, 0xa1, 0xe2, 0x93, 0x09, 0x87,
+ 0xc9, 0x2c, 0x15, 0xa3, 0x8b, 0xc4, 0x2e, 0xb3, 0x88, 0x10, 0xe8, 0x67,
+ 0xc4, 0x43, 0x2f, 0x07, 0x25, 0x9e, 0xc0, 0x0c, 0xdb, 0xbb, 0x0f, 0xb9,
+ 0x9e, 0x17, 0x27, 0xc7, 0x06, 0xda, 0x58, 0xdd
+};
+
+static const uint32_t derive_key_max_keysize = 1024;
+
+
+#endif /*XTEST_4000_DATA_H*/
diff --git a/host/xtest/xtest_5000.c b/host/xtest/xtest_5000.c
new file mode 100644
index 0000000..88b9465
--- /dev/null
+++ b/host/xtest/xtest_5000.c
@@ -0,0 +1,572 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+#include "tee_internal_api.h"
+#include "tee_api_defines.h"
+#include "tee_client_api.h"
+
+#define OFFSET0 0
+
+#define PARAM_0 0
+#define PARAM_1 1
+#define PARAM_2 2
+#define PARAM_3 3
+
+struct xtest_session {
+ ADBG_Case_t *c;
+ TEEC_Session session;
+ TEEC_Context context;
+};
+
+/* Compares two memories and checks if their length and content is the same */
+#define EXPECT_SHARED_MEM_BUFFER(c, exp_buf, exp_blen, op, param_num, shrm) \
+ do { \
+ if ((exp_buf) == NULL) { \
+ ADBG_EXPECT((c), exp_blen, \
+ (op)->params[(param_num)].memref.size); \
+ } else { \
+ ADBG_EXPECT_COMPARE_POINTER((c), (shrm), ==, \
+ (op)->params[(param_num)].memref.parent); \
+ ADBG_EXPECT_BUFFER((c), (exp_buf), (exp_blen), \
+ (shrm)->buffer, \
+ (op)->params[(param_num)].memref.size); \
+ } \
+ } while (0)
+
+/*
+ * Compares the content of the memory cells in OP with the expected value
+ * contained.
+ */
+#define EXPECT_OP_TMP_MEM_BUFFER(c, exp_buf, exp_blen, op, param_num, buf) \
+ do { \
+ if ((exp_buf) == NULL) { \
+ ADBG_EXPECT((c), exp_blen, \
+ (op)->params[(param_num)].tmpref.size); \
+ } else { \
+ ADBG_EXPECT_COMPARE_POINTER((c), (buf), ==, \
+ (op)->params[(param_num)].tmpref.buffer); \
+ ADBG_EXPECT_BUFFER((c), (exp_buf), (exp_blen), \
+ (buf), \
+ (op)->params[(param_num)].memref.size); \
+ } \
+ } while (0)
+
+/* Initiates the memory and allocates size uint32_t. */
+
+/* Registers the TEEC_SharedMemory to the TEE. */
+static TEEC_Result RegisterSharedMemory(TEEC_Context *ctx,
+ TEEC_SharedMemory *shm, uint32_t size,
+ uint32_t flags)
+{
+ shm->flags = flags;
+ shm->size = size;
+ return TEEC_RegisterSharedMemory(ctx, shm);
+}
+
+/* Allocates shared memory inside of the TEE. */
+static TEEC_Result AllocateSharedMemory(TEEC_Context *ctx,
+ TEEC_SharedMemory *shm, uint32_t size,
+ uint32_t flags)
+{
+ shm->flags = flags;
+ shm->size = size;
+ return TEEC_AllocateSharedMemory(ctx, shm);
+}
+
+static void CloseSession_null(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "CloseSession_null");
+ {
+ /* In reality doesn't test anything. */
+ TEEC_CloseSession(NULL);
+ }
+ Do_ADBG_EndSubCase(cs->c, "CloseSession_null");
+}
+
+static void Allocate_In(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Allocate_In");
+ {
+ TEEC_SharedMemory shm;
+ uint32_t size = 1024;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ AllocateSharedMemory(&cs->context, &shm, size,
+ TEEC_MEM_INPUT));
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Allocate_In");
+}
+
+static void Allocate_out_of_memory(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Allocate_out_of_memory");
+ {
+ TEEC_SharedMemory shm;
+ uint32_t SIZE_OVER_MEMORY_CAPACITY = INT32_MAX;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+ ADBG_EXPECT_TEEC_RESULT(cs->c, TEEC_ERROR_OUT_OF_MEMORY,
+ AllocateSharedMemory(&cs->context, &shm,
+ SIZE_OVER_MEMORY_CAPACITY,
+ TEEC_MEM_INPUT));
+ ADBG_EXPECT_POINTER(cs->c, NULL, shm.buffer);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Allocate_out_of_memory");
+}
+
+static void OpenSession_error_notExistingTA(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "OpenSession_error_notExistingTA");
+ {
+ TEEC_UUID NONEXISTING_TA_UUID = { 0x534D1192, 0x6143, 0x234C,
+ { 0x47, 0x55, 0x53, 0x52,
+ 0x54, 0x4F, 0x4F, 0x59 } };
+ uint32_t ret_orig;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ ADBG_EXPECT_COMPARE_UNSIGNED(cs->c, TEEC_SUCCESS, !=,
+ TEEC_OpenSession(&cs->context, &cs->session,
+ &NONEXISTING_TA_UUID,
+ TEEC_LOGIN_PUBLIC, NULL, NULL,
+ &ret_orig));
+ ADBG_EXPECT_COMPARE_UNSIGNED(cs->c, TEEC_ORIGIN_TRUSTED_APP, !=,
+ ret_orig);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "OpenSession_error_notExistingTA");
+}
+
+static void Allocate_InOut(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Allocate_InOut");
+ {
+ TEEC_SharedMemory shm;
+ uint8_t val[] = { 54, 76, 98, 32 };
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ AllocateSharedMemory(&cs->context, &shm, sizeof(val),
+ TEEC_MEM_INPUT | TEEC_MEM_OUTPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Allocate_InOut");
+}
+
+static void Register_In(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Register_In");
+ {
+ TEEC_SharedMemory shm;
+ uint8_t val[] = { 32, 65, 43, 21, 98 };
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ shm.buffer = val;
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ RegisterSharedMemory(&cs->context, &shm, sizeof(val),
+ TEEC_MEM_INPUT));
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Register_In");
+}
+
+static void Register_notZeroLength_Out(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Register_notZeroLength_Out");
+ {
+ TEEC_SharedMemory shm;
+ uint8_t val[] = { 56, 67, 78, 99 };
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ shm.buffer = val;
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c, RegisterSharedMemory(
+ &cs->context, &shm,
+ sizeof(val), TEEC_MEM_OUTPUT));
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Register_notZeroLength_Out");
+}
+
+static void Register_InOut(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Register_InOut");
+ {
+ TEEC_SharedMemory shm;
+ uint8_t val[] = { 54, 76, 23, 98, 255, 23, 86 };
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ shm.buffer = val;
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ RegisterSharedMemory(&cs->context, &shm, sizeof(val),
+ TEEC_MEM_INPUT | TEEC_MEM_OUTPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Register_InOut");
+}
+
+static void Register_zeroLength_Out(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Register_zeroLength_Out");
+ {
+ uint8_t val[] = { 65, 76, 98, 32 };
+ TEEC_SharedMemory shm;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ shm.buffer = val;
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c, RegisterSharedMemory(
+ &cs->context, &shm, 0,
+ TEEC_MEM_OUTPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Register_zeroLength_Out");
+}
+
+static void Allocate_Out(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Allocate_Out");
+ {
+ TEEC_SharedMemory shm;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ AllocateSharedMemory(&cs->context, &shm, 0,
+ TEEC_MEM_OUTPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Allocate_Out");
+}
+
+static void FinalizeContext_null(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "FinalizeContext_null");
+ {
+ TEEC_FinalizeContext(NULL);
+ }
+ Do_ADBG_EndSubCase(cs->c, "FinalizeContext_null");
+}
+
+static void InitializeContext_NotExistingTEE(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "InitializeContext_NotExistingTEE");
+ {
+ ADBG_EXPECT_COMPARE_UNSIGNED(cs->c, TEEC_SUCCESS, !=,
+ TEEC_InitializeContext("Invalid TEE name",
+ &cs->context));
+ }
+ Do_ADBG_EndSubCase(cs->c, "InitializeContext_NotExistingTEE");
+}
+
+static void AllocateThenRegister_SameMemory(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "AllocateThenRegister_SameMemory");
+ {
+ TEEC_SharedMemory shm;
+ uint32_t size_allocation = 32;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ AllocateSharedMemory(&cs->context, &shm,
+ size_allocation, TEEC_MEM_INPUT));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ RegisterSharedMemory(&cs->context, &shm,
+ size_allocation, TEEC_MEM_INPUT));
+ }
+ Do_ADBG_EndSubCase(cs->c, "AllocateThenRegister_SameMemory");
+}
+
+static void AllocateSameMemory_twice(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "AllocateSameMemory_twice");
+ {
+ TEEC_SharedMemory shm;
+ uint32_t size_allocation = 32;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ AllocateSharedMemory(&cs->context, &shm,
+ size_allocation, TEEC_MEM_INPUT));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ AllocateSharedMemory(&cs->context, &shm,
+ size_allocation, TEEC_MEM_INPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "AllocateSameMemory_twice");
+}
+
+static void RegisterSameMemory_twice(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "RegisterSameMemory_twice");
+ {
+ uint8_t val[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
+ TEEC_SharedMemory shm;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ shm.buffer = val;
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ RegisterSharedMemory(&cs->context, &shm, sizeof(val),
+ TEEC_MEM_INPUT));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ RegisterSharedMemory(&cs->context, &shm, sizeof(val),
+ TEEC_MEM_INPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "RegisterSameMemory_twice");
+}
+
+static void Allocate_sharedMemory_maxSize(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c,
+ "Allocate_sharedMemory_MaxSize_Above_and_Below, allocate max size");
+ {
+ uint32_t size_max = TEEC_CONFIG_SHAREDMEM_MAX_SIZE;
+ TEEC_SharedMemory shm;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ AllocateSharedMemory(&cs->context, &shm, size_max,
+ TEEC_MEM_INPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ }
+ Do_ADBG_EndSubCase(cs->c,
+ "Allocate_sharedMemory_MaxSize_Above_and_Below, allocate max size");
+}
+
+static void Allocate_sharedMemory_belowMaxSize(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c,
+ "Allocate_sharedMemory_MaxSize_Above_and_Below, "
+ "allocate just below max size");
+ {
+ TEEC_SharedMemory shm;
+ uint32_t size_below = TEEC_CONFIG_SHAREDMEM_MAX_SIZE - 1;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ AllocateSharedMemory(&cs->context, &shm, size_below,
+ TEEC_MEM_INPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c,
+ "Allocate_sharedMemory_MaxSize_Above_and_Below, "
+ "allocate just below max size");
+}
+
+static void Allocate_sharedMemory_aboveMaxSize(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c,
+ "Allocate_sharedMemory_MaxSize_Above_and_Below, "
+ "allocate just above max size");
+ {
+ TEEC_Result res;
+ TEEC_SharedMemory shm;
+ uint32_t size_above = TEEC_CONFIG_SHAREDMEM_MAX_SIZE + 1;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ res = AllocateSharedMemory(&cs->context, &shm, size_above,
+ TEEC_MEM_INPUT);
+
+ ADBG_EXPECT_TRUE(cs->c, res == TEEC_ERROR_OUT_OF_MEMORY ||
+ res == TEEC_SUCCESS);
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c,
+ "Allocate_sharedMemory_MaxSize_Above_and_Below, "
+ "allocate just above max size");
+}
+
+static void Register_sharedMemory_maxSize(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Register_sharedMemory_maxSize");
+ {
+ uint32_t size_max = TEEC_CONFIG_SHAREDMEM_MAX_SIZE;
+ uint8_t val[size_max];
+ TEEC_SharedMemory shm;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ shm.buffer = val;
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ RegisterSharedMemory(&cs->context, &shm, size_max,
+ TEEC_MEM_INPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ TEEC_FinalizeContext(&cs->context);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Register_sharedMemory_maxSize");
+}
+
+static void Register_sharedMemory_aboveMaxSize(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Register_sharedMemory_aboveMaxSize");
+ {
+ TEEC_Result res;
+ uint32_t size_aboveMax = 0xffffffff;
+ uint8_t val[1];
+ TEEC_SharedMemory shm;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ shm.buffer = val;
+ res = RegisterSharedMemory(&cs->context, &shm, size_aboveMax,
+ TEEC_MEM_INPUT);
+
+ ADBG_EXPECT_TRUE(cs->c, res == TEEC_ERROR_OUT_OF_MEMORY ||
+ res == TEEC_SUCCESS);
+
+ TEEC_ReleaseSharedMemory(&shm);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Register_sharedMemory_aboveMaxSize");
+}
+
+static void Register_sharedMemory_belowMaxSize(struct xtest_session *cs)
+{
+ Do_ADBG_BeginSubCase(cs->c, "Register_sharedMemory_belowMaxSize");
+ {
+ uint32_t size_belowMax = TEEC_CONFIG_SHAREDMEM_MAX_SIZE - 1;
+ uint8_t val[size_belowMax];
+ TEEC_SharedMemory shm;
+
+ ADBG_EXPECT(cs->c, TEEC_SUCCESS,
+ TEEC_InitializeContext(_device, &cs->context));
+
+ shm.buffer = val;
+ ADBG_EXPECT_TEEC_SUCCESS(cs->c,
+ RegisterSharedMemory(&cs->context, &shm, size_belowMax,
+ TEEC_MEM_INPUT));
+
+ TEEC_ReleaseSharedMemory(&shm);
+ }
+ Do_ADBG_EndSubCase(cs->c, "Register_sharedMemory_belowMaxSize");
+}
+
+static void xtest_teec_TEE(ADBG_Case_t *c)
+{
+ struct xtest_session connection = { c };
+
+ CloseSession_null(&connection);
+
+ Allocate_In(&connection);
+
+ Allocate_out_of_memory(&connection);
+
+ OpenSession_error_notExistingTA(&connection);
+
+ Allocate_InOut(&connection);
+
+ Register_In(&connection);
+
+ Register_notZeroLength_Out(&connection);
+
+ Register_InOut(&connection);
+
+ Register_zeroLength_Out(&connection);
+
+ Allocate_Out(&connection);
+
+ FinalizeContext_null(&connection);
+
+ InitializeContext_NotExistingTEE(&connection);
+
+ AllocateThenRegister_SameMemory(&connection);
+
+ AllocateSameMemory_twice(&connection);
+
+ RegisterSameMemory_twice(&connection);
+
+ Allocate_sharedMemory_maxSize(&connection);
+
+ Allocate_sharedMemory_belowMaxSize(&connection);
+
+ Allocate_sharedMemory_aboveMaxSize(&connection);
+
+ Register_sharedMemory_maxSize(&connection);
+
+ Register_sharedMemory_aboveMaxSize(&connection);
+
+ Register_sharedMemory_belowMaxSize(&connection);
+}
+
+ADBG_CASE_DEFINE(XTEST_TEE_5006, xtest_teec_TEE,
+ /* Title */
+ "Tests for Global platform TEEC",
+ /* Short description */
+ "Invocation of all tests for TEE Client API",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ...");
diff --git a/host/xtest/xtest_6000.c b/host/xtest/xtest_6000.c
new file mode 100644
index 0000000..ef607b5
--- /dev/null
+++ b/host/xtest/xtest_6000.c
@@ -0,0 +1,844 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include <adbg.h>
+#include <xtest_test.h>
+#include <xtest_helpers.h>
+
+#include <tee_client_api.h>
+#include <ta_storage.h>
+#include <tee_api_defines.h>
+#include <tee_api_types.h>
+
+static uint8_t file_00[] = {
+ 0x00, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
+ 0xF0, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
+ 0xE9, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
+ 0xF0, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x8E
+};
+
+static uint8_t file_01[] = {
+ 0x01, 0x00
+};
+
+static uint8_t file_02[] = {
+ 0x02, 0x11, 0x02
+};
+
+static uint8_t file_03[] = {
+ 0x03, 0x13, 0x03
+};
+
+static uint8_t data_00[] = {
+ 0x00, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
+ 0x00, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
+ 0x00, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
+ 0x00, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x00
+};
+
+static uint8_t data_01[] = {
+ 0x01, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
+ 0x01, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
+ 0x01, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
+ 0x01, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x01
+};
+
+static TEEC_Result fs_open(TEEC_Session *sess, void *id, uint32_t id_size,
+ uint32_t flags, uint32_t *obj)
+{
+ TEEC_Operation op;
+ TEEC_Result res;
+ uint32_t org;
+
+ op.params[0].tmpref.buffer = id;
+ op.params[0].tmpref.size = id_size;
+ op.params[1].value.a = flags;
+ op.params[1].value.b = 0;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
+ TEEC_VALUE_INOUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_OPEN, &op, &org);
+
+ if (res == TEEC_SUCCESS)
+ *obj = op.params[1].value.b;
+
+ return res;
+}
+
+static TEEC_Result fs_create(TEEC_Session *sess, void *id, uint32_t id_size,
+ uint32_t flags, uint32_t attr, void *data,
+ uint32_t data_size, uint32_t *obj)
+{
+ TEEC_Operation op;
+ TEEC_Result res;
+ uint32_t org;
+
+ op.params[0].tmpref.buffer = id;
+ op.params[0].tmpref.size = id_size;
+ op.params[1].value.a = flags;
+ op.params[1].value.b = 0;
+ op.params[2].value.a = attr;
+ op.params[2].value.b = 0;
+ op.params[3].tmpref.buffer = data;
+ op.params[3].tmpref.size = data_size;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
+ TEEC_VALUE_INOUT, TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT);
+
+ res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_CREATE, &op, &org);
+
+ if (res == TEEC_SUCCESS)
+ *obj = op.params[1].value.b;
+
+ return res;
+}
+
+static TEEC_Result fs_close(TEEC_Session *sess, uint32_t obj)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.params[0].value.a = obj;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_CLOSE, &op, &org);
+}
+
+static TEEC_Result fs_read(TEEC_Session *sess, uint32_t obj, void *data,
+ uint32_t data_size, uint32_t *count)
+{
+ TEEC_Result res;
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.params[0].tmpref.buffer = data;
+ op.params[0].tmpref.size = data_size;
+ op.params[1].value.a = obj;
+ op.params[1].value.b = 0;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_VALUE_INOUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_READ, &op, &org);
+
+ if (res == TEEC_SUCCESS)
+ *count = op.params[1].value.b;
+
+ return res;
+}
+
+static TEEC_Result fs_write(TEEC_Session *sess, uint32_t obj, void *data,
+ uint32_t data_size)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.params[0].tmpref.buffer = data;
+ op.params[0].tmpref.size = data_size;
+ op.params[1].value.a = obj;
+ op.params[1].value.b = 0;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
+ TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_WRITE, &op, &org);
+}
+
+static TEEC_Result fs_seek(TEEC_Session *sess, uint32_t obj, int32_t offset,
+ int32_t whence)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.params[0].value.a = obj;
+ op.params[0].value.b = offset;
+ op.params[1].value.a = whence;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_VALUE_INOUT,
+ TEEC_NONE, TEEC_NONE);
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_SEEK, &op, &org);
+}
+
+static TEEC_Result fs_unlink(TEEC_Session *sess, uint32_t obj)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.params[0].value.a = obj;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_UNLINK, &op, &org);
+}
+
+static TEEC_Result fs_trunc(TEEC_Session *sess, uint32_t obj, uint32_t len)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.params[0].value.a = obj;
+ op.params[0].value.b = len;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_TRUNC, &op, &org);
+}
+
+static TEEC_Result fs_rename(TEEC_Session *sess, uint32_t obj, void *id,
+ uint32_t id_size)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.params[0].value.a = obj;
+ op.params[1].tmpref.buffer = id;
+ op.params[1].tmpref.size = id_size;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_RENAME, &op, &org);
+}
+
+static TEEC_Result fs_alloc_enum(TEEC_Session *sess, uint32_t *e)
+{
+ TEEC_Result res;
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_OUTPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_ALLOC_ENUM, &op, &org);
+
+ if (res == TEEC_SUCCESS)
+ *e = op.params[0].value.a;
+
+ return res;
+}
+
+static TEEC_Result fs_free_enum(TEEC_Session *sess, uint32_t e)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
+ TEEC_NONE);
+
+ op.params[0].value.a = e;
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_FREE_ENUM, &op, &org);
+}
+
+static TEEC_Result fs_start_enum(TEEC_Session *sess, uint32_t e)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
+ TEEC_NONE, TEEC_NONE);
+
+ op.params[0].value.a = e;
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_START_ENUM, &op, &org);
+}
+
+static TEEC_Result fs_next_enum(TEEC_Session *sess, uint32_t e, void *obj_info,
+ size_t info_size, void *id, uint32_t id_size)
+{
+ TEEC_Operation op;
+ uint32_t org;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT,
+ TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE);
+
+ op.params[0].value.a = e;
+ op.params[1].tmpref.buffer = obj_info;
+ op.params[1].tmpref.size = info_size;
+ op.params[2].tmpref.buffer = id;
+ op.params[2].tmpref.size = id_size;
+
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_NEXT_ENUM, &op, &org);
+}
+
+/* create */
+static void xtest_tee_test_6001(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj;
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_00, sizeof(file_00),
+ TEE_DATA_FLAG_ACCESS_WRITE |
+ TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
+ sizeof(data_00), &obj)))
+ goto exit;
+
+ /* clean */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+/* open */
+static void xtest_tee_test_6002(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj;
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_WRITE, 0, data_00,
+ sizeof(data_00), &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj)))
+ goto exit;
+
+ /* clean */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+/* read */
+static void xtest_tee_test_6003(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj;
+ uint8_t out[10] = { 0 };
+ uint32_t count;
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
+ sizeof(data_01), &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_READ |
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
+ goto exit;
+
+ (void)ADBG_EXPECT_BUFFER(c, data_01, 10, out, count);
+
+ /* clean */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+/* write */
+static void xtest_tee_test_6004(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj;
+ uint8_t out[10] = { 0 };
+ uint32_t count;
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ /* create */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
+ sizeof(data_01), &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
+ goto exit;
+
+ /* write new data */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_WRITE, &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_write(&sess, obj, data_00, sizeof(data_00))))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
+ goto exit;
+
+ /* verify */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_READ |
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
+ goto exit;
+
+ (void)ADBG_EXPECT_BUFFER(c, data_00, 10, out, count);
+
+ /* clean */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+/* seek */
+static void xtest_tee_test_6005(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj;
+ uint8_t out[10] = { 0 };
+ uint32_t count;
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ /* create */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_WRITE |
+ TEE_DATA_FLAG_ACCESS_READ |
+ TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
+ sizeof(data_00), &obj)))
+ goto exit;
+
+ /* seek */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_seek(&sess, obj, 10, TEE_DATA_SEEK_SET)))
+ goto exit;
+
+ /* verify */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
+ goto exit;
+
+ (void)ADBG_EXPECT_BUFFER(c, &data_00[10], 10, out, count);
+
+ /* clean */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+/* unlink */
+static void xtest_tee_test_6006(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj;
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ /* create */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
+ sizeof(data_00), &obj)))
+ goto exit;
+
+ /* del & close */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
+ goto exit;
+
+ /* check result */
+ if (!ADBG_EXPECT_TEEC_RESULT(c, TEEC_ERROR_ITEM_NOT_FOUND,
+ fs_open(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_READ, &obj)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+/* trunc */
+static void xtest_tee_test_6007(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj;
+ uint8_t out[10] = { 0 };
+ uint32_t count;
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ /* create */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_WRITE |
+ TEE_DATA_FLAG_ACCESS_READ |
+ TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
+ sizeof(data_00), &obj)))
+ goto exit;
+
+ /* trunc */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_trunc(&sess, obj, 10)))
+ goto exit;
+
+ /* seek */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(
+ c, fs_seek(&sess, obj, 5, TEE_DATA_SEEK_SET)))
+ goto exit;
+
+ /* verify */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
+ goto exit;
+
+ /* check buffer */
+ (void)ADBG_EXPECT_BUFFER(c, &data_00[5], 5, out, count);
+
+ /* clean */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+static void xtest_tee_test_6008(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj;
+ uint8_t out[10] = { 0 };
+ uint32_t count;
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ /* create */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
+ sizeof(data_01), &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_WRITE |
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj)))
+ goto exit;
+
+ /* write new data */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_write(&sess, obj, data_00, sizeof(data_00))))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_rename(&sess, obj, file_03, sizeof(file_03))))
+ goto exit;
+
+ /* close */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
+ goto exit;
+
+ /* verify */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_03, sizeof(file_03),
+ TEE_DATA_FLAG_ACCESS_READ |
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
+ goto exit;
+
+ /* check buffer */
+ (void)ADBG_EXPECT_BUFFER(c, data_00, 10, out, count);
+
+ /* clean */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+static void xtest_tee_test_6009(ADBG_Case_t *c)
+{
+ TEEC_Session sess;
+ uint32_t obj0;
+ uint32_t obj1;
+ uint32_t obj2;
+ uint32_t e = 0;
+ uint8_t info[200];
+ uint8_t id[200];
+ uint32_t orig;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
+ return;
+
+ /* create file 00 */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_00, sizeof(file_00),
+ TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
+ sizeof(data_01), &obj0)))
+ goto exit;
+
+ /* create file 01 */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
+ sizeof(data_01), &obj1)))
+ goto exit;
+
+ /* create file 02 */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_create(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
+ sizeof(data_01), &obj2)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj0)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj1)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj2)))
+ goto exit;
+
+ /* iterate */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_alloc_enum(&sess, &e)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_start_enum(&sess, e)))
+ goto exit;
+
+ /* get 00 */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_next_enum(&sess, e, info, sizeof(info), id, sizeof(id))))
+ goto exit;
+
+ /* get 01 */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_next_enum(&sess, e, info, sizeof(info), id, sizeof(id))))
+ goto exit;
+
+ /* get 02 */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_next_enum(&sess, e, info, sizeof(info), id, sizeof(id))))
+ goto exit;
+
+ /* we should not have more files */
+ if (!ADBG_EXPECT_TEEC_RESULT(c, TEEC_ERROR_ITEM_NOT_FOUND,
+ fs_next_enum(&sess, e, info, sizeof(info), id, sizeof(id))))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_free_enum(&sess, e)))
+ goto exit;
+
+ /* clean */
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_00, sizeof(file_00),
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj0)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj0)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_01, sizeof(file_01),
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj1)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj1)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c,
+ fs_open(&sess, file_02, sizeof(file_02),
+ TEE_DATA_FLAG_ACCESS_WRITE_META, &obj2)))
+ goto exit;
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj2)))
+ goto exit;
+
+exit:
+ TEEC_CloseSession(&sess);
+}
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6001, xtest_tee_test_6001,
+ /* Title */
+ "Test TEE_CreatePersistentObject",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6002, xtest_tee_test_6002,
+ /* Title */
+ "Test TEE_OpenPersistentObject",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6003, xtest_tee_test_6003,
+ /* Title */
+ "Test TEE_ReadObjectData",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6004, xtest_tee_test_6004,
+ /* Title */
+ "Test TEE_WriteObjectData",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6005, xtest_tee_test_6005,
+ /* Title */
+ "Test TEE_SeekObjectData",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6006, xtest_tee_test_6006,
+ /* Title */
+ "Test TEE_CloseAndDeletePersistentObject",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6007, xtest_tee_test_6007,
+ /* Title */
+ "Test TEE_TruncateObjectData",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6008, xtest_tee_test_6008,
+ /* Title */
+ "Test TEE_RenamePersistentObject",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
+
+ADBG_CASE_DEFINE(
+ XTEST_TEE_6009, xtest_tee_test_6009,
+ /* Title */
+ "Test TEE Internal API Persistent Object Enumeration Functions",
+ /* Short description */
+ "Short description ...",
+ /* Requirement IDs */
+ "TEE-??",
+ /* How to implement */
+ "Description of how to implement ..."
+ );
diff --git a/host/xtest/xtest_7000.c b/host/xtest/xtest_7000.c
new file mode 100644
index 0000000..210c55d
--- /dev/null
+++ b/host/xtest/xtest_7000.c
@@ -0,0 +1,529 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+#include "tee_internal_api.h"
+#include "tee_api_defines.h"
+#include "tee_client_api.h"
+#include "xml_client_api.h"
+
+static bool xtest_init = false;
+
+static bool xtest_tee_init(ADBG_Case_t *c)
+{
+ if (xtest_init)
+ return true;
+
+ SHARE_MEM01 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM01))
+ goto exit;
+
+ SHARE_MEM02 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM02))
+ goto exit;
+
+ SESSION01 = malloc(sizeof(TEEC_Session));
+ if (!ADBG_EXPECT_NOT_NULL(c, SESSION01))
+ goto exit;
+
+ CONTEXT01 = malloc(sizeof(TEEC_Context));
+ if (!ADBG_EXPECT_NOT_NULL(c, CONTEXT01))
+ goto exit;
+
+ OPERATION01 = malloc(sizeof(TEEC_Operation));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION01))
+ goto exit;
+
+ OPERATION02 = malloc(sizeof(TEEC_Operation));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION02))
+ goto exit;
+
+ xtest_init = true;
+
+ return xtest_init;
+
+exit:
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+ if (OPERATION02) {
+ free(OPERATION02);
+ OPERATION02 = NULL;
+ }
+
+ xtest_init = false;
+ return xtest_init;
+}
+
+/*29-84-6d*/
+static void xtest_tee_7001(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_SUCCESS,
+ AllocateSharedMemory(CONTEXT01, SHARE_MEM01, SIZE_VALUE01,
+ TEEC_MEM_INPUT));
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-c2-4c*/
+static void xtest_tee_7002(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_ERROR_OUT_OF_MEMORY,
+ AllocateSharedMemory(CONTEXT01, SHARE_MEM01,
+ SIZE_OVER_MEMORY, TEEC_MEM_INPUT));
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-b0-da*/
+static void xtest_tee_7003(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_SUCCESS,
+ AllocateSharedMemory(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEM_OUTPUT));
+ TEEC_ReleaseSharedMemory(NULL);
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-1c-00*/
+static void xtest_tee_7004(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_SUCCESS,
+ AllocateSharedMemory(CONTEXT01, SHARE_MEM01, SIZE_VALUE01,
+ TEEC_MEM_INOUT));
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-9f-a2*/
+static void xtest_tee_7005(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_SUCCESS,
+ RegisterSharedMemory(CONTEXT01, SHARE_MEM01, SIZE_VALUE01,
+ TEEC_MEM_INPUT));
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-11-02*/
+static void xtest_tee_7006(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_SUCCESS,
+ RegisterSharedMemory(CONTEXT01, SHARE_MEM01, SIZE_VALUE01,
+ TEEC_MEM_OUTPUT));
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-1f-a2*/
+static void xtest_tee_7007(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_SUCCESS,
+ RegisterSharedMemory(CONTEXT01, SHARE_MEM01, BIG_SIZE,
+ TEEC_MEM_INOUT));
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-2e-8d*/
+static void xtest_tee_7008(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_SUCCESS,
+ RegisterSharedMemory(CONTEXT01, SHARE_MEM01, ZERO,
+ TEEC_MEM_OUTPUT));
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-2b-3f*/
+static void xtest_tee_7009(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ XML_OpenSession(c, CONTEXT01, SESSION01, &UUID_Unknown,
+ TEEC_LOGIN_PUBLIC, NULL, NULL,
+ TEEC_ORIGIN_ANY_NOT_TRUSTED_APP, TEEC_UNDEFINED_ERROR);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-cd-39*/
+static void xtest_tee_7010(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ ADBG_EXPECT(c, TEEC_SUCCESS,
+ AllocateSharedMemory(CONTEXT01, SHARE_MEM01, ZERO,
+ TEEC_MEM_OUTPUT));
+ TEEC_ReleaseSharedMemory(SHARE_MEM01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-f0-9c*/
+static void xtest_tee_7011(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ XML_OpenSession(c, CONTEXT01, SESSION01,
+ &UUID_TTA_answerSuccessTo_OpenSession_Invoke,
+ TEEC_LOGIN_PUBLIC, NULL, NULL, 0, TEEC_SUCCESS);
+ TEEC_CloseSession(SESSION01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-4d-b0*/
+static void xtest_tee_7012(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ XML_OpenSession(c, CONTEXT01, SESSION01,
+ &UUID_TTA_answerErrorTo_OpenSession, TEEC_LOGIN_PUBLIC,
+ NULL, NULL, TEEC_ORIGIN_TRUSTED_APP,
+ TEEC_ERROR_GENERIC);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-a2-e3*/
+static void xtest_tee_7013(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ XML_OpenSession(c, CONTEXT01, SESSION01,
+ &UUID_TTA_answerSuccessTo_OpenSession_Invoke,
+ INVALID_CONNECTION_METHODS, NULL, NULL,
+ TEEC_ORIGIN_ANY_NOT_TRUSTED_APP, TEEC_UNDEFINED_ERROR);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-5d-d8*/
+static void xtest_tee_7014(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ OPERATION_TEEC_PARAM_TYPES(OPERATION01, TEEC_VALUE_INPUT,
+ TEEC_VALUE_INPUT, TEEC_VALUE_INPUT,
+ TEEC_VALUE_INPUT);
+
+ TEEC_prepare_OperationEachParameter_value(OPERATION01, 0, VALUE01,
+ IGNORE);
+ TEEC_prepare_OperationEachParameter_value(OPERATION01, 1, IGNORE,
+ VALUE01);
+ TEEC_prepare_OperationEachParameter_value(OPERATION01, 2, VALUE01,
+ VALUE01);
+ TEEC_prepare_OperationEachParameter_value(OPERATION01, 3, VALUE01,
+ VALUE02);
+
+ XML_OpenSession(c, CONTEXT01, SESSION01,
+ &UUID_TTA_check_OpenSession_with_4_parameters,
+ TEEC_LOGIN_PUBLIC, NULL, OPERATION01, 0,
+ TEEC_SUCCESS);
+ TEEC_CloseSession(SESSION01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-82-81*/
+static void xtest_tee_7015(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ XML_OpenSession(c, CONTEXT01, SESSION01,
+ &UUID_TTA_answerSuccessTo_OpenSession_Invoke,
+ TEEC_LOGIN_PUBLIC, NULL, NULL, TEEC_ORIGIN_TRUSTED_APP,
+ TEEC_SUCCESS);
+ TEEC_CloseSession(SESSION01);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+/*29-db-48*/
+static void xtest_tee_7016(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ TEEC_CloseSession(NULL);
+}
+
+/*29-a1-83*/
+static void xtest_tee_7017(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, INVALID_NOT_EXISTING_TEE, CONTEXT01,
+ TEEC_UNDEFINED_ERROR);
+}
+
+/*29-c1-a5*/
+static void xtest_tee_7018(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ TEEC_FinalizeContext(NULL);
+}
+
+/*29-91-aa*/
+static void xtest_tee_7019(ADBG_Case_t *c)
+{
+ if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return;
+ TEEC_createThread(CLIENT_APP01, THREAD02);
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ XML_InitializeContext(c, _device, CONTEXT01, TEEC_SUCCESS);
+ TEEC_SelectApp(CLIENT_APP01, THREAD02);
+ thr2_ctx.c = c;
+ thr2_ctx.ctx = CONTEXT01;
+ ctx_init_finalize(thr2_ctx);
+ TEEC_SelectApp(CLIENT_APP01, THREAD01_DEFAULT);
+ TEEC_FinalizeContext(CONTEXT01);
+}
+
+ADBG_CASE_DEFINE(XTEST_TEE_7001, xtest_tee_7001,
+ /* Title */
+ "29-84-6d",
+ /* Short description */
+ "Allocate_In",
+ /* Requirement IDs */
+ "RELEASE_SHARED_MEMORY_WHEN_ALLOCATED",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7002, xtest_tee_7002,
+ /* Title */
+ "29-c2-4c",
+ /* Short description */
+ "Allocate_out_of_memory",
+ /* Requirement IDs */
+ "INITIALIZE_CONTEXT_NAMES",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7003, xtest_tee_7003,
+ /* Title */
+ "29-b0-da",
+ /* Short description */
+ "ReleaseSharedMemory_null",
+ /* Requirement IDs */
+ "RELEASE_SHARED_MEMORY_WHEN_ALLOCATED",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7004, xtest_tee_7004,
+ /* Title */
+ "29-1c-00",
+ /* Short description */
+ "Allocate_InOut",
+ /* Requirement IDs */
+ "RELEASE_SHARED_MEMORY_WHEN_ALLOCATED",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7005, xtest_tee_7005,
+ /* Title */
+ "29-9f-a2",
+ /* Short description */
+ "Register_In",
+ /* Requirement IDs */
+ "RELEASE_SHARED_MEMORY_WHEN_REGISTERED",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7006, xtest_tee_7006,
+ /* Title */
+ "29-11-02",
+ /* Short description */
+ "Register_notZeroLength_Out",
+ /* Requirement IDs */
+ "RELEASE_SHARED_MEMORY_WHEN_REGISTERED",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7007, xtest_tee_7007,
+ /* Title */
+ "29-1f-a2",
+ /* Short description */
+ "Register_InOut",
+ /* Requirement IDs */
+ "RELEASE_SHARED_MEMORY_WHEN_REGISTERED",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7008, xtest_tee_7008,
+ /* Title */
+ "29-2e-8d",
+ /* Short description */
+ "Register_zeroLength_Out",
+ /* Requirement IDs */
+ "RELEASE_SHARED_MEMORY_WHEN_REGISTERED",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7009, xtest_tee_7009,
+ /* Title */
+ "29-2b-3f",
+ /* Short description */
+ "OpenSession_error_notExistingTA",
+ /* Requirement IDs */
+ "OPEN_SESSION_TARGET_TRUSTED_APP",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7010, xtest_tee_7010,
+ /* Title */
+ "29-cd-39",
+ /* Short description */
+ "Allocate_Out",
+ /* Requirement IDs */
+ "RELEASE_SHARED_MEMORY_WHEN_ALLOCATED",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7011, xtest_tee_7011,
+ /* Title */
+ "29-f0-9c",
+ /* Short description */
+ "OpenSession_success_nullReturnOrigin",
+ /* Requirement IDs */
+ "OPEN_SESSION_TARGET_TRUSTED_APP",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7012, xtest_tee_7012,
+ /* Title */
+ "29-4d-b0",
+ /* Short description */
+ "OpenSession_error_originTrustedApp",
+ /* Requirement IDs */
+ "OPEN_SESSION_TARGET_TRUSTED_APP",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7013, xtest_tee_7013,
+ /* Title */
+ "29-a2-e3",
+ /* Short description */
+ "OpenSession_error_originTEE",
+ /* Requirement IDs */
+ "OPEN_SESSION_TARGET_TRUSTED_APP",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7014, xtest_tee_7014,
+ /* Title */
+ "29-5d-d8",
+ /* Short description */
+ "OpenSession_with_operation_parameters",
+ /* Requirement IDs */
+ "OPEN_SESSION_TARGET_TRUSTED_APP",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7015, xtest_tee_7015,
+ /* Title */
+ "29-82-81",
+ /* Short description */
+ "OpenSession_success_originTrustedApp",
+ /* Requirement IDs */
+ "OPEN_SESSION_TARGET_TRUSTED_APP",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7016, xtest_tee_7016,
+ /* Title */
+ "29-db-48",
+ /* Short description */
+ "CloseSession_null",
+ /* Requirement IDs */
+ "CLOSE_SESSION_IGNORE_SESSION_NULL",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7017, xtest_tee_7017,
+ /* Title */
+ "29-a1-83",
+ /* Short description */
+ "InitializeContext_NotExistingTEE",
+ /* Requirement IDs */
+ "INITIALIZE_CONTEXT_NAMES",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7018, xtest_tee_7018,
+ /* Title */
+ "29-c1-a5",
+ /* Short description */
+ "FinalizeContext_null",
+ /* Requirement IDs */
+ "FINALIZE_CONTEXT_IGNORE_NULL",
+ /* How to implement */
+ "Description of how to implement ...");
+ADBG_CASE_DEFINE(XTEST_TEE_7019, xtest_tee_7019,
+ /* Title */
+ "29-91-aa",
+ /* Short description */
+ "InitializeContext_concurrentContext",
+ /* Requirement IDs */
+ "INITIALIZE_CONTEXT_NAMES",
+ /* How to implement */
+ "Description of how to implement ...");
diff --git a/host/xtest/xtest_helpers.c b/host/xtest/xtest_helpers.c
new file mode 100644
index 0000000..51b1c19
--- /dev/null
+++ b/host/xtest/xtest_helpers.c
@@ -0,0 +1,374 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include "xtest_helpers.h"
+#include "xtest_test.h"
+
+#include <ta_crypt.h>
+#include <utee_defines.h>
+
+#include <string.h>
+#include <stdio.h>
+#include <malloc.h>
+#include <assert.h>
+
+/* Round up the even multiple of size, size has to be a multiple of 2 */
+#define ROUNDUP(v, size) (((v) + (size - 1)) & ~(size - 1))
+
+TEEC_Context xtest_teec_ctx;
+
+TEEC_Result xtest_teec_ctx_init(void)
+{
+ return TEEC_InitializeContext(_device, &xtest_teec_ctx);
+}
+
+TEEC_Result xtest_teec_open_session(TEEC_Session *session,
+ const TEEC_UUID *uuid, TEEC_Operation *op,
+ uint32_t *ret_orig)
+{
+ return TEEC_OpenSession(&xtest_teec_ctx, session, uuid,
+ TEEC_LOGIN_PUBLIC, NULL, op, ret_orig);
+}
+
+void xtest_teec_ctx_deinit(void)
+{
+ TEEC_FinalizeContext(&xtest_teec_ctx);
+}
+
+TEEC_Result ta_crypt_cmd_allocate_operation(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle *oph,
+ uint32_t algo, uint32_t mode,
+ uint32_t max_key_size)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = 0;
+ op.params[0].value.b = algo;
+ op.params[1].value.a = mode;
+ op.params[1].value.b = max_key_size;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INOUT, TEEC_VALUE_INPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_ALLOCATE_OPERATION, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *oph = (TEE_OperationHandle)(uintptr_t)op.params[0].value.a;
+
+ return res;
+}
+
+TEEC_Result ta_crypt_cmd_allocate_transient_object(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectType obj_type,
+ uint32_t max_obj_size,
+ TEE_ObjectHandle *o)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = obj_type;
+ op.params[0].value.b = max_obj_size;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_VALUE_OUTPUT,
+ TEEC_NONE, TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_ALLOCATE_TRANSIENT_OBJECT, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *o = (TEE_ObjectHandle)(uintptr_t)op.params[1].value.a;
+
+ return res;
+}
+
+void xtest_add_attr(size_t *attr_count, TEE_Attribute *attrs, uint32_t attr_id,
+ const void *buf, size_t len)
+{
+ attrs[*attr_count].attributeID = attr_id;
+ attrs[*attr_count].content.ref.buffer = (void *)buf;
+ attrs[*attr_count].content.ref.length = len;
+ (*attr_count)++;
+}
+
+struct tee_attr_packed {
+ uint32_t attr_id;
+ uint32_t a;
+ uint32_t b;
+};
+
+TEE_Result pack_attrs(const TEE_Attribute *attrs, uint32_t attr_count,
+ uint8_t **buf, size_t *blen)
+{
+ struct tee_attr_packed *a;
+ uint8_t *b;
+ size_t bl;
+ size_t n;
+
+ *buf = NULL;
+ *blen = 0;
+ if (attr_count == 0)
+ return TEE_SUCCESS;
+
+ bl = sizeof(uint32_t) + sizeof(struct tee_attr_packed) * attr_count;
+ for (n = 0; n < attr_count; n++) {
+ if ((attrs[n].attributeID & TEE_ATTR_BIT_VALUE) != 0)
+ continue; /* Only memrefs need to be updated */
+
+ if (!attrs[n].content.ref.buffer)
+ continue;
+
+ /* Make room for padding */
+ bl += ROUNDUP(attrs[n].content.ref.length, 4);
+ }
+
+ b = calloc(1, bl);
+ if (!b)
+ return TEE_ERROR_OUT_OF_MEMORY;
+
+ *buf = b;
+ *blen = bl;
+
+ *(uint32_t *)(void *)b = attr_count;
+ b += sizeof(uint32_t);
+ a = (struct tee_attr_packed *)(void *)b;
+ b += sizeof(struct tee_attr_packed) * attr_count;
+
+ for (n = 0; n < attr_count; n++) {
+ a[n].attr_id = attrs[n].attributeID;
+ if (attrs[n].attributeID & TEE_ATTR_BIT_VALUE) {
+ a[n].a = attrs[n].content.value.a;
+ a[n].b = attrs[n].content.value.b;
+ continue;
+ }
+
+ a[n].b = attrs[n].content.ref.length;
+
+ if (!attrs[n].content.ref.buffer) {
+ a[n].a = 0;
+ continue;
+ }
+
+ memcpy(b, attrs[n].content.ref.buffer,
+ attrs[n].content.ref.length);
+
+ /* Make buffer pointer relative to *buf */
+ a[n].a = (uint32_t)(uintptr_t)(b - *buf);
+
+ /* Round up to good alignment */
+ b += ROUNDUP(attrs[n].content.ref.length, 4);
+ }
+
+ return TEE_SUCCESS;
+}
+
+TEEC_Result ta_crypt_cmd_populate_transient_object(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectHandle o,
+ const TEE_Attribute *attrs,
+ uint32_t attr_count)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ uint8_t *buf;
+ size_t blen;
+
+ res = pack_attrs(attrs, attr_count, &buf, &blen);
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, res))
+ return res;
+
+ assert((uintptr_t)o <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)o;
+
+ op.params[1].tmpref.buffer = buf;
+ op.params[1].tmpref.size = blen;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_POPULATE_TRANSIENT_OBJECT, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ free(buf);
+ return res;
+}
+
+TEE_Result ta_crypt_cmd_set_operation_key(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph,
+ TEE_ObjectHandle key)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ assert((uintptr_t)key <= UINT32_MAX);
+ op.params[0].value.b = (uint32_t)(uintptr_t)key;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_SET_OPERATION_KEY, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
+
+TEEC_Result ta_crypt_cmd_free_transient_object(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_ObjectHandle o)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)o <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)o;
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_FREE_TRANSIENT_OBJECT, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
+
+TEEC_Result ta_crypt_cmd_derive_key(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph, TEE_ObjectHandle o,
+ const TEE_Attribute *params,
+ uint32_t paramCount)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+ uint8_t *buf;
+ size_t blen;
+
+ res = pack_attrs(params, paramCount, &buf, &blen);
+
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, res))
+ return res;
+
+ assert((uintptr_t)oph <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ assert((uintptr_t)o <= UINT32_MAX);
+ op.params[0].value.b = (uint32_t)(uintptr_t)o;
+
+ op.params[1].tmpref.buffer = buf;
+ op.params[1].tmpref.size = blen;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_DERIVE_KEY, &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ free(buf);
+ return res;
+}
+
+TEEC_Result ta_crypt_cmd_get_object_buffer_attribute(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectHandle o,
+ uint32_t attr_id,
+ void *buf, size_t *blen)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ assert((uintptr_t)o <= UINT32_MAX);
+ op.params[0].value.a = (uint32_t)(uintptr_t)o;
+ op.params[0].value.b = attr_id;
+
+ op.params[1].tmpref.buffer = buf;
+ op.params[1].tmpref.size = *blen;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
+ TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_GET_OBJECT_BUFFER_ATTRIBUTE,
+ &op, &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ if (res == TEEC_SUCCESS)
+ *blen = op.params[1].tmpref.size;
+
+ return res;
+}
+
+TEEC_Result ta_crypt_cmd_free_operation(ADBG_Case_t *c, TEEC_Session *s,
+ TEE_OperationHandle oph)
+{
+ TEEC_Result res;
+ TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
+ uint32_t ret_orig;
+
+ op.params[0].value.a = (uint32_t)(uintptr_t)oph;
+
+ op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
+ TEEC_NONE);
+
+ res = TEEC_InvokeCommand(s, TA_CRYPT_CMD_FREE_OPERATION, &op,
+ &ret_orig);
+
+ if (res != TEEC_SUCCESS) {
+ (void)ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
+ ret_orig);
+ }
+
+ return res;
+}
diff --git a/host/xtest/xtest_helpers.h b/host/xtest/xtest_helpers.h
new file mode 100644
index 0000000..53c2d71
--- /dev/null
+++ b/host/xtest/xtest_helpers.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef XTEST_HELPERS_H
+#define XTEST_HELPERS_H
+
+#include <tee_client_api.h>
+#include <tee_api_types.h>
+#include <adbg.h>
+
+/* Global context to use if any context is needed as input to a function */
+extern TEEC_Context xtest_teec_ctx;
+
+/*
+ * Initializes the context above, should be called before the ADBG test
+ * cases are run.
+ */
+TEEC_Result xtest_teec_ctx_init(void);
+void xtest_teec_ctx_deinit(void);
+
+/* Opens a session */
+TEEC_Result xtest_teec_open_session(TEEC_Session *session,
+ const TEEC_UUID *uuid, TEEC_Operation *op,
+ uint32_t *ret_orig);
+
+TEEC_Result xtest_teec_open_static_session(TEEC_Session *session,
+ TEEC_Operation *op,
+ uint32_t *ret_orig);
+
+#define TEEC_OPERATION_INITIALIZER { 0, 0, { { { 0 } } } }
+
+/* IO access macro */
+#define IO(addr) (*((volatile unsigned long *)(addr)))
+
+/*
+ * Helpers for commands towards the crypt TA
+ */
+TEEC_Result ta_crypt_cmd_allocate_operation(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle *oph,
+ uint32_t algo,
+ uint32_t mode,
+ uint32_t max_key_size);
+
+TEEC_Result ta_crypt_cmd_allocate_transient_object(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectType obj_type, uint32_t max_obj_size,
+ TEE_ObjectHandle *o);
+
+TEEC_Result ta_crypt_cmd_populate_transient_object(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectHandle o,
+ const TEE_Attribute *attrs,
+ uint32_t attr_count);
+
+TEE_Result ta_crypt_cmd_set_operation_key(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ TEE_ObjectHandle key);
+
+TEEC_Result ta_crypt_cmd_free_transient_object(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectHandle o);
+
+TEEC_Result ta_crypt_cmd_derive_key(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph,
+ TEE_ObjectHandle o,
+ const TEE_Attribute *params,
+ uint32_t paramCount);
+
+TEEC_Result ta_crypt_cmd_get_object_buffer_attribute(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_ObjectHandle o,
+ uint32_t attr_id,
+ void *buf,
+ size_t *blen);
+
+TEEC_Result ta_crypt_cmd_free_operation(ADBG_Case_t *c,
+ TEEC_Session *s,
+ TEE_OperationHandle oph);
+
+void xtest_add_attr(size_t *attr_count, TEE_Attribute *attrs,
+ uint32_t attr_id, const void *buf, size_t len);
+
+TEE_Result pack_attrs(const TEE_Attribute *attrs, uint32_t attr_count,
+ uint8_t **buf, size_t *blen);
+
+#endif /*XTEST_HELPERS_H*/
diff --git a/host/xtest/xtest_main.c b/host/xtest/xtest_main.c
new file mode 100644
index 0000000..73e55e2
--- /dev/null
+++ b/host/xtest/xtest_main.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <adbg.h>
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+#include "adbg_entry_declare.h"
+
+ADBG_SUITE_DECLARE(XTEST_TEE_TEST)
+
+/*ADBG Suite definition.*/
+ADBG_SUITE_DEFINE_BEGIN(XTEST_TEE_TEST, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1001, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1004, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1005, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1006, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1007, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1008, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1009, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1010, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1011, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_1012, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4001, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4002, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4003_NO_XTS, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4003_XTS, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4004, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4005, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4006, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4007, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_4008, NULL)
+/* FVP ADBG_SUITE_ENTRY(XTEST_TEE_5006, NULL) */
+#ifdef USER_SPACE
+ADBG_SUITE_ENTRY(XTEST_TEE_6001, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_6002, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_6003, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_6004, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_6005, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_6006, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_6007, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_6008, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_6009, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7001, NULL)
+/* FVP ADBG_SUITE_ENTRY(XTEST_TEE_7002, NULL) */
+ADBG_SUITE_ENTRY(XTEST_TEE_7003, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7004, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7005, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7006, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7007, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7008, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7009, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7010, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7013, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7016, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7017, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7018, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_7019, NULL)
+#ifdef XTEST_WITH_GP_TESTS
+ADBG_ENTRY_AUTO_GENERATED_TESTS()
+#else
+#endif
+#endif /*USER_SPACE*/
+ADBG_SUITE_ENTRY(XTEST_TEE_10001, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_10002, NULL)
+ADBG_SUITE_ENTRY(XTEST_TEE_10003, NULL)
+ADBG_SUITE_DEFINE_END()
+
+static const char gdevname_tz[] = "opteearmtz00";
+char *_device = (char *)gdevname_tz;
+
+int main(int argc, char *argv[])
+{
+ argv++;
+ argc--;
+
+ if (argc >= 1) {
+ if (strcmp(argv[0], gdevname_tz) == 0) {
+ _device = argv[0];
+ argv++;
+ argc--;
+ }
+ }
+ printf("\nTEE test application started with device [%s]\n", _device);
+
+ xtest_teec_ctx_init();
+
+ int ret = Do_ADBG_RunSuite(&ADBG_Suite_XTEST_TEE_TEST, argc, argv);
+
+ xtest_teec_ctx_deinit();
+
+ printf("TEE test application done!\n");
+ return ret;
+}
diff --git a/host/xtest/xtest_test.c b/host/xtest/xtest_test.c
new file mode 100644
index 0000000..8fae19b
--- /dev/null
+++ b/host/xtest/xtest_test.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#include "xtest_test.h"
+#include <tee_client_api.h>
+#include <ta_create_fail_test.h>
+#include <ta_crypt.h>
+#include <ta_os_test.h>
+#include <ta_rpc_test.h>
+#include <ta_sims_test.h>
+#include <ta_storage.h>
+#include <enc_fs_key_manager_test.h>
+#include <tee_api_defines.h>
+
+ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_Result)
+ADBG_ENUM_TABLE_ENTRY(TEEC_SUCCESS),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_CORRUPT_OBJECT),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_CORRUPT_OBJECT_2),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NOT_AVAILABLE),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NOT_AVAILABLE_2),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_GENERIC),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ACCESS_DENIED),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_CANCEL),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ACCESS_CONFLICT),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_EXCESS_DATA),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_FORMAT),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_PARAMETERS),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_STATE),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ITEM_NOT_FOUND),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NOT_IMPLEMENTED),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NOT_SUPPORTED),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NO_DATA),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_OUT_OF_MEMORY),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BUSY),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_COMMUNICATION),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_SECURITY),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_SHORT_BUFFER),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_EXTERNAL_CANCEL),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_OVERFLOW),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TARGET_DEAD),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NO_SPACE),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_MAC_INVALID),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_SIGNATURE_INVALID),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TIME_NOT_SET),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TIME_NEEDS_RESET)
+ADBG_ENUM_TABLE_DEFINE_END(TEEC_Result);
+
+ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_ErrorOrigin)
+ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_API),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_COMMS),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_TEE),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_TRUSTED_APP)
+ADBG_ENUM_TABLE_DEFINE_END(TEEC_ErrorOrigin);
+
+#define ECC_SELF_TEST_UUID \
+ { 0xf34f4f3c, 0xab30, 0x4573, \
+ { 0x91, 0xBF, 0x3C, 0x57, 0x02, 0x4D, 0x51, 0x99 } }
+
+const TEEC_UUID crypt_user_ta_uuid = TA_CRYPT_UUID;
+const TEEC_UUID os_test_ta_uuid = TA_OS_TEST_UUID;
+const TEEC_UUID create_fail_test_ta_uuid = TA_CREATE_FAIL_TEST_UUID;
+const TEEC_UUID ecc_test_ta_uuid = ECC_SELF_TEST_UUID;
+const TEEC_UUID rpc_test_ta_uuid = TA_RPC_TEST_UUID;
+const TEEC_UUID sims_test_ta_uuid = TA_SIMS_TEST_UUID;
+const TEEC_UUID storage_ta_uuid = TA_STORAGE_UUID;
+const TEEC_UUID enc_fs_key_manager_test_ta_uuid = ENC_FS_KEY_MANAGER_TEST_UUID;
+
diff --git a/host/xtest/xtest_test.h b/host/xtest/xtest_test.h
new file mode 100644
index 0000000..0bad613
--- /dev/null
+++ b/host/xtest/xtest_test.h
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ */
+
+#ifndef XTEST_TEST_H
+#define XTEST_TEST_H
+#include <adbg.h>
+#include <tee_client_api.h>
+#include "adbg_case_declare.h"
+
+/*ADBG Cases declaration.*/
+ADBG_CASE_DECLARE(XTEST_TEE_1001);
+ADBG_CASE_DECLARE(XTEST_TEE_1004);
+ADBG_CASE_DECLARE(XTEST_TEE_1005);
+ADBG_CASE_DECLARE(XTEST_TEE_1006);
+ADBG_CASE_DECLARE(XTEST_TEE_1007);
+ADBG_CASE_DECLARE(XTEST_TEE_1008);
+ADBG_CASE_DECLARE(XTEST_TEE_1009);
+ADBG_CASE_DECLARE(XTEST_TEE_1010);
+ADBG_CASE_DECLARE(XTEST_TEE_1011);
+ADBG_CASE_DECLARE(XTEST_TEE_1012);
+
+ADBG_CASE_DECLARE(XTEST_TEE_2001);
+ADBG_CASE_DECLARE(XTEST_TEE_2002);
+
+ADBG_CASE_DECLARE(XTEST_TEE_4001);
+ADBG_CASE_DECLARE(XTEST_TEE_4002);
+ADBG_CASE_DECLARE(XTEST_TEE_4003_NO_XTS);
+ADBG_CASE_DECLARE(XTEST_TEE_4003_XTS);
+ADBG_CASE_DECLARE(XTEST_TEE_4004);
+ADBG_CASE_DECLARE(XTEST_TEE_4005);
+ADBG_CASE_DECLARE(XTEST_TEE_4006);
+ADBG_CASE_DECLARE(XTEST_TEE_4007);
+ADBG_CASE_DECLARE(XTEST_TEE_4008);
+
+ADBG_CASE_DECLARE(XTEST_TEE_5006);
+
+ADBG_CASE_DECLARE(XTEST_TEE_6001);
+ADBG_CASE_DECLARE(XTEST_TEE_6002);
+ADBG_CASE_DECLARE(XTEST_TEE_6003);
+ADBG_CASE_DECLARE(XTEST_TEE_6004);
+ADBG_CASE_DECLARE(XTEST_TEE_6005);
+ADBG_CASE_DECLARE(XTEST_TEE_6006);
+ADBG_CASE_DECLARE(XTEST_TEE_6007);
+ADBG_CASE_DECLARE(XTEST_TEE_6008);
+ADBG_CASE_DECLARE(XTEST_TEE_6009);
+ADBG_CASE_DECLARE(XTEST_TEE_7001);
+ADBG_CASE_DECLARE(XTEST_TEE_7002);
+ADBG_CASE_DECLARE(XTEST_TEE_7003);
+ADBG_CASE_DECLARE(XTEST_TEE_7004);
+ADBG_CASE_DECLARE(XTEST_TEE_7005);
+ADBG_CASE_DECLARE(XTEST_TEE_7006);
+ADBG_CASE_DECLARE(XTEST_TEE_7007);
+ADBG_CASE_DECLARE(XTEST_TEE_7008);
+ADBG_CASE_DECLARE(XTEST_TEE_7009);
+ADBG_CASE_DECLARE(XTEST_TEE_7010);
+ADBG_CASE_DECLARE(XTEST_TEE_7013);
+ADBG_CASE_DECLARE(XTEST_TEE_7016);
+ADBG_CASE_DECLARE(XTEST_TEE_7017);
+ADBG_CASE_DECLARE(XTEST_TEE_7018);
+ADBG_CASE_DECLARE(XTEST_TEE_7019);
+
+ADBG_CASE_DECLARE(XTEST_TEE_10001);
+ADBG_CASE_DECLARE(XTEST_TEE_10002);
+ADBG_CASE_DECLARE(XTEST_TEE_10003);
+
+ADBG_CASE_DECLARE_AUTO_GENERATED_TESTS()
+
+/* TEEC_Result */
+ADBG_ENUM_TABLE_DECLARE(TEEC_Result);
+
+#define ADBG_EXPECT_TEEC_RESULT(c, exp, got) \
+ ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_TEEC_Result)
+
+#define ADBG_EXPECT_TEEC_SUCCESS(c, got) \
+ ADBG_EXPECT_ENUM(c, TEEC_SUCCESS, got, ADBG_EnumTable_TEEC_Result)
+
+/* TEEC_ErrorOrigin */
+ADBG_ENUM_TABLE_DECLARE(TEEC_ErrorOrigin);
+
+#define ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, exp, got) \
+ ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_TEEC_ErrorOrigin)
+
+/* bass_return_code */
+ADBG_ENUM_TABLE_DECLARE(bass_return_code);
+
+#define ADBG_EXPECT_BASS_RETURN_CODE(c, exp, got) \
+ ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_bass_return_code)
+
+#define ADBG_EXPECT_BASS_RC_SUCCESS(c, got) \
+ ADBG_EXPECT_ENUM(c, BASS_RC_SUCCESS, got, \
+ ADBG_EnumTable_bass_return_code)
+
+
+extern const char crypt_user_ta[];
+extern const unsigned int crypt_user_ta_size;
+
+extern const char os_test_ta[];
+extern const unsigned int os_test_ta_size;
+
+extern const char create_fail_test_ta[];
+extern const unsigned int create_fail_test_ta_size;
+
+extern const char rpc_test_ta[];
+extern const unsigned int rpc_test_ta_size;
+
+extern const char sims_test_ta[];
+extern const unsigned int sims_test_ta_size;
+
+extern const char gp_tta_testing_client_api_ta[];
+extern const unsigned int gp_tta_testing_client_api_ta_size;
+
+extern const char gp_tta_answer_success_to_open_session_invoke_ta[];
+extern const unsigned int gp_tta_answer_success_to_open_session_invoke_ta_size;
+
+extern const char gp_tta_answer_error_to_invoke_ta[];
+extern const unsigned int gp_tta_answer_error_to_invoke_ta_size;
+
+extern const char gp_tta_answer_error_to_open_session_ta[];
+extern const unsigned int gp_tta_answer_error_to_open_session_ta_size;
+
+extern const char gp_tta_check_open_session_with_4_parameters_ta[];
+extern const unsigned int gp_tta_check_open_session_with_4_parameters_ta_size;
+
+extern const char gp_tta_ds_ta[];
+extern const unsigned int gp_tta_ds_ta_size;
+
+extern const char storage_ta[];
+extern const unsigned int storage_ta_size;
+
+extern const char gp_tta_time_ta[];
+extern const unsigned int gp_tta_time_ta_size;
+
+extern const char gp_tta_tcf_ta[];
+extern const unsigned int gp_tta_tcf_ta_size;
+
+extern const char gp_tta_crypto_ta[];
+extern const unsigned int gp_tta_crypto_ta_size;
+
+extern const char gp_tta_arithm_ta[];
+extern const unsigned int gp_tta_arithm_ta_size;
+
+extern const char gp_tta_ica_ta[];
+extern const unsigned int gp_tta_ica_ta_size;
+
+extern const char gp_tta_ica2_ta[];
+extern const unsigned int gp_tta_ica2_ta_size;
+
+extern const char gp_tta_tcf_singleinstance_ta[];
+extern const unsigned int gp_tta_tcf_singleinstance_ta_size;
+
+extern const char gp_tta_tcf_multipleinstance_ta[];
+extern const unsigned int gp_tta_tcf_multipleinstance_ta_size;
+
+extern const TEEC_UUID crypt_user_ta_uuid;
+extern const TEEC_UUID os_test_ta_uuid;
+extern const TEEC_UUID create_fail_test_ta_uuid;
+extern const TEEC_UUID rpc_test_ta_uuid;
+extern const TEEC_UUID sims_test_ta_uuid;
+extern const TEEC_UUID gp_tta_testing_client_api_uuid;
+extern const TEEC_UUID gp_tta_answer_success_to_open_session_invoke_uuid;
+extern const TEEC_UUID gp_tta_answer_error_to_invoke_uuid;
+extern const TEEC_UUID gp_tta_answer_error_to_open_session_uuid;
+extern const TEEC_UUID gp_tta_check_OpenSession_with_4_parameters_uuid;
+extern const TEEC_UUID gp_tta_ds_uuid;
+extern const TEEC_UUID storage_ta_uuid;
+extern const TEEC_UUID enc_fs_key_manager_test_ta_uuid;
+extern const TEEC_UUID ecc_test_ta_uuid;
+extern const TEEC_UUID gp_tta_time_uuid;
+extern char *_device;
+
+#endif /*XTEST_TEST_H*/
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TEE_include/code_patches/v1_1_0_4-2014_11_07/tee_internal_api.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TEE_include/code_patches/v1_1_0_4-2014_11_07/tee_internal_api.h.patch
new file mode 100644
index 0000000..38fc858
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TEE_include/code_patches/v1_1_0_4-2014_11_07/tee_internal_api.h.patch
@@ -0,0 +1,41 @@
+--- tee_internal_api.h.orig 2012-09-21 14:05:02.000000000 +0200
++++ tee_internal_api.h 2015-04-03 12:42:57.296593142 +0200
+@@ -226,7 +226,6 @@
+ #define TEE_DATA_FLAG_ACCESS_WRITE_META 0x00000004
+ #define TEE_DATA_FLAG_SHARE_READ 0x00000010
+ #define TEE_DATA_FLAG_SHARE_WRITE 0x00000020
+-#define TEE_DATA_FLAG_CREATE 0x00000200
+ #define TEE_DATA_FLAG_EXCLUSIVE 0x00000400
+
+ /* Usage Constants */
+@@ -606,10 +605,10 @@
+ /******************************************************************************
+ Data Storage functions (27)
+ ******************************************************************************/
+-extern void TEE_GetObjectInfo(
++extern TEE_Result TEE_GetObjectInfo1(
+ TEE_ObjectHandle object,
+ TEE_ObjectInfo* objectInfo);
+-extern void TEE_RestrictObjectUsage(
++extern TEE_Result TEE_RestrictObjectUsage1(
+ TEE_ObjectHandle object,
+ uint32_t objectUsage);
+ extern TEE_Result TEE_GetObjectBufferAttribute(
+@@ -640,7 +639,7 @@
+ TEE_Attribute* attr,
+ uint32_t attributeID,
+ uint32_t a, uint32_t b);
+-extern void TEE_CopyObjectAttributes(
++extern TEE_Result TEE_CopyObjectAttributes1(
+ TEE_ObjectHandle destObject,
+ TEE_ObjectHandle srcObject);
+ extern TEE_Result TEE_GenerateKey(
+@@ -659,7 +658,7 @@
+ TEE_ObjectHandle attributes,
+ void* initialData, size_t initialDataLen,
+ TEE_ObjectHandle* object);
+-extern void TEE_CloseAndDeletePersistentObject(TEE_ObjectHandle object);
++extern TEE_Result TEE_CloseAndDeletePersistentObject1(TEE_ObjectHandle object);
+ extern TEE_Result TEE_RenamePersistentObject(
+ TEE_ObjectHandle object,
+ void* newObjectID, size_t newObjectIDLen);
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/Makefile
new file mode 100644
index 0000000..3322b79
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-4c53-41524954484d4554
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/sub.mk
new file mode 100644
index 0000000..72fba55
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_Arithmetical.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..d191b5d
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_files/user_ta_header_defines.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include <user_ta_header.h>
+
+#include "TTA_Arithmetical_protocol.h"
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE)
+#define TA_STACK_SIZE (2 * 1024)
+#define TA_DATA_SIZE (32 * 1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_Arithmetical 1.1" },
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_patches/v1_1_0_4-2014_11_07/TTA_Arithmetical.c.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_patches/v1_1_0_4-2014_11_07/TTA_Arithmetical.c.patch
new file mode 100644
index 0000000..f3cf6f8
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_patches/v1_1_0_4-2014_11_07/TTA_Arithmetical.c.patch
@@ -0,0 +1,11 @@
+--- TTA_Arithmetical.c.ori 2015-02-02 13:29:21.470683589 +0100
++++ TTA_Arithmetical.c 2015-02-02 13:29:27.390723092 +0100
+@@ -1374,7 +1374,7 @@
+
+ TEE_BigIntConvertFromS32(pBigInt, MAX_INT32_POSITIVE_VALUE);
+
+- return TEE_BigIntConvertToOctetString (&nSingleChar, &nSize, pBigInt);
++ return TEE_BigIntConvertToOctetString ((void *)&nSingleChar, &nSize, pBigInt);
+ }
+
+ /**
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_patches/v1_1_0_4-2014_11_07/TTA_Arithmetical_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_patches/v1_1_0_4-2014_11_07/TTA_Arithmetical_protocol.h.patch
new file mode 100644
index 0000000..0f752cd
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Arithmetical/code_patches/v1_1_0_4-2014_11_07/TTA_Arithmetical_protocol.h.patch
@@ -0,0 +1,21 @@
+--- TTA_Arithmetical_protocol.h.ori 2015-02-02 09:48:39.468950351 +0100
++++ TTA_Arithmetical_protocol.h 2015-02-03 13:23:56.514679306 +0100
+@@ -48,6 +48,18 @@
+ void* pSessionContext,
+ uint32_t nParamTypes,
+ TEE_Param pParams[4]);
++TEE_Result CmdTEEBigIntShiftRight(
++ void* pSessionContext,
++ uint32_t nParamTypes,
++ TEE_Param pParams[4]);
++TEE_Result CmdTEEBigIntBigIntGetBit(
++ void* pSessionContext,
++ uint32_t nParamTypes,
++ TEE_Param pParams[4]);
++TEE_Result CmdTEEBigIntBigIntGetBitCount(
++ void* pSessionContext,
++ uint32_t nParamTypes,
++ TEE_Param pParams[4]);
+ TEE_Result CmdTEEBigIntAdd(
+ void* pSessionContext,
+ uint32_t nParamTypes,
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/Makefile
new file mode 100644
index 0000000..2c79925
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-542d-4353-4c542d54412d4552
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/sub.mk
new file mode 100644
index 0000000..b0f90ef
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_answerErrorTo_Invoke.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/ta_answerErrorTo_Invoke_test.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/ta_answerErrorTo_Invoke_test.h
new file mode 100644
index 0000000..65a6b26
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/ta_answerErrorTo_Invoke_test.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define TA_TTA_ANSWERERRORTOINVOKE_UUID { \
+ 0x534D4152, \
+ 0x542D, \
+ 0x4353, \
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x45, 0x52 } \
+ }
+#define COMMAND_TTA_Remember_Expected_ParamTypes 0x00000002
+#define COMMAND_TTA_Copy_ParamIn_to_ParamOut 0x00000001
+#define COMMAND_TTA_Check_ParamTypes 0x00000003
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..87470de
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/user_ta_header_defines.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_answerErrorTo_Invoke_protocol.h"
+#define TA_UUID TA_TTA_ANSWERERRORTOINVOKE_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE \
+ | TA_FLAG_EXEC_DDR \
+ | TA_FLAG_SINGLE_INSTANCE \
+ )
+#define TA_STACK_SIZE (1*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_answerErrorTo_Invoke v0.4" },
+
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_patches/v1_1_0_4-2014_11_07/TTA_answerErrorTo_Invoke_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_patches/v1_1_0_4-2014_11_07/TTA_answerErrorTo_Invoke_protocol.h.patch
new file mode 100644
index 0000000..b1cf3e6
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_patches/v1_1_0_4-2014_11_07/TTA_answerErrorTo_Invoke_protocol.h.patch
@@ -0,0 +1,10 @@
+--- TTA_answerErrorTo_Invoke_protocol.h.ori 2015-02-02 14:40:43.531408959 +0100
++++ TTA_answerErrorTo_Invoke_protocol.h 2015-02-02 14:41:00.343522368 +0100
+@@ -1,6 +1,6 @@
+
+ /** Trusted Application Identifier **/
+-#define TA_UUID { 0x534D4152, 0x542D, 0x4353, { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x45, 0x52 } }
++#define TA_TTA_ANSWERERRORTOINVOKE_UUID { 0x534D4152, 0x542D, 0x4353, { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x45, 0x52 } }
+
+
+ #define TRUSTED_APP_ERROR_UNKNOWN_COMMAND 0x00000001
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/Makefile
new file mode 100644
index 0000000..2173145
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-54455252544f4f53
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/sub.mk
new file mode 100644
index 0000000..510999e
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_answerErrorTo_OpenSession.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/ta_answerErrorTo_OpenSession_test.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/ta_answerErrorTo_OpenSession_test.h
new file mode 100644
index 0000000..b4715ff
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/ta_answerErrorTo_OpenSession_test.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define TA_TTA_ANSWERERRORTOOPENSESSION_UUID { \
+ 0x534D4152, \
+ 0x5443, \
+ 0x534C, \
+ { 0x54, 0x45, 0x52, 0x52, 0x54, 0x4F, 0x4F, 0x53 } \
+ }
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..b221766
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/user_ta_header_defines.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_answerErrorTo_OpenSession_protocol.h"
+#define TA_UUID TA_TTA_ANSWERERRORTOOPENSESSION_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE \
+ | TA_FLAG_EXEC_DDR \
+ | TA_FLAG_SINGLE_INSTANCE \
+ )
+#define TA_STACK_SIZE (1*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_answerErrorTo_OpenSession v0.2" },
+
+#endif /* USER_TA_HEADER_DEFINES_H*/
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_patches/v1_1_0_4-2014_11_07/TTA_answerErrorTo_OpenSession_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_patches/v1_1_0_4-2014_11_07/TTA_answerErrorTo_OpenSession_protocol.h.patch
new file mode 100644
index 0000000..ce73536
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_patches/v1_1_0_4-2014_11_07/TTA_answerErrorTo_OpenSession_protocol.h.patch
@@ -0,0 +1,10 @@
+--- TTA_answerErrorTo_OpenSession_protocol.h.ori 2015-02-02 14:41:54.423887162 +0100
++++ TTA_answerErrorTo_OpenSession_protocol.h 2015-02-02 14:42:06.919971456 +0100
+@@ -1,6 +1,6 @@
+
+ /** Trusted Application Identifier **/
+-#define TA_UUID { 0x534D4152, 0x5443, 0x534C, { 0x54, 0x45, 0x52, 0x52, 0x54, 0x4F, 0x4F, 0x53 } }
++#define TA_TTA_ANSWERERRORTOOPENSESSION_UUID { 0x534D4152, 0x5443, 0x534C, { 0x54, 0x45, 0x52, 0x52, 0x54, 0x4F, 0x4F, 0x53 } }
+
+
+ #define TRUSTED_APP_ERROR_UNKNOWN_COMMAND 0x00000001
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/Makefile
new file mode 100644
index 0000000..d8f642c
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-542d-4353-4c542d54412d5355
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/sub.mk
new file mode 100644
index 0000000..3618072
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_answerSuccessTo_OpenSession_Invoke.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/ta_answerSuccessTo_OpenSession_Invoke_test.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/ta_answerSuccessTo_OpenSession_Invoke_test.h
new file mode 100644
index 0000000..ac7bfaf
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/ta_answerSuccessTo_OpenSession_Invoke_test.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define TA_TTA_ANSWERSUCCESSTOOPENSESSION_UUID { \
+ 0x534D4152, \
+ 0x542D, \
+ 0x4353, \
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x53, 0x55 } \
+ }
+#define COMMAND_TTA_Remember_Expected_ParamTypes 0x00000002
+#define COMMAND_TTA_Copy_ParamIn_to_ParamOut 0x00000001
+#define COMMAND_TTA_Check_ParamTypes 0x00000003
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..8f0ce85
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/user_ta_header_defines.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_answerSuccessTo_OpenSession_Invoke_protocol.h"
+
+#define TA_UUID TA_TTA_ANSWERSUCCESSTOOPENSESSION_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE \
+ | TA_FLAG_EXEC_DDR \
+ | TA_FLAG_SINGLE_INSTANCE \
+ )
+#define TA_STACK_SIZE (1*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_answerSuccessTo_OpenSession_Invoke v0.3" },
+
+#endif /* USER_TA_HEADER_DEFINES_H*/
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_patches/v1_1_0_4-2014_11_07/TTA_answerSuccessTo_OpenSession_Invoke_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_patches/v1_1_0_4-2014_11_07/TTA_answerSuccessTo_OpenSession_Invoke_protocol.h.patch
new file mode 100644
index 0000000..9ee6510
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_patches/v1_1_0_4-2014_11_07/TTA_answerSuccessTo_OpenSession_Invoke_protocol.h.patch
@@ -0,0 +1,49 @@
+--- TTA_answerSuccessTo_OpenSession_Invoke_protocol.h.ori 2015-02-02 14:49:14.358854639 +0100
++++ TTA_answerSuccessTo_OpenSession_Invoke_protocol.h 2015-02-02 14:53:55.612751509 +0100
+@@ -0,0 +1,46 @@
++
++#define TRUSTED_APP_ERROR_UNKNOWN_COMMAND 0x00000001
++#define TRUSTED_APP_ERROR_BAD_PARAMETERS 0x00000002
++#define TRUSTED_APP_ERROR_UNEXPECTED_PROPERTY 0x0000FFFE
++#define TRUSTED_APP_ERROR_UNEXPECTED_RETURN 0x0000FFFF
++
++#define PROPERTY_NAME_MAX_SIZE 100
++#define PROPERTY_OUTPUT_STRING_MAX_SIZE 200
++
++/** Types and Structures **/
++enum propType {
++ undefined = 0,
++ string = 1,
++ boolean = 2,
++ integer = 3,
++ binaryblock = 4,
++ uuuid = 5,
++ identity = 6
++};
++
++typedef struct
++{
++ uint32_t param_types;
++ bool set;
++ void* pSessionContext;
++} TEE_STUB_INVOKE;
++
++typedef struct
++{
++ uint32_t param_type; // the copy of the original parameter
++ int param_nbr; // input parameter number
++ bool memref; // false means value, true means memref (bit 2)
++ bool output; // true means the parameter is an output (bit 1)
++ bool input; // true means the parameter is an input (bit 0)
++ // both input & output set means INOUT
++} PARAM;
++
++#define TEE_PARAM_TYPE_GET_INPUT(t, i) (((t) >> (i*4)) & 0x1) // filter on bit 0
++#define TEE_PARAM_TYPE_GET_OUTPUT(t, i) (((t) >> (i*4)) & 0x2) // filter on bit 1
++
++
++/** Functions definition **/
++
++
++/** Command ids and uuid **/
++#include <ta_answerSuccessTo_OpenSession_Invoke_test.h>
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/Makefile
new file mode 100644
index 0000000..4df3d0f
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-544f53345041524d
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/sub.mk
new file mode 100644
index 0000000..84237b0
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_check_OpenSession_with_4_parameters.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/ta_check_OpenSession_with_4_parameters_test.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/ta_check_OpenSession_with_4_parameters_test.h
new file mode 100644
index 0000000..cf0c177
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/ta_check_OpenSession_with_4_parameters_test.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define TA_TTA_CHECKOPENSESSIONWITH4PARAMETERS_UUID { \
+ 0x534D4152, \
+ 0x5443, \
+ 0x534C, \
+ { 0x54, 0x4F, 0x53, 0x34, 0x50, 0x41, 0x52, 0x4D } \
+ }
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..84331c1
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/user_ta_header_defines.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_check_OpenSession_with_4_parameters_protocol.h"
+#define TA_UUID TA_TTA_CHECKOPENSESSIONWITH4PARAMETERS_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE \
+ | TA_FLAG_EXEC_DDR \
+ | TA_FLAG_SINGLE_INSTANCE \
+ )
+#define TA_STACK_SIZE (1*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_check_OpenSession_with_4_parameters v0.2" },
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_patches/v1_1_0_4-2014_11_07/TTA_check_OpenSession_with_4_parameters_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_patches/v1_1_0_4-2014_11_07/TTA_check_OpenSession_with_4_parameters_protocol.h.patch
new file mode 100644
index 0000000..ac1c5a9
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_patches/v1_1_0_4-2014_11_07/TTA_check_OpenSession_with_4_parameters_protocol.h.patch
@@ -0,0 +1,48 @@
+--- TTA_check_OpenSession_with_4_parameters_protocol.h.ori 2015-02-02 15:03:56.856806283 +0100
++++ TTA_check_OpenSession_with_4_parameters_protocol.h 2015-02-02 15:04:18.776954073 +0100
+@@ -0,0 +1,45 @@
++#define TRUSTED_APP_ERROR_UNKNOWN_COMMAND 0x00000001
++#define TRUSTED_APP_ERROR_BAD_PARAMETERS 0x00000002
++#define TRUSTED_APP_ERROR_UNEXPECTED_PROPERTY 0x0000FFFE
++#define TRUSTED_APP_ERROR_UNEXPECTED_RETURN 0x0000FFFF
++
++#define PROPERTY_NAME_MAX_SIZE 100
++#define PROPERTY_OUTPUT_STRING_MAX_SIZE 200
++
++/** Types & Structures **/
++enum propType {
++ undefined = 0,
++ string = 1,
++ boolean = 2,
++ integer = 3,
++ binaryblock = 4,
++ uuuid = 5,
++ identity = 6
++};
++
++typedef struct
++{
++ uint32_t param_types;
++ bool set;
++ void* pSessionContext;
++} TEE_STUB_INVOKE;
++
++typedef struct
++{
++ uint32_t param_type; // the copy of the original parameter
++ int param_nbr; // input parameter number
++ bool memref; // false means value, true means memref (bit 2)
++ bool output; // true means the parameter is an output (bit 1)
++ bool input; // true means the parameter is an input (bit 0)
++ // both input & output set means INOUT
++} PARAM;
++
++#define TEE_PARAM_TYPE_GET_INPUT(t, i) (((t) >> (i*4)) & 0x1) // filter on bit 0
++#define TEE_PARAM_TYPE_GET_OUTPUT(t, i) (((t) >> (i*4)) & 0x2) // filter on bit 1
++
++
++/** Functions definition **/
++
++
++/** UUID and Command ids **/
++#include "ta_check_OpenSession_with_4_parameters_test.h"
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/Makefile
new file mode 100644
index 0000000..87a2a30
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-542d-4353-4c542d54412d5354
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/sub.mk
new file mode 100644
index 0000000..f8ad894
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_testingClientAPI.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/ta_testingClientAPI_test.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/ta_testingClientAPI_test.h
new file mode 100644
index 0000000..2efaa35
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/ta_testingClientAPI_test.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define TA_TTA_TESTING_CLIENT_API_UUID { \
+ 0x534D4152, \
+ 0x542D, \
+ 0x4353, \
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x53, 0x54 } \
+ }
+#define COMMAND_TTA_Remember_Expected_ParamTypes 0x00000002
+#define COMMAND_TTA_Copy_ParamIn_to_ParamOut 0x00000001
+#define COMMAND_TTA_Check_ParamTypes 0x00000003
+#define COMMAND_TTA_To_Be_Cancelled 0x00000004
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..fd1f305
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/user_ta_header_defines.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_testingClientAPI_protocol.h"
+
+#define TA_UUID TA_TTA_TESTING_CLIENT_API_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE \
+ | TA_FLAG_EXEC_DDR \
+ | TA_FLAG_SINGLE_INSTANCE \
+ )
+#define TA_STACK_SIZE (1*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_testingClientAPI v0.5" },
+
+#endif /* USER_TA_HEADER_DEFINES_H*/
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_patches/v1_1_0_4-2014_11_07/TTA_testingClientAPI_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_patches/v1_1_0_4-2014_11_07/TTA_testingClientAPI_protocol.h.patch
new file mode 100644
index 0000000..8cd4be4
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_patches/v1_1_0_4-2014_11_07/TTA_testingClientAPI_protocol.h.patch
@@ -0,0 +1,17 @@
+--- TTA_testingClientAPI_protocol.h.ori 2015-02-02 15:06:30.689843665 +0100
++++ TTA_testingClientAPI_protocol.h 2015-02-02 15:06:52.153988367 +0100
+@@ -1,6 +1,6 @@
+
+ /** Trusted Application Identifier **/
+-#define TA_UUID { 0x534D4152, 0x542D, 0x4353, { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x53, 0x54 } }
++#define TA_TTA_TESTING_CLIENT_API_UUID { 0x534D4152, 0x542D, 0x4353, { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x53, 0x54 } }
+
+ /** Definitions **/
+ #define TRUSTED_APP_ERROR_UNKNOWN_COMMAND 0x00000001
+@@ -67,4 +67,4 @@
+ #define COMMAND_TTA_Remember_Expected_ParamTypes 0x00000002
+ #define COMMAND_TTA_Copy_ParamIn_to_ParamOut 0x00000001
+ #define COMMAND_TTA_Check_ParamTypes 0x00000003
+-#define COMMAND_TTA_To_Be_Cancelled 0x00000004
+\ No newline at end of file
++#define COMMAND_TTA_To_Be_Cancelled 0x00000004
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/Makefile
new file mode 100644
index 0000000..3e15f67
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-5443525950544f31
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/sub.mk
new file mode 100644
index 0000000..88870af
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_Crypto.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..d7bd384
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_files/user_ta_header_defines.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+/* Copied from TTA_Crypto_protocol.h since we can only include it once */
+#define TA_UUID { 0x534D4152, \
+ 0x5443, \
+ 0x534C, \
+ { 0x54, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4F, 0x31 } \
+ }
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE)
+#define TA_STACK_SIZE (2*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_Crypto v1.5" }, \
+
+#endif /* USER_TA_HEADER_DEFINES_H */
+
+
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_patches/v1_1_0_4-2014_11_07/TTA_Crypto.c.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_patches/v1_1_0_4-2014_11_07/TTA_Crypto.c.patch
new file mode 100644
index 0000000..66f1e0e
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_patches/v1_1_0_4-2014_11_07/TTA_Crypto.c.patch
@@ -0,0 +1,29 @@
+--- TTA_Crypto.c.ori 2015-02-02 13:48:31.558369472 +0100
++++ TTA_Crypto.c 2015-02-02 13:48:36.666403656 +0100
+@@ -154,7 +154,7 @@
+ TEE_OperationHandle getOperation(uint32_t lopId)
+ {
+ TEE_CryptoData *pCryptoData;
+- TEE_OperationHandle operation;
++ TEE_OperationHandle operation = TEE_HANDLE_NULL;
+
+ pCryptoData = TEE_GetInstanceData();
+ if(lopId == 1)
+@@ -204,7 +204,7 @@
+ TEE_ObjectHandle getKey(uint32_t lkeyId)
+ {
+ TEE_CryptoData *pCryptoData;
+- TEE_ObjectHandle key;
++ TEE_ObjectHandle key = TEE_HANDLE_NULL;
+
+ pCryptoData = TEE_GetInstanceData();
+ if(lkeyId == 1)
+@@ -415,7 +415,7 @@
+ {
+ /* VARIABLES */
+ TEE_CryptoData *pCryptoData;
+- TEE_Result nTempResult;
++ TEE_Result nTempResult = TEE_SUCCESS;
+
+ /* CODE */
+ if((TEE_PARAM_TYPE_GET(nParamTypes, 0) != TEE_PARAM_TYPE_VALUE_INPUT) && /* .a &.b : [in] algorithm & mode */
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_patches/v1_1_0_4-2014_11_07/TTA_Crypto_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_patches/v1_1_0_4-2014_11_07/TTA_Crypto_protocol.h.patch
new file mode 100644
index 0000000..ac71055
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Crypto/code_patches/v1_1_0_4-2014_11_07/TTA_Crypto_protocol.h.patch
@@ -0,0 +1,30 @@
+--- TTA_Crypto_protocol.h.ori 2015-02-02 13:31:07.727392684 +0100
++++ TTA_Crypto_protocol.h 2015-02-03 13:24:24.166862339 +0100
+@@ -73,6 +73,20 @@
+ } TEE_CryptoData;
+
+ /** Functions definition **/
++uint32_t retrieveUint32FromBuffer(char buffer[]);
++TEE_OperationHandle getOperation(uint32_t lopId);
++TEE_Attribute* getAttribute(void);
++uint32_t getAttributeCount(void);
++void SetOperationToNull(uint32_t lopId);
++TEE_ObjectHandle getKey(uint32_t lkeyId);
++TEE_Result CmdDeriveKey(
++ void* pSessionContext,
++ uint32_t nParamTypes,
++ TEE_Param pParams[4]);
++TEE_Result CmdGenerateRandom(
++ void* pSessionContext,
++ uint32_t nParamTypes,
++ TEE_Param pParams[4]);
+ TEE_Result CmdInitObjectWithKeys(
+ void* pSessionContext,
+ uint32_t nParamTypes,
+@@ -217,4 +231,4 @@
+ #define CMD_LoadAttributes 0x0001001C
+ #define CMD_DeriveKey 0x0001001D
+ #define CMD_GenerateRandom 0x0001001E
+-
+\ No newline at end of file
++
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/Makefile
new file mode 100644
index 0000000..11e49c6
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-5444415441535431
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/sub.mk
new file mode 100644
index 0000000..2c4ebc0
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_DS.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..4a54f17
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_files/user_ta_header_defines.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_DS_protocol.h"
+
+#define TA_UUID TA_TTA_DS_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE)
+#define TA_STACK_SIZE (2*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_DS v3.0" }, \
+
+#endif /*USER_TA_HEADER_DEFINES_H*/
+
+
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_patches/v1_1_0_4-2014_11_07/TTA_DS.c.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_patches/v1_1_0_4-2014_11_07/TTA_DS.c.patch
new file mode 100644
index 0000000..3ce6dff
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_patches/v1_1_0_4-2014_11_07/TTA_DS.c.patch
@@ -0,0 +1,707 @@
+--- TTA_DS.c.ori 2012-10-24 08:33:24.000000000 +0200
++++ TTA_DS.c 2015-04-22 23:06:41.520077876 +0200
+@@ -22,7 +22,7 @@
+ * - updated persistent object management when using TEE_DATA_FLAG_ACCESS_WRITE_META (exclusive access)
+ * 18/09/2012 : v1.1
+ * - updated all NULL pointers on objects with TEE_HANDLE_NULL
+- * - removed a wrong TEE_CloseObject(nObject1) in function TEE_CloseAndDeletePersistentObject
++ * - removed a wrong TEE_CloseObject(nObject1) in function TEE_CloseAndDeletePersistentObject1
+ * 24/09/2012 : v1.2
+ * - some persistent objects are not cleared after panics so they are now wipped clean during the open session.
+ * 24/09/2012 : v1.3
+@@ -249,6 +249,8 @@
+ init = INITIAL_DATA_BUFFER_SIZE; /* to check that 00 are inserted in the stream */
+ length = offset2 + buff_len; /* to include the 00 in the out buffer */
+ break;
++ default:
++ break;
+ }
+ *start = init;
+ *len = length;
+@@ -266,7 +268,7 @@
+ &nObject1);
+
+ if(nTempResult != TEE_ERROR_ITEM_NOT_FOUND)
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+ }
+
+ TEE_Result CmdAllocateTransientChain(
+@@ -277,18 +279,18 @@
+ /* VARIABLES */
+ TEE_ObjectHandle pobject = (TEE_ObjectHandle)0xFFFFDEAD;
+ TEE_ObjectInfo *pobjectInfo;
+- uint32_t nObjectType, nMaxObjectSize, nObjectUsage;
++ uint32_t nObjectType, nMaxKeySize, nObjectUsage;
+ TEE_Result nTempResult;
+ bool nCheckResult;
+
+ /* CODE */
+- if(TEE_PARAM_TYPE_GET(nParamTypes, 0) != TEE_PARAM_TYPE_VALUE_INPUT) /* objectType (.a) & maxObjectSize (.b) */
++ if(TEE_PARAM_TYPE_GET(nParamTypes, 0) != TEE_PARAM_TYPE_VALUE_INPUT) /* objectType (.a) & maxKeySize (.b) */
+ {
+ SLogError("CmdAllocateTransientChain: Bad expected parameter types");
+ return TRUSTED_APP_ERROR_BAD_PARAMETERS;
+ }
+ nObjectType = pParams[0].value.a;
+- nMaxObjectSize = pParams[0].value.b;
++ nMaxKeySize = pParams[0].value.b;
+
+ /* Allocate TEE_ObjectHandle & TEE_ObjectInfo */
+ SLogTrace("CmdAllocateTransientChain: Before TEE_Malloc");
+@@ -298,21 +300,21 @@
+
+ /* Allocate a transient object */
+ SLogTrace("CmdAllocateTransientChain: Before TEE_AllocateTransientObject");
+- nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxObjectSize, &pobject);
++ nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxKeySize, &pobject);
+ if(nTempResult != TEE_SUCCESS)
+ {
+ TEE_Free(pobjectInfo);
+ return nTempResult;
+ }
+ /* Retrieve the information from the current transient object */
+- SLogTrace("CmdAllocateTransientChain: Before TEE_GetObjectInfo");
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_GetObjectInfo1");
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+
+ /* Perform the check on the object info */
+ nCheckResult = true;
+ if((*pobjectInfo).objectType != nObjectType) nCheckResult = false;
+- if((*pobjectInfo).objectSize != 0) nCheckResult = false;
+- if((*pobjectInfo).maxObjectSize != nMaxObjectSize) nCheckResult = false;
++ if((*pobjectInfo).keySize != 0) nCheckResult = false;
++ if((*pobjectInfo).maxKeySize != nMaxKeySize) nCheckResult = false;
+ if((*pobjectInfo).objectUsage != 0xFFFFFFFF) nCheckResult = false;
+ if((*pobjectInfo).dataSize != 0) nCheckResult = false;
+ if((*pobjectInfo).dataPosition != 0) nCheckResult = false;
+@@ -326,12 +328,12 @@
+ }
+
+ /******************************************************************************
+- Perform a TEE_RestrictObjectUsage but with all flags set
++ Perform a TEE_RestrictObjectUsage1 but with all flags set
+ ******************************************************************************/
+ nObjectUsage = TEE_USAGE_EXTRACTABLE | TEE_USAGE_ENCRYPT | TEE_USAGE_DECRYPT | TEE_USAGE_MAC | TEE_USAGE_SIGN | TEE_USAGE_VERIFY | TEE_USAGE_DERIVE;
+- SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage (7F)");
+- TEE_RestrictObjectUsage(pobject, nObjectUsage);
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage1 (7F)");
++ TEE_RestrictObjectUsage1(pobject, nObjectUsage);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if(((*pobjectInfo).objectUsage & OBJECT_USAGE_MASK) != 0x0000007F)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -340,12 +342,12 @@
+ }
+
+ /******************************************************************************
+- Perform a TEE_RestrictObjectUsage removing TEE_USAGE_DERIVE
++ Perform a TEE_RestrictObjectUsage1 removing TEE_USAGE_DERIVE
+ ******************************************************************************/
+ nObjectUsage = TEE_USAGE_EXTRACTABLE | TEE_USAGE_ENCRYPT | TEE_USAGE_DECRYPT | TEE_USAGE_MAC | TEE_USAGE_SIGN | TEE_USAGE_VERIFY;
+- SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage (3F) ");
+- TEE_RestrictObjectUsage(pobject, nObjectUsage);
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage1 (3F) ");
++ TEE_RestrictObjectUsage1(pobject, nObjectUsage);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if(((*pobjectInfo).objectUsage & OBJECT_USAGE_MASK) != 0x0000003F)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -354,12 +356,12 @@
+ }
+
+ /******************************************************************************
+- Perform a TEE_RestrictObjectUsage removing TEE_USAGE_VERIFY
++ Perform a TEE_RestrictObjectUsage1 removing TEE_USAGE_VERIFY
+ ******************************************************************************/
+ nObjectUsage = TEE_USAGE_EXTRACTABLE | TEE_USAGE_ENCRYPT | TEE_USAGE_DECRYPT | TEE_USAGE_MAC | TEE_USAGE_SIGN;
+- SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage (1F) ");
+- TEE_RestrictObjectUsage(pobject, nObjectUsage);
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage1 (1F) ");
++ TEE_RestrictObjectUsage1(pobject, nObjectUsage);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if(((*pobjectInfo).objectUsage & OBJECT_USAGE_MASK) != 0x0000001F)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -368,12 +370,12 @@
+ }
+
+ /******************************************************************************
+- Perform a TEE_RestrictObjectUsage removing TEE_USAGE_SIGN
++ Perform a TEE_RestrictObjectUsage1 removing TEE_USAGE_SIGN
+ ******************************************************************************/
+ nObjectUsage = TEE_USAGE_EXTRACTABLE | TEE_USAGE_ENCRYPT | TEE_USAGE_DECRYPT | TEE_USAGE_MAC;
+- SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage (0F) ");
+- TEE_RestrictObjectUsage(pobject, nObjectUsage);
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage1 (0F) ");
++ TEE_RestrictObjectUsage1(pobject, nObjectUsage);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if(((*pobjectInfo).objectUsage & OBJECT_USAGE_MASK) != 0x0000000F)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -382,12 +384,12 @@
+ }
+
+ /******************************************************************************
+- Perform a TEE_RestrictObjectUsage removing TEE_USAGE_MAC
++ Perform a TEE_RestrictObjectUsage1 removing TEE_USAGE_MAC
+ ******************************************************************************/
+ nObjectUsage = TEE_USAGE_EXTRACTABLE | TEE_USAGE_ENCRYPT | TEE_USAGE_DECRYPT;
+- SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage (07) ");
+- TEE_RestrictObjectUsage(pobject, nObjectUsage);
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage1 (07) ");
++ TEE_RestrictObjectUsage1(pobject, nObjectUsage);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if(((*pobjectInfo).objectUsage & OBJECT_USAGE_MASK) != 0x00000007)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -396,12 +398,12 @@
+ }
+
+ /******************************************************************************
+- Perform a TEE_RestrictObjectUsage removing TEE_USAGE_DECRYPT
++ Perform a TEE_RestrictObjectUsage1 removing TEE_USAGE_DECRYPT
+ ******************************************************************************/
+ nObjectUsage = TEE_USAGE_EXTRACTABLE | TEE_USAGE_ENCRYPT;
+- SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage (03) ");
+- TEE_RestrictObjectUsage(pobject, nObjectUsage);
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage1 (03) ");
++ TEE_RestrictObjectUsage1(pobject, nObjectUsage);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if(((*pobjectInfo).objectUsage & OBJECT_USAGE_MASK) != 0x00000003)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -410,12 +412,12 @@
+ }
+
+ /******************************************************************************
+- Perform a TEE_RestrictObjectUsage removing TEE_USAGE_ENCRYPT
++ Perform a TEE_RestrictObjectUsage1 removing TEE_USAGE_ENCRYPT
+ ******************************************************************************/
+ nObjectUsage = TEE_USAGE_EXTRACTABLE;
+- SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage (01) ");
+- TEE_RestrictObjectUsage(pobject, nObjectUsage);
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage1 (01) ");
++ TEE_RestrictObjectUsage1(pobject, nObjectUsage);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if(((*pobjectInfo).objectUsage & OBJECT_USAGE_MASK) != 0x00000001)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -424,12 +426,12 @@
+ }
+
+ /******************************************************************************
+- Perform a TEE_RestrictObjectUsage removing TEE_USAGE_EXTRACTABLE
++ Perform a TEE_RestrictObjectUsage1 removing TEE_USAGE_EXTRACTABLE
+ ******************************************************************************/
+ nObjectUsage = 0;
+- SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage (00) ");
+- TEE_RestrictObjectUsage(pobject, nObjectUsage);
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ SLogTrace("CmdAllocateTransientChain: Before TEE_RestrictObjectUsage1 (00) ");
++ TEE_RestrictObjectUsage1(pobject, nObjectUsage);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if(((*pobjectInfo).objectUsage & OBJECT_USAGE_MASK) != 0x00000000)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -440,7 +442,7 @@
+ SLogTrace("CmdAllocateTransientChain: Before TEE_FreeTransientObject");
+ TEE_ResetTransientObject(pobject);
+ /* check that the usage has been reset */
+- TEE_GetObjectInfo(pobject, pobjectInfo);
++ TEE_GetObjectInfo1(pobject, pobjectInfo);
+ if((*pobjectInfo).objectUsage != 0xFFFFFFFF)
+ {
+ TEE_FreeTransientObject(pobject);
+@@ -477,9 +479,9 @@
+ if(pobjectInfo == NULL)
+ return TRUSTED_APP_ERROR_MALLOC_FAILED;
+
+- /* Perform the TEE_GetObjectInfo with uninitialized object handle */
+- SLogTrace("CmdGetObjectInfoPanic: Before TEE_GetObjectInfo");
+- TEE_GetObjectInfo(nobject, pobjectInfo);
++ /* Perform the TEE_GetObjectInfo1 with uninitialized object handle */
++ SLogTrace("CmdGetObjectInfoPanic: Before TEE_GetObjectInfo1");
++ TEE_GetObjectInfo1(nobject, pobjectInfo);
+
+ return TEE_ERROR_GENERIC;
+ }
+@@ -499,9 +501,9 @@
+ TEE_ObjectHandle nobject = (TEE_ObjectHandle)0xFFFFDEAD;
+
+ /* CODE */
+- /* Perform the TEE_GetObjectInfo with uninitialized object handle */
+- SLogTrace("CmdRestrictObjectUsagePanic: Before TEE_RestrictObjectUsage");
+- TEE_RestrictObjectUsage(nobject, 0xFFFFFFFF);
++ /* Perform the TEE_GetObjectInfo1 with uninitialized object handle */
++ SLogTrace("CmdRestrictObjectUsagePanic: Before TEE_RestrictObjectUsage1");
++ TEE_RestrictObjectUsage1(nobject, 0xFFFFFFFF);
+
+ return TEE_ERROR_GENERIC;
+ }
+@@ -600,7 +602,7 @@
+ * Function CmdStoreAndReadBufferAttribute:
+ * Description:
+ * The function is called with:
+- * - Param#0.a &.b : ObjectType & ObjectSize (value_INPUT)
++ * - Param#0.a &.b : ObjectType & KeySize (value_INPUT)
+ * - Param#1.a : attributeID (value_INPUT)
+ * - Param#2 : input Attribute (MEMREF_INPUT)
+ */
+@@ -613,10 +615,10 @@
+ TEE_ObjectHandle nobject = (TEE_ObjectHandle)0xFFFFDEAD;
+ TEE_Attribute nattrib;
+ TEE_Result nTempResult;
+- uint32_t nObjectType, nMaxObjectSize;
++ uint32_t nObjectType, nMaxKeySize;
+
+ /* CODE */
+- if((TEE_PARAM_TYPE_GET(nParamTypes, 0) != TEE_PARAM_TYPE_VALUE_INPUT) && /* objectType (.a) & maxObjectSize (.b) */
++ if((TEE_PARAM_TYPE_GET(nParamTypes, 0) != TEE_PARAM_TYPE_VALUE_INPUT) && /* objectType (.a) & maxKeySize (.b) */
+ (TEE_PARAM_TYPE_GET(nParamTypes, 1) != TEE_PARAM_TYPE_VALUE_INPUT) && /* attributeID */
+ (TEE_PARAM_TYPE_GET(nParamTypes, 2) != TEE_PARAM_TYPE_MEMREF_INPUT)) /* attribute buffer */
+ {
+@@ -628,9 +630,9 @@
+
+ /* Allocate a transient object */
+ nObjectType = pParams[0].value.a;
+- nMaxObjectSize = pParams[0].value.b;
++ nMaxKeySize = pParams[0].value.b;
+ SLogTrace("CmdStoreAndReadBufferAttribute: Before TEE_AllocateTransientObject");
+- nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxObjectSize, &nobject);
++ nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxKeySize, &nobject);
+ if(nTempResult != TEE_SUCCESS)
+ return nTempResult;
+
+@@ -668,7 +670,7 @@
+ * Function CmdStoreAndReadBufferAttribute:
+ * Description:
+ * The function is called with:
+- * - Param#0.a &.b : ObjectType & ObjectSize (value_INPUT)
++ * - Param#0.a &.b : ObjectType & KeySize (value_INPUT)
+ * - Param#1 : buffer of uint32_t that contains successively attributeID|buffer offset|length)
+ * - Param#2 : buffer containing all the key values one after the other
+ * - Param#3.a : option in the test for coverage
+@@ -686,8 +688,8 @@
+ nobject_invalid = (TEE_ObjectHandle)0xFFFFDEAD,
+ nTargetObject = (TEE_ObjectHandle)0xFFFFDEAD;
+ TEE_Result nTempResult;
+- uint32_t nObjectType, nMaxObjectSize, nNbAttributes = 0, nMaxNbAttributes = 0;
+- uint32_t *pAttrVector;
++ uint32_t nObjectType, nMaxKeySize, nNbAttributes = 0, nMaxNbAttributes = 0;
++ uint32_t *pAttrVector = NULL;
+ uint32_t nAttribID, nAttribIDTemp;
+ uint32_t nOffset;
+ size_t nLength;
+@@ -774,13 +776,13 @@
+
+ /* Allocate a fresh transient object */
+ nObjectType = pParams[0].value.a;
+- nMaxObjectSize = pParams[0].value.b;
++ nMaxKeySize = pParams[0].value.b;
+ SLogTrace("CmdInitObjectAndAttributes: Before TEE_AllocateTransientObject object1");
+- nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxObjectSize, &nobject1);
++ nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxKeySize, &nobject1);
+ if(nTempResult != TEE_SUCCESS)
+ return TRUSTED_APP_ERROR_ALLOCATE_TRANSIENT_OBJECT_FAILED;
+ SLogTrace("CmdInitObjectAndAttributes: Before TEE_AllocateTransientObject object2");
+- nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxObjectSize, &nobject2);
++ nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxKeySize, &nobject2);
+ if(nTempResult != TEE_SUCCESS)
+ return TRUSTED_APP_ERROR_ALLOCATE_TRANSIENT_OBJECT_FAILED;
+
+@@ -837,7 +839,7 @@
+ {
+ TEE_FreeTransientObject(nobject1);
+ TEE_FreeTransientObject(nobject2);
+- TEE_CloseAndDeletePersistentObject(nTargetObject);
++ TEE_CloseAndDeletePersistentObject1(nTargetObject);
+ return nTempResult;
+ }
+ }
+@@ -870,7 +872,7 @@
+ {
+ case CASE_GET_OBJECT_BUFFER_ATTRIB_BIT28:
+ /* force the object to protect its protected attributes */
+- TEE_RestrictObjectUsage(nTargetObject, TEE_USAGE_ENCRYPT | TEE_USAGE_DECRYPT | TEE_USAGE_MAC | TEE_USAGE_SIGN | TEE_USAGE_VERIFY | TEE_USAGE_DERIVE);
++ TEE_RestrictObjectUsage1(nTargetObject, TEE_USAGE_ENCRYPT | TEE_USAGE_DECRYPT | TEE_USAGE_MAC | TEE_USAGE_SIGN | TEE_USAGE_VERIFY | TEE_USAGE_DERIVE);
+ break;
+ case CASE_GET_OBJECT_BUFFER_ATTRIB_BIT29:
+ nAttribIDTemp = nAttribIDTemp | 0x20000000; /* force the attribute to be a value */
+@@ -948,7 +950,7 @@
+ return TRUSTED_APP_ERROR_POPULATE_TRANSIENT_OBJECT_FAILED;
+ }
+ /* then perform the copy */
+- TEE_CopyObjectAttributes(nobject2, nobject1);
++ TEE_CopyObjectAttributes1(nobject2, nobject1);
+ break;
+ case CASE_COPY_OBJECT_ATTRIBUTE_SRC_DEST_NOT_COMPAT:
+ TEE_FreeTransientObject(nobject1);
+@@ -964,21 +966,21 @@
+ TEE_FreeTransientObject(nobject2);
+ return TRUSTED_APP_ERROR_GENERATE_KEY_FAILED;
+ }
+- TEE_CopyObjectAttributes(nobject2, nobject1); /* Expected to panic here !! */
++ TEE_CopyObjectAttributes1(nobject2, nobject1); /* Expected to panic here !! */
+ break;
+ case CASE_COPY_OBJECT_ATTRIBUTE_SRC_IS_PERSISTENT:
+ nobjectTransient = createPersistentObject_FullAccess(pObjectID, nObjectIDSize, nobject1);
+ if(nobject1 == TEE_HANDLE_NULL)
+ return TRUSTED_APP_ERROR_CREATE_PERSISTENT_OBJECT_FAILED;
+
+- TEE_CopyObjectAttributes(nobject2, nobjectTransient);
+- TEE_CloseAndDeletePersistentObject(nobjectTransient);
++ TEE_CopyObjectAttributes1(nobject2, nobjectTransient);
++ TEE_CloseAndDeletePersistentObject1(nobjectTransient);
+ break;
+ case CASE_COPY_OBJECT_ATTRIBUTE_SRC_NOT_INIT:
+ /* copy the unitialized into the initialized */
+- TEE_CopyObjectAttributes(nobject1, nobject2);
++ TEE_CopyObjectAttributes1(nobject1, nobject2);
+ default:
+- TEE_CopyObjectAttributes(nobject2, nobject1);
++ TEE_CopyObjectAttributes1(nobject2, nobject1);
+ break;
+ }
+
+@@ -1022,7 +1024,7 @@
+ * Function CmdGenerateKey:
+ * Description:
+ * The function is called with:
+- * - Param#0.a & .b : ObjectType & ObjectSize (value_INPUT)
++ * - Param#0.a & .b : ObjectType & KeySize (value_INPUT)
+ * - Param#1 : buffer of uint32_t that contains successively attributeID|buffer offset|length)
+ * - Param#2 : buffer containing all the key values one after the other
+ * - Param#3.a & .b : option in the test for coverage and GenerateKey keysize parameter
+@@ -1038,7 +1040,7 @@
+ nobject2 = (TEE_ObjectHandle)0xFFFFDEAD,
+ nTargetObject = (TEE_ObjectHandle)0xFFFFDEAD;
+ TEE_Result nTempResult;
+- uint32_t nObjectType, nMaxObjectSize, nNbAttributes = 0, nMaxNbAttributes = 0;
++ uint32_t nObjectType, nMaxKeySize, nNbAttributes = 0, nMaxNbAttributes = 0;
+ uint32_t *pAttrVector;
+ uint32_t nAttribID;
+ uint32_t nOffset;
+@@ -1106,9 +1108,9 @@
+ }
+ /* Allocate a fresh transient object */
+ nObjectType = pParams[0].value.a;
+- nMaxObjectSize = pParams[0].value.b;
++ nMaxKeySize = pParams[0].value.b;
+ SLogTrace("CmdGenerateKey: Before TEE_AllocateTransientObject object");
+- nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxObjectSize, &nobject1);
++ nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxKeySize, &nobject1);
+ if(nTempResult != TEE_SUCCESS)
+ return TRUSTED_APP_ERROR_ALLOCATE_TRANSIENT_OBJECT_FAILED;
+
+@@ -1145,7 +1147,7 @@
+ nTempResult = TEE_GenerateKey(nTargetObject, nKeySize, pattrib, nNbAttributes); /* tries to generate a key on the object that has already been initialized --> should panic */
+
+ if(nTestOption == CASE_GENERATE_KEY_OBJECT_NOT_TRANSIENT) /* TA should have already panicked */
+- TEE_CloseAndDeletePersistentObject(nTargetObject);
++ TEE_CloseAndDeletePersistentObject1(nTargetObject);
+
+ TEE_FreeTransientObject(nobject1);
+ return nTempResult;
+@@ -1228,7 +1230,7 @@
+ &nObject1);
+
+ if(nTempResult == TEE_SUCCESS) /* in case the creation was done ... */
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+
+ TEE_Free(pInitialData);
+ return nTempResult;
+@@ -1273,7 +1275,7 @@
+ &nObject1);
+
+ if(nTempResult == TEE_SUCCESS) /* in case the creation was done ... */
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+
+ TEE_Free(pInitialData);
+
+@@ -1304,8 +1306,8 @@
+ /* CODE */
+ for(i = 0; i < INITIAL_DATA_BUFFER_SIZE; i++)
+ pInitialData[i] = 'B';
+- nFlags = TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE | TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_SHARE_READ | TEE_DATA_FLAG_SHARE_WRITE | TEE_DATA_FLAG_EXCLUSIVE;
+- /* create the first object with the attribute TEE_DATA_FLAG_EXCLUSIVE */
++ nFlags = TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE | TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_SHARE_READ | TEE_DATA_FLAG_SHARE_WRITE | TEE_DATA_FLAG_OVERWRITE;
++ /* create the first object with the attribute TEE_DATA_FLAG_OVERWRITE */
+ nTempResult = TEE_CreatePersistentObject(
+ TEE_STORAGE_PRIVATE,
+ (void*) pObjectID, nObjectIDSize,
+@@ -1325,9 +1327,9 @@
+ &nObject2);
+
+
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+ if(nTempResult == TEE_SUCCESS)
+- TEE_CloseAndDeletePersistentObject(nObject2);
++ TEE_CloseAndDeletePersistentObject1(nObject2);
+
+ TEE_Free(pInitialData);
+
+@@ -1400,7 +1402,7 @@
+ if(nTempResult2 != TEE_SUCCESS)
+ return nTempResult; /* if there was an error when opening the object */
+
+- TEE_CloseAndDeletePersistentObject(nObject2);
++ TEE_CloseAndDeletePersistentObject1(nObject2);
+ }
+
+ pInitialData = TEE_Malloc(INITIAL_DATA_BUFFER_SIZE, 0);
+@@ -1501,7 +1503,7 @@
+ return TEE_ERROR_GENERIC;
+ }
+
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+
+ TEE_Free(pInitialData);
+
+@@ -1599,7 +1601,7 @@
+ &nObject1);
+ if(nTempResult2 != TEE_SUCCESS)
+ return TRUSTED_APP_ERROR_OPEN_PERSISTENT_OBJECT_FAILED;
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+
+ TEE_Free(pInitialData);
+
+@@ -1681,7 +1683,7 @@
+ (void*) pObjectID1, nObjectID1Size,
+ TEE_DATA_FLAG_ACCESS_WRITE_META,
+ &nObject1);
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+
+ TEE_Free(pInitialData);
+
+@@ -1740,15 +1742,15 @@
+
+ if(nTempResult != TEE_SUCCESS)
+ {
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+ return TRUSTED_APP_ERROR_CREATE_PERSISTENT_OBJECT_FAILED;
+ }
+
+ /* rename the object */
+ nTempResult = TEE_RenamePersistentObject(nObject1, (void*) pObjectID2, nObjectID2Size);
+
+- TEE_CloseAndDeletePersistentObject(nObject1);
+- TEE_CloseAndDeletePersistentObject(nObject2);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject2);
+
+ TEE_Free(pInitialData);
+
+@@ -1799,7 +1801,7 @@
+ /* rename the object */
+ nTempResult = TEE_RenamePersistentObject(nObject1, (void*)pObjectID2, nObjectID2Size);
+
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+
+ TEE_Free(pInitialData);
+
+@@ -1902,7 +1904,7 @@
+
+ if(nTempResult != TEE_SUCCESS)
+ {
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+ return TRUSTED_APP_ERROR_CREATE_PERSISTENT_OBJECT_FAILED;
+ }
+
+@@ -1917,8 +1919,8 @@
+
+ if(nTempResult != TEE_SUCCESS)
+ {
+- TEE_CloseAndDeletePersistentObject(nObject1);
+- TEE_CloseAndDeletePersistentObject(nObject2);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject2);
+ return TRUSTED_APP_ERROR_CREATE_PERSISTENT_OBJECT_FAILED;
+ }
+
+@@ -1948,9 +1950,9 @@
+
+ TEE_FreePersistentObjectEnumerator(nObjectEnumerator);
+
+- TEE_CloseAndDeletePersistentObject(nObject1);
+- TEE_CloseAndDeletePersistentObject(nObject2);
+- TEE_CloseAndDeletePersistentObject(nObject3);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject2);
++ TEE_CloseAndDeletePersistentObject1(nObject3);
+
+ TEE_Free(pInitialData);
+
+@@ -1988,7 +1990,7 @@
+ }
+
+ if(pParams[0].value.a == CASE_CLOSE_N_DELETE_PERSISTENT_OBJ_HANDLE_NOT_VALID)
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+
+ if(pParams[0].value.a != CASE_CLOSE_N_DELETE_PERSISTENT_OBJ_WRITE_META)
+ return TRUSTED_APP_ERROR_BAD_PARAMETERS;
+@@ -2013,7 +2015,7 @@
+ if(nTempResult != TEE_SUCCESS)
+ return TRUSTED_APP_ERROR_CREATE_PERSISTENT_OBJECT_FAILED;
+
+- TEE_CloseAndDeletePersistentObject(nObject1);
++ TEE_CloseAndDeletePersistentObject1(nObject1);
+
+ return TEE_ERROR_GENERIC;
+
+@@ -2028,7 +2030,7 @@
+
+ /* CODE */
+ TEE_FreePersistentObjectEnumerator(TEE_HANDLE_NULL);
+- TEE_CloseAndDeletePersistentObject(TEE_HANDLE_NULL);
++ TEE_CloseAndDeletePersistentObject1(TEE_HANDLE_NULL);
+
+ return TEE_SUCCESS;
+ }
+@@ -2166,7 +2168,7 @@
+ {
+ /* VARIABLES */
+ TEE_ObjectHandle pobject = (TEE_ObjectHandle)0xFFFFDEAD;
+- uint32_t nObjectType, nMaxObjectSize;
++ uint32_t nObjectType, nMaxKeySize;
+ void* pBuffer;
+ size_t nBufferSize = BIG_ATTRIBUTE_BUFFER_SIZE;
+ TEE_Result nTempResult;
+@@ -2176,16 +2178,16 @@
+ return TRUSTED_APP_ERROR_MALLOC_FAILED;
+
+ /* CODE */
+- if(TEE_PARAM_TYPE_GET(nParamTypes, 0) != TEE_PARAM_TYPE_VALUE_INPUT) /* objectType (.a) & maxObjectSize (.b) */
++ if(TEE_PARAM_TYPE_GET(nParamTypes, 0) != TEE_PARAM_TYPE_VALUE_INPUT) /* objectType (.a) & maxKeySize (.b) */
+ {
+ SLogError("CmdGetBufferAttribute_object_uninitialized: Bad expected parameter types");
+ return TRUSTED_APP_ERROR_BAD_PARAMETERS;
+ }
+ nObjectType = pParams[0].value.a;
+- nMaxObjectSize = pParams[0].value.b;
++ nMaxKeySize = pParams[0].value.b;
+
+ /* Allocate a transient object */
+- nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxObjectSize, &pobject);
++ nTempResult = TEE_AllocateTransientObject(nObjectType, nMaxKeySize, &pobject);
+ if(nTempResult != TEE_SUCCESS)
+ return nTempResult;
+
+@@ -2224,7 +2226,7 @@
+ nFlags,
+ &nobject2);
+
+- TEE_CloseAndDeletePersistentObject(nobject1);
++ TEE_CloseAndDeletePersistentObject1(nobject1);
+
+ return nTempResult;
+ }
+@@ -2578,14 +2580,14 @@
+ return TRUSTED_APP_ERROR_BAD_PARAMETERS;
+ }
+
+- nFlags = TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE | TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_SHARE_READ | TEE_DATA_FLAG_SHARE_WRITE | TEE_DATA_FLAG_EXCLUSIVE;
++ nFlags = TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE | TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_SHARE_READ | TEE_DATA_FLAG_SHARE_WRITE | TEE_DATA_FLAG_OVERWRITE;
+ nobject = createPersistentObject_SetAccess(pObjectID, nObjectIDSize, TEE_HANDLE_NULL, nFlags);
+ if(nobject == TEE_HANDLE_NULL)
+ return TRUSTED_APP_ERROR_CREATE_PERSISTENT_OBJECT_FAILED;
+
+ nTempResult = TEE_ReadObjectData(nobject, (void*)pParams[1].memref.buffer, pParams[0].value.a, &nSizeRead);
+ pParams[1].memref.size = nSizeRead;
+- TEE_CloseAndDeletePersistentObject(nobject);
++ TEE_CloseAndDeletePersistentObject1(nobject);
+ return nTempResult;
+ }
+
+@@ -2611,7 +2613,7 @@
+ return TRUSTED_APP_ERROR_BAD_PARAMETERS;
+ }
+ /* create the persistent object to work on */
+- nFlags = TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE | TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_SHARE_READ | TEE_DATA_FLAG_SHARE_WRITE | TEE_DATA_FLAG_EXCLUSIVE;
++ nFlags = TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE | TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_SHARE_READ | TEE_DATA_FLAG_SHARE_WRITE | TEE_DATA_FLAG_OVERWRITE;
+ nobject = createPersistentObject_SetAccess(pObjectID, nObjectIDSize, TEE_HANDLE_NULL, nFlags);
+ if(nobject == TEE_HANDLE_NULL)
+ return TRUSTED_APP_ERROR_CREATE_PERSISTENT_OBJECT_FAILED;
+@@ -2620,21 +2622,21 @@
+ nTempResult = TEE_SeekObjectData(nobject, pParams[1].value.a, TEE_DATA_SEEK_SET);
+ if(nTempResult != TEE_SUCCESS)
+ {
+- TEE_CloseAndDeletePersistentObject(nobject);
++ TEE_CloseAndDeletePersistentObject1(nobject);
+ return TRUSTED_APP_ERROR_SEEK_OBJECT_DATA_FAILED;
+ }
+ /* set the offset where required (depends on the SEEK mode specified) */
+ nTempResult = TEE_SeekObjectData(nobject, pParams[0].value.b, pParams[0].value.a);
+ if(nTempResult != TEE_SUCCESS)
+ {
+- TEE_CloseAndDeletePersistentObject(nobject);
++ TEE_CloseAndDeletePersistentObject1(nobject);
+ return TRUSTED_APP_ERROR_SEEK_OBJECT_DATA_FAILED;
+ }
+ /* write the input buffer somewhere in the stream */
+ nTempResult = TEE_WriteObjectData(nobject, pParams[2].memref.buffer, pParams[2].memref.size);
+ if(nTempResult != TEE_SUCCESS)
+ {
+- TEE_CloseAndDeletePersistentObject(nobject);
++ TEE_CloseAndDeletePersistentObject1(nobject);
+ return TRUSTED_APP_ERROR_WRITE_OBJECT_DATA_FAILED;
+ }
+
+@@ -2643,13 +2645,13 @@
+ nTempResult = TEE_SeekObjectData(nobject, nOffsetRead, TEE_DATA_SEEK_SET);
+ if(nTempResult != TEE_SUCCESS)
+ {
+- TEE_CloseAndDeletePersistentObject(nobject);
++ TEE_CloseAndDeletePersistentObject1(nobject);
+ return TRUSTED_APP_ERROR_SEEK_OBJECT_DATA_FAILED;
+ }
+
+ nTempResult = TEE_ReadObjectData(nobject, (void*)pParams[3].memref.buffer, nSizeRead, &nSizeFinalRead);
+ pParams[3].memref.size = nSizeFinalRead;
+- TEE_CloseAndDeletePersistentObject(nobject);
++ TEE_CloseAndDeletePersistentObject1(nobject);
+
+ if(nSizeRead != nSizeFinalRead)
+ return TEE_ERROR_GENERIC;
+@@ -2676,7 +2678,7 @@
+ return TRUSTED_APP_ERROR_BAD_PARAMETERS;
+ }
+ /* create the persistent object to work on */
+- nFlags = TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE | TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_SHARE_READ | TEE_DATA_FLAG_SHARE_WRITE | TEE_DATA_FLAG_EXCLUSIVE;
++ nFlags = TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE | TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_SHARE_READ | TEE_DATA_FLAG_SHARE_WRITE | TEE_DATA_FLAG_OVERWRITE;
+ nobject = createPersistentObject_SetAccess(pObjectID, nObjectIDSize, TEE_HANDLE_NULL, nFlags);
+ if(nobject == TEE_HANDLE_NULL)
+ return TRUSTED_APP_ERROR_CREATE_PERSISTENT_OBJECT_FAILED;
+@@ -2684,12 +2686,12 @@
+ nTempResult = TEE_TruncateObjectData(nobject, pParams[0].value.a); /* shrink or extend the buffer */
+ if(nTempResult != TEE_SUCCESS)
+ {
+- TEE_CloseAndDeletePersistentObject(nobject);
++ TEE_CloseAndDeletePersistentObject1(nobject);
+ return TRUSTED_APP_ERROR_TRUNCATE_OBJECT_DATA_FAILED;
+ }
+
+ nTempResult = TEE_ReadObjectData(nobject, pParams[3].memref.buffer, pParams[0].value.a, &pParams[3].memref.size);
+- TEE_CloseAndDeletePersistentObject(nobject);
++ TEE_CloseAndDeletePersistentObject1(nobject);
+ return nTempResult;
+ }
+
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_patches/v1_1_0_4-2014_11_07/TTA_DS_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_patches/v1_1_0_4-2014_11_07/TTA_DS_protocol.h.patch
new file mode 100644
index 0000000..48962b7
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_DS/code_patches/v1_1_0_4-2014_11_07/TTA_DS_protocol.h.patch
@@ -0,0 +1,10 @@
+--- TTA_DS_protocol.h.ori 2015-02-02 14:09:02.722617469 +0100
++++ TTA_DS_protocol.h 2015-02-02 14:09:21.962746491 +0100
+@@ -1,6 +1,6 @@
+
+ /** Trusted Application Identifier **/
+-#define TA_UUID { 0x534D4152, 0x5443, 0x534C, { 0x54, 0x44, 0x41, 0x54, 0x41, 0x53, 0x54, 0x31 } }
++#define TA_TTA_DS_UUID { 0x534D4152, 0x5443, 0x534C, { 0x54, 0x44, 0x41, 0x54, 0x41, 0x53, 0x54, 0x31 } }
+
+ #define TRUSTED_APP_ERROR_UNKNOWN_COMMAND 0x00000001
+ #define TRUSTED_APP_ERROR_BAD_PARAMETERS 0x00000002
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/Makefile
new file mode 100644
index 0000000..ecef87a
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/Makefile
@@ -0,0 +1,4 @@
+BINARY = 534d4152-542d-4353-4c542d54412d3031
+NOWERROR = 1
+include ../ta_common.mk
+
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/TTA_TCF_common_protocol.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/TTA_TCF_common_protocol.h
new file mode 100644
index 0000000..7238740
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/TTA_TCF_common_protocol.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** Trusted Application Identifier **/
+#define CASE_SUCCESS 0
+#define CASE_TARGET_DEAD 1
+#define CASE_CANCEL_TIMEOUT 2
+#define CASE_ITEM_NOT_FOUND 3
+#define CASE_TARGET_BUSY 4
+#define TIMEOUT_VALUE 5000
+#define MEMREF_BUFFER_LENGTH 16
+
+#define CASE_TARGET_DEAD_ICA2 1
+#define CASE_SUCCESS_ICA2 2
+#define CASE_ERROR_ICA2 3
+#define CASE_PAYLOAD_VALUE_STUB 4
+#define CASE_PAYLOAD_MEMREF_STUB 5
+#define CASE_PAYLOAD_VALUE_IN_OUT_STUB 6
+
+/** Types & Structures **/
+
+/** Functions definition **/
+
+/** Command ids **/
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/sub.mk
new file mode 100644
index 0000000..46de472
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_TCF.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/ta_TCF_test.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/ta_TCF_test.h
new file mode 100644
index 0000000..f0da901
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/ta_TCF_test.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define TA_UUID { \
+ 0x534D4152, \
+ 0x542D, \
+ 0x4353, \
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x30, 0x31 } \
+ }
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..3df06d3
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_files/user_ta_header_defines.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "ta_TCF_test.h"
+
+#define TA_FLAGS (TA_FLAG_USER_MODE \
+ | TA_FLAG_EXEC_DDR \
+ | TA_FLAG_SINGLE_INSTANCE \
+ )
+#define TA_STACK_SIZE (2*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gp.test.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_TCF v1.9" }, \
+ { "smc.ta.teststring", USER_TA_PROP_TYPE_STRING, \
+ "this is a test string" }, \
+ { "smc.ta.testbooltrue", USER_TA_PROP_TYPE_BOOL, \
+ &(const bool){ true } }, \
+ { "smc.ta.testboolfalse", USER_TA_PROP_TYPE_BOOL, \
+ &(const bool){ false } }, \
+ { "smc.ta.testu32", USER_TA_PROP_TYPE_U32, \
+ &(const uint32_t){ 48059 } }, \
+ { "smc.ta.testbinaryblock", USER_TA_PROP_TYPE_BINARY_BLOCK, \
+ "VGhpcyBpcyBhIHRleHQgYmluYXJ5IGJsb2Nr" }, \
+ { "smc.ta.testuuid", USER_TA_PROP_TYPE_UUID, \
+ &(const TEE_UUID) { 0x534D4152, 0x542D, 0x4353, \
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x30, 0x31 } } }, \
+ { "smc.ta.testidentity", USER_TA_PROP_TYPE_IDENTITY, \
+ &(const TEE_Identity) { 0xF0000000, \
+ { 0x534D4152, 0x542D, 0x4353, \
+ { 0x4C, 0x54, 0x2D, 0x54, 0x41, 0x2D, 0x30, 0x31 } } } }
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_patches/v1_1_0_4-2014_11_07/TTA_TCF.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_patches/v1_1_0_4-2014_11_07/TTA_TCF.h.patch
new file mode 100644
index 0000000..a68a61b
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF/code_patches/v1_1_0_4-2014_11_07/TTA_TCF.h.patch
@@ -0,0 +1,46 @@
+--- TTA_TCF.h.ori 2015-02-02 14:15:06.009054399 +0100
++++ TTA_TCF.h 2015-02-02 14:20:46.799347192 +0100
+@@ -46,10 +46,12 @@
+ };
+
+ /** function protoypes **/
++bool isPropertySet (TEE_PropSetHandle propsetOrEnumerator);
+ bool areStringsIdentical(const char *string1, const char *string2);
+ bool areUUIDsIdentical(TEE_UUID *UUID1, TEE_UUID *UUID2);
+ bool areIdentitiesIdentical(TEE_Identity *Identity1, TEE_Identity *Identity2);
+ bool areBinaryBlocksIdentical(const char *BinaryBlock1, size_t nLength1, const char *BinaryBlock2, size_t nLength2);
++void getUUIDFromBuffer(TEE_UUID *pTargetUUID, char uuidvalue[16]);
+ enum propType getPropertyType(char *propString);
+ TEE_Result CmdTEEGetPropertyAsString_withoutEnum(
+ void* pSessionContext,
+@@ -147,11 +149,19 @@
+ void* pSessionContext,
+ uint32_t nParamTypes,
+ TEE_Param pParams[4]);
++TEE_Result CmdInvokePayloadValue(
++ void* pSessionContext,
++ uint32_t nParamTypes,
++ TEE_Param pParams[4]);
+ TEE_Result SendInvokeAndCheck_ValueInOut(
+ TEE_TASessionHandle psession,
+ TEE_Param pParams[4],
+ uint32_t lType,
+ uint32_t nvalue);
++TEE_Result CmdInvokePayloadMemref(
++ void* pSessionContext,
++ uint32_t nParamTypes,
++ TEE_Param pParams[4]);
+ TEE_Result CmdTEEGetNextPropertyEnumerator_notStarted(
+ void* pSessionContext,
+ uint32_t nParamTypes,
+@@ -160,6 +170,10 @@
+ TEE_TASessionHandle psession,
+ TEE_Param pParams[4],
+ uint32_t lType);
++TEE_Result CmdInvokePayloadValue_In_Out(
++ void* pSessionContext,
++ uint32_t nParamTypes,
++ TEE_Param pParams[4]);
+ TEE_Result SendInvokeAndCheck_Value_In_Out(
+ TEE_TASessionHandle psession,
+ TEE_Param pParams[4],
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/Makefile
new file mode 100644
index 0000000..341514e
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-5441544346494341
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/TTA_TCF_common_protocol.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/TTA_TCF_common_protocol.h
new file mode 100644
index 0000000..7238740
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/TTA_TCF_common_protocol.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** Trusted Application Identifier **/
+#define CASE_SUCCESS 0
+#define CASE_TARGET_DEAD 1
+#define CASE_CANCEL_TIMEOUT 2
+#define CASE_ITEM_NOT_FOUND 3
+#define CASE_TARGET_BUSY 4
+#define TIMEOUT_VALUE 5000
+#define MEMREF_BUFFER_LENGTH 16
+
+#define CASE_TARGET_DEAD_ICA2 1
+#define CASE_SUCCESS_ICA2 2
+#define CASE_ERROR_ICA2 3
+#define CASE_PAYLOAD_VALUE_STUB 4
+#define CASE_PAYLOAD_MEMREF_STUB 5
+#define CASE_PAYLOAD_VALUE_IN_OUT_STUB 6
+
+/** Types & Structures **/
+
+/** Functions definition **/
+
+/** Command ids **/
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/sub.mk
new file mode 100644
index 0000000..9066247
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_TCF_ICA.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..51f2223
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/user_ta_header_defines.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_TCF_ICA_protocol.h"
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE)
+#define TA_STACK_SIZE (2*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_TCF_ICA v0.4" }, \
+
+#endif /* USER_TA_HEADER_DEFINES_H */
+
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_ICA_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_ICA_protocol.h.patch
new file mode 100644
index 0000000..72e8170
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_ICA_protocol.h.patch
@@ -0,0 +1,29 @@
+--- TTA_TCF_ICA_protocol.h.ori 2015-02-02 14:23:55.668618005 +0100
++++ TTA_TCF_ICA_protocol.h 2015-02-02 14:32:34.040106856 +0100
+@@ -13,18 +13,18 @@
+ /** Types & Structures **/
+
+ /** Functions definition **/
+-TEE_Result TA_CreateEntryPoint(void);
+-void TA_DestroyEntryPoint(void);
+-TEE_Result TA_OpenSessionEntryPoint(
++/* TEE_Result TA_CreateEntryPoint(void); */
++/* void TA_DestroyEntryPoint(void); */
++/* TEE_Result TA_OpenSessionEntryPoint(
+ uint32_t nParamTypes,
+ TEE_Param pParams[4],
+- void** ppSessionContext );
+-void TA_CloseSessionEntryPoint(
+- void* pSessionContext);
+-TEE_Result TA_InvokeCommandEntryPoint(
++ void** ppSessionContext ); */
++/* void TA_CloseSessionEntryPoint(
++ void* pSessionContext); */
++/* TEE_Result TA_InvokeCommandEntryPoint(
+ void* pSessionContext,
+ uint32_t nCommandID,
+ uint32_t nParamTypes,
+- TEE_Param pParams[4]);
++ TEE_Param pParams[4]); */
+
+ /** Command ids **/
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/Makefile
new file mode 100644
index 0000000..265e5b6
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-5454434649434132
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/TTA_TCF_common_protocol.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/TTA_TCF_common_protocol.h
new file mode 100644
index 0000000..7238740
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/TTA_TCF_common_protocol.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** Trusted Application Identifier **/
+#define CASE_SUCCESS 0
+#define CASE_TARGET_DEAD 1
+#define CASE_CANCEL_TIMEOUT 2
+#define CASE_ITEM_NOT_FOUND 3
+#define CASE_TARGET_BUSY 4
+#define TIMEOUT_VALUE 5000
+#define MEMREF_BUFFER_LENGTH 16
+
+#define CASE_TARGET_DEAD_ICA2 1
+#define CASE_SUCCESS_ICA2 2
+#define CASE_ERROR_ICA2 3
+#define CASE_PAYLOAD_VALUE_STUB 4
+#define CASE_PAYLOAD_MEMREF_STUB 5
+#define CASE_PAYLOAD_VALUE_IN_OUT_STUB 6
+
+/** Types & Structures **/
+
+/** Functions definition **/
+
+/** Command ids **/
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/sub.mk
new file mode 100644
index 0000000..8190311
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_TCF_ICA2.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..b8539d8
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_ICA2/code_files/user_ta_header_defines.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_TCF_ICA2_protocol.h"
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE)
+#define TA_STACK_SIZE (2*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_TCF_ICA2 v0.2" }, \
+
+#endif /* USER_TA_HEADER_DEFINES_H */
+
+
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/Makefile
new file mode 100644
index 0000000..5a01ea6
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-4d4c54494e535443
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/sub.mk
new file mode 100644
index 0000000..907b908
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_TCF_MultipleInstanceTA.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..ab50b40
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/user_ta_header_defines.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_TCF_MultipleInstanceTA_protocol.h"
+
+#define TA_FLAGS (TA_FLAG_USER_MODE \
+ | TA_FLAG_EXEC_DDR \
+ | TA_FLAG_MULTI_SESSION \
+ )
+
+#define TA_STACK_SIZE (1*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_testingInternalAPI_TrustedCoreFramework_MultipleInstanceTA v0.1" },
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_MultipleInstanceTA_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_MultipleInstanceTA_protocol.h.patch
new file mode 100644
index 0000000..4ab3e34
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_MultipleInstanceTA_protocol.h.patch
@@ -0,0 +1,37 @@
+--- TTA_TCF_MultipleInstanceTA_protocol.h.ori 2015-02-02 14:25:51.125394897 +0100
++++ TTA_TCF_MultipleInstanceTA_protocol.h 2015-02-02 14:30:51.351415231 +0100
+@@ -13,14 +13,14 @@
+ /** Types & Structures **/
+
+ /** Functions definition **/
+-TEE_Result TA_CreateEntryPoint(void);
+-void TA_DestroyEntryPoint(void);
+-TEE_Result TA_OpenSessionEntryPoint(
++/* TEE_Result TA_CreateEntryPoint(void); */
++/* void TA_DestroyEntryPoint(void); */
++/* TEE_Result TA_OpenSessionEntryPoint(
+ uint32_t nParamTypes,
+ TEE_Param pParams[4],
+- void** ppSessionContext );
+-void TA_CloseSessionEntryPoint(
+- void* pSessionContext);
++ void** ppSessionContext ); */
++/* void TA_CloseSessionEntryPoint(
++ void* pSessionContext); */
+ TEE_Result CmdTEESetInstanceData(
+ void* pSessionContext,
+ uint32_t nParamTypes,
+@@ -29,11 +29,11 @@
+ void* pSessionContext,
+ uint32_t nParamTypes,
+ TEE_Param pParams[4]);
+-TEE_Result TA_InvokeCommandEntryPoint(
++/* TEE_Result TA_InvokeCommandEntryPoint(
+ void* pSessionContext,
+ uint32_t nCommandID,
+ uint32_t nParamTypes,
+- TEE_Param pParams[4]);
++ TEE_Param pParams[4]); */
+
+ /** Command ids **/
+ #define CMD_TEE_GetInstanceData 0x00000101
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/Makefile
new file mode 100644
index 0000000..cabc590
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-53474c494e535443
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/sub.mk
new file mode 100644
index 0000000..ea7af3c
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += TTA_TCF_SingleInstanceTA.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..136e68d
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/user_ta_header_defines.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include "TTA_TCF_SingleInstanceTA_protocol.h"
+
+#define TA_FLAGS (TA_FLAG_USER_MODE \
+ | TA_FLAG_EXEC_DDR \
+ | TA_FLAG_SINGLE_INSTANCE \
+ )
+#define TA_STACK_SIZE (1*1024)
+#define TA_DATA_SIZE (32*1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_testingInternalAPI_TrustedCoreFramework_SingleInstanceTA v0.4" },
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_SingleInstanceTA_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_SingleInstanceTA_protocol.h.patch
new file mode 100644
index 0000000..34bc229
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_SingleInstanceTA_protocol.h.patch
@@ -0,0 +1,37 @@
+--- TTA_TCF_SingleInstanceTA_protocol.h.ori 2015-02-02 14:32:58.496271848 +0100
++++ TTA_TCF_SingleInstanceTA_protocol.h 2015-02-02 14:34:54.189052352 +0100
+@@ -14,14 +14,14 @@
+ /** Types & Structures **/
+
+ /** Functions definition **/
+-TEE_Result TA_CreateEntryPoint(void);
+-void TA_DestroyEntryPoint(void);
+-TEE_Result TA_OpenSessionEntryPoint(
++/* TEE_Result TA_CreateEntryPoint(void); */
++/* void TA_DestroyEntryPoint(void); */
++/* TEE_Result TA_OpenSessionEntryPoint(
+ uint32_t nParamTypes,
+ TEE_Param pParams[4],
+- void** ppSessionContext );
+-void TA_CloseSessionEntryPoint(
+- void* pSessionContext);
++ void** ppSessionContext ); */
++/* void TA_CloseSessionEntryPoint(
++ void* pSessionContext); */
+ TEE_Result CmdTEESetInstanceData(
+ void* pSessionContext,
+ uint32_t nParamTypes,
+@@ -30,11 +30,11 @@
+ void* pSessionContext,
+ uint32_t nParamTypes,
+ TEE_Param pParams[4]);
+-TEE_Result TA_InvokeCommandEntryPoint(
++/* TEE_Result TA_InvokeCommandEntryPoint(
+ void* pSessionContext,
+ uint32_t nCommandID,
+ uint32_t nParamTypes,
+- TEE_Param pParams[4]);
++ TEE_Param pParams[4]); */
+
+ /** Command ids **/
+ #define CMD_TEE_GetInstanceData 0x00000101
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/Makefile b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/Makefile
new file mode 100644
index 0000000..4b51c92
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/Makefile
@@ -0,0 +1,3 @@
+BINARY = 534d4152-5443-534c-5f54494d45415049
+NOWERROR = 1
+include ../ta_common.mk
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/sub.mk b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/sub.mk
new file mode 100644
index 0000000..13f9579
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y +=TTA_Time.c
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/user_ta_header_defines.h b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/user_ta_header_defines.h
new file mode 100644
index 0000000..164f03d
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_files/user_ta_header_defines.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include <user_ta_header.h>
+
+#include "TTA_Time_protocol.h"
+
+#define TA_UUID TA_TTA_TIME_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE)
+#define TA_STACK_SIZE (2 * 1024)
+#define TA_DATA_SIZE (32 * 1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "gpd.ta.description", USER_TA_PROP_TYPE_STRING, \
+ "TTA_testingInternalAPI_Time v0.6" },
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time.c.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time.c.patch
new file mode 100644
index 0000000..e66fb85
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time.c.patch
@@ -0,0 +1,67 @@
+--- TTA_Time.c.orig 2015-02-13 04:29:50.534030595 +0100
++++ TTA_Time.c 2015-02-13 04:30:51.422333265 +0100
+@@ -89,6 +89,17 @@
+ SLogTrace("TA_CloseSessionEntryPoint");
+ }
+
++static TEE_Result check_time(TEE_Time *nLocalTime1, TEE_Time *nLocalTime2,
++ uint32_t min, uint32_t max)
++{
++ uint32_t e = ((nLocalTime2->seconds * 1000) + nLocalTime2->millis) -
++ ((nLocalTime1->seconds * 1000) + nLocalTime1->millis);
++
++ if ((min <= e) && (e <= max))
++ return TEE_SUCCESS;
++ else
++ return TEE_ERROR_GENERIC;
++}
+
+ TEE_Result CmdTEEGetSystemTime(
+ void* pSessionContext,
+@@ -103,15 +114,7 @@
+ TEE_Wait(1000);
+ TEE_GetSystemTime(&nLocalTime2);
+
+- if(nLocalTime2.seconds > nLocalTime1.seconds)
+- {
+- if((nLocalTime2.seconds - nLocalTime1.seconds) < (uint32_t) 2)
+- return TEE_SUCCESS;
+- else
+- return TEE_ERROR_GENERIC;
+- }
+- else
+- return TEE_ERROR_GENERIC;
++ return check_time(&nLocalTime1, &nLocalTime2, 990, 1300);
+ }
+
+
+@@ -174,11 +177,7 @@
+ TEE_SetTAPersistentTime(&nLocalTime1);
+ TEE_GetTAPersistentTime(&nLocalTime2);
+
+- if((nLocalTime1.seconds = nLocalTime2.seconds) &&
+- (nLocalTime2.millis < 100))
+- return TEE_SUCCESS;
+- else
+- return TEE_ERROR_GENERIC;
++ return check_time(&nLocalTime1, &nLocalTime2, 0, 100);
+ }
+
+ TEE_Result CmdTEESetTAPersistentTimeAndGetTAPersistentTimeOverflow(
+@@ -244,15 +243,7 @@
+ TEE_Wait(1000);
+ TEE_GetREETime(&nLocalTime2);
+
+- if(nLocalTime2.seconds > nLocalTime1.seconds)
+- {
+- if((nLocalTime2.seconds - nLocalTime1.seconds) < (uint32_t) 2)
+- return TEE_SUCCESS;
+- else
+- return TEE_ERROR_GENERIC;
+- }
+- else
+- return TEE_ERROR_GENERIC;
++ return check_time(&nLocalTime1, &nLocalTime2, 990, 1300);
+ }
+
+ /**
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time_protocol.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time_protocol.h.patch
new file mode 100644
index 0000000..4fd2c49
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time_protocol.h.patch
@@ -0,0 +1,10 @@
+--- TTA_Time_protocol.h.ori 2015-02-02 14:38:05.506342966 +0100
++++ TTA_Time_protocol.h 2015-02-02 14:38:18.890433256 +0100
+@@ -1,6 +1,6 @@
+
+ /** Trusted Application Identifier **/
+-#define TA_UUID { 0x534D4152, 0x5443, 0x534C, { 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x41, 0x50, 0x49 } }
++#define TA_TTA_TIME_UUID { 0x534D4152, 0x5443, 0x534C, { 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x41, 0x50, 0x49 } }
+
+
+ #define TRUSTED_APP_ERROR_UNKNOWN_COMMAND 0x00000001
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_6000.c.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_6000.c.patch
new file mode 100644
index 0000000..c435ead
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_6000.c.patch
@@ -0,0 +1,367 @@
+--- xtest_6000.c 2015-06-12 09:22:13.169957949 +0200
++++ xtest_6000.c.wgp 2015-06-11 15:39:38.787757845 +0200
+@@ -22,6 +22,7 @@
+ #include <ta_storage.h>
+ #include <tee_api_defines.h>
+ #include <tee_api_types.h>
++#include <TTA_DS_protocol.h>
+
+ static uint8_t file_00[] = {
+ 0x00, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
+@@ -286,6 +287,160 @@
+ return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_NEXT_ENUM, &op, &org);
+ }
+
++static TEEC_Result ds_open_access_conf(TEEC_Session *sess)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
++
++ return TEEC_InvokeCommand(
++ sess, CMD_CreatePersistentObject_AccessConflict, &op, &org);
++}
++
++static TEEC_Result ds_res_obj_panic(TEEC_Session *sess)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
++
++ return TEEC_InvokeCommand(
++ sess, CMD_RestrictObjectUsagePanic, &op, &org);
++}
++
++static TEEC_Result ds_seek_obj_inv_handle(TEEC_Session *sess)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
++
++ op.params[0].value.a = CASE_DATA_OBJECT_NOT_PERSISTENT;
++
++ return TEEC_InvokeCommand(
++ sess, CMD_SeekObjectData_panic, &op, &org);
++}
++
++static TEEC_Result ds_seek_obj_bad_handle(TEEC_Session *sess)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
++
++ op.params[0].value.a = CASE_DATA_BAD_HANDLE;
++
++ return TEEC_InvokeCommand(
++ sess, CMD_SeekObjectData_panic, &op, &org);
++}
++
++static TEEC_Result ds_seek_gp(
++ TEEC_Session *sess, TEE_Whence wh, uint32_t wh_off, uint32_t set_off,
++ void *in, size_t in_size, void *out, size_t out_size)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_VALUE_INPUT, TEEC_VALUE_INPUT, TEEC_MEMREF_TEMP_INPUT,
++ TEEC_MEMREF_TEMP_OUTPUT);
++
++ op.params[0].value.a = wh;
++ op.params[0].value.b = wh_off;
++ op.params[1].value.a = set_off;
++ op.params[2].tmpref.buffer = in;
++ op.params[2].tmpref.size = in_size;
++ op.params[3].tmpref.buffer = out;
++ op.params[3].tmpref.size = out_size;
++
++ return TEEC_InvokeCommand(sess, CMD_SeekWriteReadObjectData, &op, &org);
++}
++
++static TEEC_Result ds_init_object_and_attributes(TEEC_Session *sess,
++ uint32_t obj_type, uint32_t obj_size, const void *attr_meta,
++ size_t attr_meta_len, const void *attr_data, size_t attr_data_len,
++ uint32_t option)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_VALUE_INPUT, TEEC_MEMREF_TEMP_INPUT,
++ TEEC_MEMREF_TEMP_INPUT, TEEC_VALUE_INPUT);
++
++ op.params[0].value.a = obj_type;
++ op.params[0].value.b = obj_size;
++ op.params[1].tmpref.buffer = (void *)attr_meta;
++ op.params[1].tmpref.size = attr_meta_len;
++ op.params[2].tmpref.buffer = (void *)attr_data;
++ op.params[2].tmpref.size = attr_data_len;
++ op.params[3].value.a = option;
++
++ return TEEC_InvokeCommand(sess, CMD_InitObjectAndAttributes, &op, &org);
++}
++
++static TEEC_Result ds_rename_access_conflict(TEEC_Session *sess)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
++
++ return TEEC_InvokeCommand(
++ sess, CMD_RenamePersistentObject_AccessConflict, &op, &org);
++}
++
++static TEEC_Result ds_start_enum_no_item(TEEC_Session *sess)
++{
++ TEEC_Operation op;
++ uint32_t org;
++ TEEC_Result res;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_VALUE_OUTPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
++
++ res = TEEC_InvokeCommand(
++ sess, CMD_StartNGetPersistentObjectEnumerator_itemNotFound, &op, &org);
++
++ if (res != TEEC_SUCCESS)
++ return res;
++
++ if (op.params[0].value.a != 0 || op.params[0].value.b != 0)
++ return TEEC_ERROR_GENERIC;
++
++ return res;
++}
++
++static TEEC_Result ds_rename_success(TEEC_Session *sess)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
++
++ return TEEC_InvokeCommand(
++ sess, CMD_RenamePersistentObject_Success, &op, &org);
++}
++
++static TEEC_Result ds_null_close_free_reset(TEEC_Session *sess)
++{
++ TEEC_Operation op;
++ uint32_t org;
++
++ op.paramTypes = TEEC_PARAM_TYPES(
++ TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
++
++ return TEEC_InvokeCommand(
++ sess, CMD_CloseFreeAndResetObjectSuccessHandleNull, &op, &org);
++}
++
+ /* create */
+ static void xtest_tee_test_6001(ADBG_Case_t *c)
+ {
+@@ -735,6 +890,167 @@
+ TEEC_CloseSession(&sess);
+ }
+
++static void xtest_tee_test_6010(ADBG_Case_t *c)
++{
++ TEEC_Session sess;
++ uint32_t orig;
++ uint8_t out[4000] = {0};
++ uint8_t in[0x12c] = {'b'};
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(
++ c, xtest_teec_open_session(
++ &sess, &gp_tta_ds_uuid, NULL, &orig)))
++ return;
++
++ Do_ADBG_BeginSubCase(
++ c, "GP DS CreatePersistentObject AccessConflict (9d-1d-62)");
++
++ if (!ADBG_EXPECT_TEEC_RESULT(
++ c, TEEC_ERROR_ACCESS_CONFLICT, ds_open_access_conf(&sess)))
++ goto exit;
++
++ Do_ADBG_EndSubCase(
++ c, "GP DS CreatePersistentObject AccessConflict (9d-1d-62)");
++ Do_ADBG_BeginSubCase(
++ c, "GP DS RestrictObjectUsagePanic (9d-5d-46)");
++
++ if (!ADBG_EXPECT_TEEC_RESULT(
++ c, TEE_ERROR_TARGET_DEAD, ds_res_obj_panic(&sess)))
++ goto exit;
++
++ TEEC_CloseSession(&sess);
++
++ Do_ADBG_EndSubCase(
++ c, "GP DS RestrictObjectUsagePanic (9d-5d-46)");
++ Do_ADBG_BeginSubCase(
++ c, "GP DS SeekObjectData BadHandle (9d-c3-c8)");
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(
++ c, xtest_teec_open_session(
++ &sess, &gp_tta_ds_uuid, NULL, &orig)))
++ return;
++
++ if (!ADBG_EXPECT_TEEC_RESULT(
++ c, TEE_ERROR_TARGET_DEAD, ds_seek_obj_bad_handle(&sess)))
++ goto exit;
++
++ TEEC_CloseSession(&sess);
++
++ Do_ADBG_EndSubCase(
++ c, "GP DS SeekObjectData BadHandle (9d-c3-c8)");
++ Do_ADBG_BeginSubCase(
++ c, "GP DS SeekObjectData NotPersist (9d-db-4a)");
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(
++ c, xtest_teec_open_session(
++ &sess, &gp_tta_ds_uuid, NULL, &orig)))
++ return;
++
++ if (!ADBG_EXPECT_TEEC_RESULT(
++ c, TEE_ERROR_TARGET_DEAD, ds_seek_obj_inv_handle(&sess)))
++ goto exit;
++
++ TEEC_CloseSession(&sess);
++
++ Do_ADBG_EndSubCase(
++ c, "GP DS SeekObjectData NotPersist (9d-db-4a)");
++ Do_ADBG_BeginSubCase(c, "GP DS SeekWriteRead SEEK_END (9d-e4-58)");
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(
++ c, xtest_teec_open_session(
++ &sess, &gp_tta_ds_uuid, NULL, &orig)))
++ return;
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(
++ c, ds_seek_gp(
++ &sess, TEE_DATA_SEEK_END, 0, 2, data_00, sizeof(data_00), out,
++ sizeof(out))))
++ goto exit;
++
++ /* check buffer */
++ (void)ADBG_EXPECT_BUFFER(
++ c, data_00, sizeof(data_00), out, sizeof(data_00));
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(
++ c, ds_seek_gp(
++ &sess, TEE_DATA_SEEK_END, sizeof(in), 0, in, sizeof(in), out,
++ sizeof(out))))
++ goto exit;
++
++ (void)ADBG_EXPECT_BUFFER(c, in + sizeof(in), sizeof(in), out, sizeof(in));
++
++ Do_ADBG_EndSubCase(c, "GP DS SeekWriteRead SEEK_END (9d-e4-58)");
++ Do_ADBG_BeginSubCase(c, "GP DS Rename Access Conflict (9d-29-d1)");
++
++ if (!ADBG_EXPECT_TEEC_RESULT(
++ c, TEE_ERROR_ACCESS_CONFLICT, ds_rename_access_conflict(&sess)))
++ goto exit;
++
++ Do_ADBG_EndSubCase(c, "GP DS Rename Access Conflict (9d-29-d1)");
++ Do_ADBG_BeginSubCase(
++ c, "GP DS StartPersistentObjectEnumerator ItemNotFound (9d-52-ec)");
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(c, ds_start_enum_no_item(&sess)))
++ goto exit;
++
++ Do_ADBG_EndSubCase(
++ c, "GP DS StartPersistentObjectEnumerator ItemNotFound (9d-52-ec)");
++ Do_ADBG_BeginSubCase(
++ c, "GP DS RenamePersistent ReadWrite (9d-19-88)");
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(c, ds_rename_success(&sess)))
++ goto exit;
++
++ Do_ADBG_EndSubCase(
++ c, "GP DS RenamePersistent ReadWrite (9d-19-88)");
++ Do_ADBG_BeginSubCase(
++ c, "GP DS Close Free Reset Null (9d-6d-87)");
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(c, ds_null_close_free_reset(&sess)))
++ goto exit;
++
++ Do_ADBG_EndSubCase(
++ c, "GP DS Close Free Reset Null (9d-6d-87)");
++
++exit:
++ TEEC_CloseSession(&sess);
++}
++
++static void xtest_tee_test_6011(ADBG_Case_t *c)
++{
++ TEEC_Session sess;
++ uint32_t orig;
++ /*
++ * Test data from
++ * Invoke_InitObjectAndAttributes_TEE_TYPE_AES_success_attribute_
++ * TEE_ATTR_SECRET_VALUE_correct_size (9d-9a-91)
++ */
++ static const uint8_t attr_meta[] = {
++0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
++ };
++ static const uint8_t attr_data[] = {
++0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe,0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,
++0x81,0x1f,0x35,0x2c,0x07,0x3b,0x61,0x08,0xd7,0x2d,0x98,0x10,0xa3,0x09,0x14,
++0xdf,0xf4,
++ };
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(
++ c, xtest_teec_open_session(
++ &sess, &gp_tta_ds_uuid, NULL, &orig)))
++ return;
++
++ if (!ADBG_EXPECT_TEEC_SUCCESS(c, ds_init_object_and_attributes(&sess,
++ 0xa0000010, 0x100, attr_meta, sizeof(attr_meta), attr_data,
++ sizeof(attr_data), 0)))
++ goto exit;
++
++exit:
++ TEEC_CloseSession(&sess);
++}
++
+ ADBG_CASE_DEFINE(
+ XTEST_TEE_6001, xtest_tee_test_6001,
+ /* Title */
+@@ -842,3 +1158,27 @@
+ /* How to implement */
+ "Description of how to implement ..."
+ );
++
++ADBG_CASE_DEFINE(
++ XTEST_TEE_6010, xtest_tee_test_6010,
++ /* Title */
++ "Test TEE GP TTA DS storage",
++ /* Short description */
++ "Short description ...",
++ /* Requirement IDs */
++ "TEE-??",
++ /* How to implement */
++ "Description of how to implement ..."
++);
++
++ADBG_CASE_DEFINE(
++ XTEST_TEE_6011, xtest_tee_test_6011,
++ /* Title */
++ "Test TEE GP TTA DS init objects",
++ /* Short description */
++ "Short description ...",
++ /* Requirement IDs */
++ "TEE-??",
++ /* How to implement */
++ "Description of how to implement ..."
++);
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_main.c.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_main.c.patch
new file mode 100644
index 0000000..5d786ed
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_main.c.patch
@@ -0,0 +1,11 @@
+--- xtest_main.c 2015-06-12 09:22:13.169957949 +0200
++++ xtest_main.c.wgp 2015-06-11 15:39:44.947807778 +0200
+@@ -53,6 +53,8 @@
+ ADBG_SUITE_ENTRY(XTEST_TEE_6007, NULL)
+ ADBG_SUITE_ENTRY(XTEST_TEE_6008, NULL)
+ ADBG_SUITE_ENTRY(XTEST_TEE_6009, NULL)
++ADBG_SUITE_ENTRY(XTEST_TEE_6010, NULL)
++ADBG_SUITE_ENTRY(XTEST_TEE_6011, NULL)
+ ADBG_SUITE_ENTRY(XTEST_TEE_7001, NULL)
+ /* FVP ADBG_SUITE_ENTRY(XTEST_TEE_7002, NULL) */
+ ADBG_SUITE_ENTRY(XTEST_TEE_7003, NULL)
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_test.c.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_test.c.patch
new file mode 100644
index 0000000..788792e
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_test.c.patch
@@ -0,0 +1,17 @@
+--- xtest_test.c 2015-06-12 09:22:13.169957949 +0200
++++ xtest_test.c.wgp 2015-06-11 15:39:51.883864032 +0200
+@@ -21,6 +21,8 @@
+ #include <ta_storage.h>
+ #include <enc_fs_key_manager_test.h>
+ #include <tee_api_defines.h>
++#include <tee_api_types.h>
++#include <TTA_DS_protocol.h>
+
+ ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_Result)
+ ADBG_ENUM_TABLE_ENTRY(TEEC_SUCCESS),
+@@ -74,4 +76,5 @@
+ const TEEC_UUID sims_test_ta_uuid = TA_SIMS_TEST_UUID;
+ const TEEC_UUID storage_ta_uuid = TA_STORAGE_UUID;
+ const TEEC_UUID enc_fs_key_manager_test_ta_uuid = ENC_FS_KEY_MANAGER_TEST_UUID;
++const TEEC_UUID gp_tta_ds_uuid = TA_TTA_DS_UUID;
+
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_test.h.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_test.h.patch
new file mode 100644
index 0000000..3beb0b4
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/host/xtest/xtest_test.h.patch
@@ -0,0 +1,11 @@
+--- xtest_test.h 2015-06-12 09:22:13.169957949 +0200
++++ xtest_test.h.wgp 2015-06-11 15:39:59.443925397 +0200
+@@ -53,6 +53,8 @@
+ ADBG_CASE_DECLARE(XTEST_TEE_6007);
+ ADBG_CASE_DECLARE(XTEST_TEE_6008);
+ ADBG_CASE_DECLARE(XTEST_TEE_6009);
++ADBG_CASE_DECLARE(XTEST_TEE_6010);
++ADBG_CASE_DECLARE(XTEST_TEE_6011);
+ ADBG_CASE_DECLARE(XTEST_TEE_7001);
+ ADBG_CASE_DECLARE(XTEST_TEE_7002);
+ ADBG_CASE_DECLARE(XTEST_TEE_7003);
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Adbg/xslstable/adbg_case_declare.xsl b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Adbg/xslstable/adbg_case_declare.xsl
new file mode 100644
index 0000000..0300bb7
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Adbg/xslstable/adbg_case_declare.xsl
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Copyright (c) 2014, STMicroelectronics International N.V. -->
+<!-- All rights reserved. -->
+<!-- -->
+<!-- Redistribution and use in source and binary forms, with or without -->
+<!-- modification, are permitted provided that the following conditions are met: -->
+<!-- -->
+<!-- 1. Redistributions of source code must retain the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer. -->
+<!-- -->
+<!-- 2. Redistributions in binary form must reproduce the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer in the documentation -->
+<!-- and/or other materials provided with the distribution. -->
+<!-- -->
+<!-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -->
+<!-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -->
+<!-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -->
+<!-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -->
+<!-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
+<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
+<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -->
+<!-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -->
+<!-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -->
+<!-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -->
+<!-- POSSIBILITY OF SUCH DAMAGE. -->
+
+<xsl:stylesheet version="1.0"
+xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="text"/>
+<xsl:strip-space elements="*"/>
+<xsl:param name="target"/>
+<xsl:param name="f2" select="'TEE_DataStorage_API.xml'"/>
+<xsl:param name="f3" select="'TEE_Internal_API.xml'"/>
+<xsl:param name="f4" select="'TEE_TimeArithm_API.xml'"/>
+<xsl:param name="f5" select="'TEE_Crypto_API.xml'"/>
+<xsl:variable name="doc2" select="document($f2)"/>
+<xsl:variable name="doc3" select="document($f3)"/>
+<xsl:variable name="doc4" select="document($f4)"/>
+<xsl:variable name="doc5" select="document($f5)"/>
+
+<xsl:template match="package">
+<xsl:text>/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ADBG_CASE_DECLARE_H
+#define ADBG_CASE_DECLARE_H
+
+#define ADBG_CASE_DECLARE_AUTO_GENERATED_TESTS() \
+</xsl:text>
+<xsl:for-each select="initial-state/scenario">
+<xsl:variable name="position" select="position()" />ADBG_CASE_DECLARE(XTEST_TEE_<xsl:value-of select="$position+7000" />);\
+</xsl:for-each>
+<xsl:text>\
+</xsl:text>
+<xsl:for-each select="$doc2/package/initial-state/scenario">
+<xsl:variable name="position" select="position()" />ADBG_CASE_DECLARE(XTEST_TEE_<xsl:value-of select="$position+7500" />);\
+</xsl:for-each>
+<xsl:text>\
+</xsl:text>
+<xsl:for-each select="$doc3/package/initial-state/scenario">
+<xsl:variable name="position" select="position()" />ADBG_CASE_DECLARE(XTEST_TEE_<xsl:value-of select="$position+8000" />);\
+</xsl:for-each>
+<xsl:text>\
+</xsl:text>
+<xsl:for-each select="$doc4/package/initial-state/scenario">
+<xsl:variable name="position" select="position()" />ADBG_CASE_DECLARE(XTEST_TEE_<xsl:value-of select="$position+8500" />);\
+</xsl:for-each>
+<xsl:text>\
+</xsl:text>
+<xsl:for-each select="$doc5/package/initial-state/scenario">
+<xsl:variable name="position" select="position()" />ADBG_CASE_DECLARE(XTEST_TEE_<xsl:value-of select="$position+9000" />);\
+</xsl:for-each>
+/* end of case declarations */
+
+<xsl:text>
+#endif /*ADBG_CASE_DECLARE_H*/</xsl:text>
+</xsl:template>
+</xsl:stylesheet>
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Adbg/xslstable/adbg_entry_declare.xsl b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Adbg/xslstable/adbg_entry_declare.xsl
new file mode 100644
index 0000000..ee5ed3f
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Adbg/xslstable/adbg_entry_declare.xsl
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Copyright (c) 2014, STMicroelectronics International N.V. -->
+<!-- All rights reserved. -->
+<!-- -->
+<!-- Redistribution and use in source and binary forms, with or without -->
+<!-- modification, are permitted provided that the following conditions are met: -->
+<!-- -->
+<!-- 1. Redistributions of source code must retain the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer. -->
+<!-- -->
+<!-- 2. Redistributions in binary form must reproduce the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer in the documentation -->
+<!-- and/or other materials provided with the distribution. -->
+<!-- -->
+<!-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -->
+<!-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -->
+<!-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -->
+<!-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -->
+<!-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
+<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
+<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -->
+<!-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -->
+<!-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -->
+<!-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -->
+<!-- POSSIBILITY OF SUCH DAMAGE. -->
+
+<xsl:stylesheet version="1.0"
+xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="text"/>
+<xsl:strip-space elements="*"/>
+<xsl:param name="target"/>
+<xsl:param name="f2" select="'TEE_DataStorage_API.xml'"/>
+<xsl:param name="f3" select="'TEE_Internal_API.xml'"/>
+<xsl:param name="f4" select="'TEE_TimeArithm_API.xml'"/>
+<xsl:param name="f5" select="'TEE_Crypto_API.xml'"/>
+<xsl:variable name="doc2" select="document($f2)"/>
+<xsl:variable name="doc3" select="document($f3)"/>
+<xsl:variable name="doc4" select="document($f4)"/>
+<xsl:variable name="doc5" select="document($f5)"/>
+
+<xsl:template match="package">
+<xsl:text>/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ADBG_ENTRY_DECLARE_H
+#define ADBG_ENTRY_DECLARE_H
+
+#define ADBG_ENTRY_AUTO_GENERATED_TESTS() \
+</xsl:text>
+<xsl:for-each select="initial-state/scenario">
+<xsl:variable name="position" select="position()" /> ADBG_SUITE_ENTRY(XTEST_TEE_<xsl:value-of select="$position+7000" />, NULL)\
+</xsl:for-each>
+<xsl:text>\
+</xsl:text>
+<xsl:for-each select="$doc2/package/initial-state/scenario">
+<xsl:variable name="position" select="position()" /> ADBG_SUITE_ENTRY(XTEST_TEE_<xsl:value-of select="$position+7500" />, NULL)\
+</xsl:for-each>
+<xsl:text>\
+</xsl:text>
+<xsl:for-each select="$doc3/package/initial-state/scenario">
+<xsl:variable name="position" select="position()" /> ADBG_SUITE_ENTRY(XTEST_TEE_<xsl:value-of select="$position+8000" />, NULL)\
+</xsl:for-each>
+<xsl:text>\
+</xsl:text>
+<xsl:for-each select="$doc4/package/initial-state/scenario">
+<xsl:variable name="position" select="position()" /> ADBG_SUITE_ENTRY(XTEST_TEE_<xsl:value-of select="$position+8500" />, NULL)\
+</xsl:for-each>
+<xsl:text>\
+</xsl:text>
+<xsl:for-each select="$doc5/package/initial-state/scenario">
+<xsl:variable name="position" select="position()" /> ADBG_SUITE_ENTRY(XTEST_TEE_<xsl:value-of select="$position+9000" />, NULL)\
+</xsl:for-each>
+<xsl:text>
+/* end of entry declarations */
+
+#endif /*ADBG_ENTRY_DECLARE_H*/
+</xsl:text>
+</xsl:template>
+</xsl:stylesheet>
+
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/ClientAPI/xmlpatch/v1_1_0_4-2014_11_07/TEE.xml.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/ClientAPI/xmlpatch/v1_1_0_4-2014_11_07/TEE.xml.patch
new file mode 100644
index 0000000..37e7617
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/ClientAPI/xmlpatch/v1_1_0_4-2014_11_07/TEE.xml.patch
@@ -0,0 +1,77 @@
+--- TEE.xml.ori 2015-02-02 13:57:45.590079070 +0100
++++ TEE.xml 2015-02-03 13:23:03.634329563 +0100
+@@ -1962,7 +1962,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2096,7 +2096,10 @@
+ </operation>
+ <observations />
+ </call>
+- <call>
++ <!--To cover the cases when second thread needs to be involved.
++ There is only one case which needs to much effort for the benefit
++ of autogen -->
++ <!--call>
+ <class name="TEE_Client_API" />
+ <instance name="SUT" />
+ <operation name="InitializeContext">
+@@ -2108,7 +2111,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2125,8 +2128,22 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
++ </argument>
++ </operation>
++ <observations />
++ </call-->
++ <call>
++ <class name="TEE_Client_API" />
++ <instance name="SUT" />
++ <operation name="ctx_init_finalize">
++
++ <argument>
++ <parameter name="IN_context" />
++ <type name="ALL_CONTEXTS" />
++ <value name="thr2_ctx" />
+ </argument>
++
+ </operation>
+ <observations />
+ </call>
+@@ -8425,6 +8442,7 @@
+ <value name="VALUE02" />
+ </argument>
+ </operation>
++
+ <observations />
+ </call>
+ <call>
+@@ -8615,6 +8633,12 @@
+ <value name="OPERATION01" />
+ </argument>
+ <argument>
++ <!-- ReturnOrigin was missing here. Added manually! -->
++ <parameter name="OUT_expectedReturnOrigin" />
++ <type name="ALL_RETURN_ORIGINS" />
++ <value name="NULL" />
++ </argument>
++ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+ <type name="ALL_RETURN_CODES" />
+ <value name="TEEC_ERROR_CANCEL" />
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/ClientAPI/xslstable/TEE.xsl b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/ClientAPI/xslstable/TEE.xsl
new file mode 100644
index 0000000..4d01dcd
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/ClientAPI/xslstable/TEE.xsl
@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Copyright (c) 2014, STMicroelectronics International N.V. -->
+<!-- All rights reserved. -->
+<!-- -->
+<!-- Redistribution and use in source and binary forms, with or without -->
+<!-- modification, are permitted provided that the following conditions are met: -->
+<!-- -->
+<!-- 1. Redistributions of source code must retain the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer. -->
+<!-- -->
+<!-- 2. Redistributions in binary form must reproduce the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer in the documentation -->
+<!-- and/or other materials provided with the distribution. -->
+<!-- -->
+<!-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -->
+<!-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -->
+<!-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -->
+<!-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -->
+<!-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
+<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
+<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -->
+<!-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -->
+<!-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -->
+<!-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -->
+<!-- POSSIBILITY OF SUCH DAMAGE. -->
+
+<xsl:stylesheet version="1.0"
+xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="text"/>
+<xsl:strip-space elements="*"/>
+<xsl:param name="target"/>
+
+<xsl:template match="package">
+<xsl:text>
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+#include "tee_internal_api.h"
+#include "ta_testingClientAPI_test.h"
+#undef TA_UUID
+#include "ta_answerSuccessTo_OpenSession_Invoke_test.h"
+#undef TA_UUID
+#include "tee_api_defines.h"
+#include "tee_client_api.h"
+#include "xml_client_api.h"
+
+static bool xtest_init = false;
+
+</xsl:text>
+static bool xtest_tee_init(ADBG_Case_t *c)
+{
+ if (xtest_init) {
+ return true;
+ }
+ SHARE_MEM01 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM01)) {
+ goto exit;
+ }
+ SHARE_MEM02 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM02)) {
+ goto exit;
+ }
+ SESSION01 = malloc(sizeof(TEEC_Session));
+ if (!ADBG_EXPECT_NOT_NULL(c, SESSION01)) {
+ goto exit;
+ }
+ CONTEXT01 = malloc(sizeof(TEEC_Context));
+ if (!ADBG_EXPECT_NOT_NULL(c, CONTEXT01)) {
+ goto exit;
+ }
+ OPERATION01 = malloc(sizeof(TEEC_Operation));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION01)) {
+ goto exit;
+ }
+ OPERATION02 = malloc(sizeof(TEEC_Operation));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION02)) {
+ goto exit;
+ }
+
+ xtest_init = true;
+
+ return xtest_init;
+
+exit:
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+ if (OPERATION02) {
+ free(OPERATION02);
+ OPERATION02 = NULL;
+ }
+
+ xtest_init = false;
+ return xtest_init;
+}
+
+static void xtest_tee_deinit(void)
+{
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+ if (OPERATION02) {
+ free(OPERATION02);
+ OPERATION02 = NULL;
+ }
+
+ xtest_init = false;
+}
+
+
+
+<xsl:for-each select="initial-state/scenario">
+/*<xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" />*/
+static void xtest_tee_<xsl:value-of select="position()+7000" />(ADBG_Case_t *c)
+{
+<xsl:text> if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return ;
+</xsl:text>
+<xsl:for-each select="./body/call/operation">
+ <xsl:apply-templates select="."></xsl:apply-templates>
+</xsl:for-each>
+<xsl:if test="position()=last()"><xsl:text> xtest_tee_deinit();</xsl:text></xsl:if>
+}
+</xsl:for-each>
+
+<xsl:for-each select="initial-state/scenario">
+<xsl:variable name="position" select="position()+7000" />
+ADBG_CASE_DEFINE(XTEST_TEE_<xsl:value-of select="$position" />, xtest_tee_<xsl:value-of select="$position" /><xsl:text>,
+ /* Title */
+ "</xsl:text><xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" /><xsl:text>",
+ /* Short description */
+ "</xsl:text><xsl:value-of select="substring-before(./@name, ' ')" /><xsl:text>",
+ /* Requirement IDs */
+ "</xsl:text><xsl:value-of select="./req[last()]/@name" /><xsl:text>",
+ /* How to implement */
+ "Description of how to implement ...");</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match="operation">
+<xsl:choose>
+<!--Call an operation with ADBG_EXPECT() macro.-->
+<xsl:when test="(contains(./argument[last()]/parameter/@name, 'xpected') and not(contains(./@name, 'Invoke')) and not(contains(./@name, 'checkMemoryContent_sharedMemory')) and not(contains(./@name, 'checkMemoryContent_tmpMemory')) and not(contains(./@name, 'checkContent_Parameter_value')) and not(contains(./@name, 'OpenSession')) and not(contains(./@name, 'InitializeContext')))"> ADBG_EXPECT(c, <xsl:for-each select="./argument"><xsl:if test="position()=last()"><xsl:apply-templates select="value"></xsl:apply-templates></xsl:if></xsl:for-each>, <xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument/value"><xsl:if test="position()>1 and not(position()=last())">, </xsl:if><xsl:if test="not(position()=last())"><xsl:apply-templates select="."></xsl:apply-templates></xsl:if>
+ </xsl:for-each>));
+</xsl:when>
+<xsl:otherwise>
+<xsl:text> </xsl:text><xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument"><xsl:if test="position()>1">, </xsl:if>
+ <xsl:apply-templates select="./value"></xsl:apply-templates>
+ </xsl:for-each>);
+</xsl:otherwise>
+</xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="value">
+<xsl:choose>
+<!--xsl:when test=".='IN_sharedMem_size'"><xsl:value-of select="./@name" />
+</xsl:when-->
+<xsl:when test="(contains(./@name, 'UUID'))"><xsl:text>&</xsl:text><xsl:value-of select="./@name" />
+</xsl:when>
+<xsl:when test="(../type/@name='ALL_TEE_NAMES' and ./@name='NULL')"><xsl:text>_device</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<!--xsl:text>&</xsl:text--><xsl:value-of select="./@name" />
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="parameter">
+ <xsl:value-of select="./@name" />
+</xsl:template>
+
+<xsl:template match="@name">
+<xsl:choose>
+<xsl:when test=".='ctx_init_finalize'"><xsl:text>thr2_ctx.c = c;
+ thr2_ctx.ctx = CONTEXT01;
+ </xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='RequestCancellation'"><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='InitializeContext'"><xsl:text>XML_</xsl:text><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:when test=".='OpenSession'"><xsl:text>XML_</xsl:text><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:when test=".='Invoke_Remember_Expected_ParamTypes'"><xsl:text>INVOKE_REMEMBER_EXP_PARAM_TYPES</xsl:text><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='AllocateSharedMemory'"><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='RegisterSharedMemory'"><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='AllocateTempMemory'"><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='ReleaseTempMemory'"><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='PARAM_TYPES'"><xsl:text>OPERATION_TEEC_PARAM_TYPES</xsl:text><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test="(contains(., 'Invoke') and not(contains(., 'Remember_Expected_ParamTypes')))"><xsl:text>XML_InvokeCommand</xsl:text><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Crypto/xmlpatch/v1_1_0_4-2014_11_07/TEE_Crypto_API.xml.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Crypto/xmlpatch/v1_1_0_4-2014_11_07/TEE_Crypto_API.xml.patch
new file mode 100644
index 0000000..a37a361
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Crypto/xmlpatch/v1_1_0_4-2014_11_07/TEE_Crypto_API.xml.patch
@@ -0,0 +1,6896 @@
+--- TEE_Crypto_API.xml.ori 2015-02-02 22:03:08.838687815 +0100
++++ TEE_Crypto_API.xml 2015-02-02 23:26:54.692477486 +0100
+@@ -36,7 +36,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -53,7 +53,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -159,7 +159,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -202,7 +202,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -219,7 +219,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -325,7 +325,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -368,7 +368,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -385,7 +385,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -491,7 +491,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -534,7 +534,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -551,7 +551,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -657,7 +657,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -700,7 +700,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -717,7 +717,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -823,7 +823,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -866,7 +866,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -883,7 +883,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -989,7 +989,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1032,7 +1032,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1049,7 +1049,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1155,7 +1155,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1198,7 +1198,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1215,7 +1215,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1321,7 +1321,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1364,7 +1364,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1381,7 +1381,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1487,7 +1487,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1530,7 +1530,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1547,7 +1547,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1653,7 +1653,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1696,7 +1696,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1713,7 +1713,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1819,7 +1819,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1862,7 +1862,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1879,7 +1879,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1985,7 +1985,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2028,7 +2028,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2045,7 +2045,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2151,7 +2151,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2194,7 +2194,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2211,7 +2211,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2317,7 +2317,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2360,7 +2360,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2377,7 +2377,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2483,7 +2483,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2526,7 +2526,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2543,7 +2543,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2649,7 +2649,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2692,7 +2692,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2709,7 +2709,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2815,7 +2815,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2858,7 +2858,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2875,7 +2875,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2981,7 +2981,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3024,7 +3024,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3041,7 +3041,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3147,7 +3147,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3190,7 +3190,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3207,7 +3207,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3313,7 +3313,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3356,7 +3356,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3373,7 +3373,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3479,7 +3479,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3522,7 +3522,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3539,7 +3539,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3645,7 +3645,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3688,7 +3688,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3705,7 +3705,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3811,7 +3811,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3854,7 +3854,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3871,7 +3871,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3977,7 +3977,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4020,7 +4020,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4037,7 +4037,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4143,7 +4143,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4186,7 +4186,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4203,7 +4203,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4309,7 +4309,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4352,7 +4352,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4369,7 +4369,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4475,7 +4475,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4518,7 +4518,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4535,7 +4535,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4641,7 +4641,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4684,7 +4684,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4701,7 +4701,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4807,7 +4807,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4850,7 +4850,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4867,7 +4867,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4973,7 +4973,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5016,7 +5016,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5033,7 +5033,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5139,7 +5139,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5182,7 +5182,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5199,7 +5199,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5305,7 +5305,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5348,7 +5348,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5365,7 +5365,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5471,7 +5471,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5514,7 +5514,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5531,7 +5531,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5637,7 +5637,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5680,7 +5680,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5697,7 +5697,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5803,7 +5803,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5846,7 +5846,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5863,7 +5863,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5969,7 +5969,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6012,7 +6012,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6029,7 +6029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6135,7 +6135,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6178,7 +6178,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6195,7 +6195,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6301,7 +6301,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6344,7 +6344,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6361,7 +6361,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6467,7 +6467,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6510,7 +6510,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6527,7 +6527,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6633,7 +6633,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6676,7 +6676,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6693,7 +6693,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6799,7 +6799,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6842,7 +6842,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6859,7 +6859,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6965,7 +6965,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7008,7 +7008,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7025,7 +7025,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7131,7 +7131,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7174,7 +7174,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7191,7 +7191,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7297,7 +7297,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7340,7 +7340,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7357,7 +7357,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7463,7 +7463,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7506,7 +7506,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7523,7 +7523,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7629,7 +7629,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7672,7 +7672,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7689,7 +7689,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7795,7 +7795,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7838,7 +7838,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7855,7 +7855,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7961,7 +7961,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8004,7 +8004,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8021,7 +8021,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8127,7 +8127,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8170,7 +8170,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8187,7 +8187,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8293,7 +8293,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8336,7 +8336,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8353,12 +8353,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -8400,7 +8400,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -8447,7 +8447,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8459,7 +8459,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8504,7 +8504,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8521,7 +8521,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8956,7 +8956,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8997,7 +8997,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9014,7 +9014,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9439,7 +9439,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9482,7 +9482,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9499,7 +9499,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9769,7 +9769,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9813,7 +9813,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9830,7 +9830,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10147,7 +10147,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10190,7 +10190,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10207,7 +10207,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10524,7 +10524,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10568,7 +10568,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10585,7 +10585,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10902,7 +10902,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10945,7 +10945,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10962,7 +10962,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11279,7 +11279,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11320,7 +11320,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11337,7 +11337,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11901,7 +11901,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11944,7 +11944,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11961,12 +11961,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -12008,7 +12008,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -12035,7 +12035,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12047,7 +12047,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12090,7 +12090,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12107,7 +12107,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12419,7 +12419,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12462,7 +12462,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12479,7 +12479,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12657,7 +12657,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12701,7 +12701,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12718,7 +12718,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12943,7 +12943,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12986,7 +12986,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13003,7 +13003,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13228,7 +13228,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13272,7 +13272,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13289,7 +13289,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13422,7 +13422,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13465,7 +13465,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13482,7 +13482,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13568,7 +13568,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13614,7 +13614,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13631,7 +13631,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13747,7 +13747,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13788,7 +13788,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13805,7 +13805,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13908,7 +13908,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13951,7 +13951,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13968,12 +13968,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -14015,7 +14015,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -14052,7 +14052,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14064,7 +14064,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14107,7 +14107,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14124,7 +14124,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14235,7 +14235,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14282,7 +14282,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14299,7 +14299,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14462,7 +14462,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14511,7 +14511,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14528,7 +14528,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14995,7 +14995,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15044,7 +15044,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15061,7 +15061,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15528,7 +15528,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15577,7 +15577,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15594,7 +15594,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16061,7 +16061,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16110,7 +16110,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16127,7 +16127,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16594,7 +16594,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16641,7 +16641,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16658,7 +16658,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16816,7 +16816,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16865,7 +16865,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16882,7 +16882,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17203,7 +17203,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17254,7 +17254,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17271,7 +17271,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17679,7 +17679,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17728,7 +17728,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17745,7 +17745,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18212,7 +18212,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18261,7 +18261,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18278,7 +18278,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18745,7 +18745,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18794,7 +18794,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18811,7 +18811,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19278,7 +19278,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19327,7 +19327,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19344,7 +19344,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19811,7 +19811,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19860,7 +19860,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19877,7 +19877,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20151,7 +20151,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20198,7 +20198,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20215,7 +20215,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20353,7 +20353,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20402,7 +20402,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20419,7 +20419,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20886,7 +20886,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20935,7 +20935,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20952,7 +20952,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21419,7 +21419,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21468,7 +21468,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21485,7 +21485,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21952,7 +21952,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22001,7 +22001,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22018,7 +22018,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22485,7 +22485,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22532,7 +22532,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22549,7 +22549,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22707,7 +22707,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22756,7 +22756,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22773,7 +22773,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23240,7 +23240,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23289,7 +23289,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23306,7 +23306,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23773,7 +23773,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23822,7 +23822,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23839,7 +23839,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24306,7 +24306,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24355,7 +24355,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24372,7 +24372,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24839,7 +24839,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24886,7 +24886,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24903,7 +24903,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25051,7 +25051,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25100,7 +25100,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25117,7 +25117,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25584,7 +25584,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25633,7 +25633,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25650,7 +25650,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26117,7 +26117,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26168,7 +26168,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26185,7 +26185,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26625,7 +26625,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26674,7 +26674,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26691,7 +26691,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27158,7 +27158,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27207,7 +27207,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27224,7 +27224,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27691,7 +27691,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27742,7 +27742,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27759,7 +27759,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28199,7 +28199,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28250,7 +28250,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28267,7 +28267,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28675,7 +28675,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28725,7 +28725,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28742,7 +28742,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29209,7 +29209,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29258,7 +29258,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29275,7 +29275,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29742,7 +29742,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29791,7 +29791,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29808,7 +29808,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -30275,7 +30275,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30322,7 +30322,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30339,7 +30339,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -30497,7 +30497,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30544,7 +30544,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30561,7 +30561,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -30709,7 +30709,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30757,7 +30757,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30774,7 +30774,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -30959,7 +30959,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31008,7 +31008,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31025,7 +31025,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -31346,7 +31346,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31395,7 +31395,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31412,12 +31412,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -31459,7 +31459,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31506,7 +31506,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31543,7 +31543,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31580,7 +31580,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31632,7 +31632,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31719,7 +31719,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31766,7 +31766,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31798,7 +31798,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31840,7 +31840,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31867,7 +31867,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31879,7 +31879,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31929,7 +31929,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31946,7 +31946,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -32386,7 +32386,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -32435,7 +32435,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -32452,7 +32452,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -32919,7 +32919,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -32966,7 +32966,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -32983,7 +32983,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -33242,7 +33242,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -33289,7 +33289,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -33306,7 +33306,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -33449,7 +33449,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -33496,7 +33496,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -33513,7 +33513,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -33651,7 +33651,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -33696,7 +33696,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -33713,7 +33713,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -33928,7 +33928,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -33975,7 +33975,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -33992,7 +33992,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -34145,7 +34145,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -34192,7 +34192,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -34209,7 +34209,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -34352,7 +34352,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -34399,7 +34399,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -34416,7 +34416,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -34559,7 +34559,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -34602,7 +34602,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -34619,7 +34619,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -34715,7 +34715,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -34758,7 +34758,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -34775,7 +34775,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -34896,7 +34896,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -34939,7 +34939,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -34956,7 +34956,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -35057,7 +35057,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -35100,7 +35100,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -35117,7 +35117,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -35228,7 +35228,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -35271,7 +35271,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -35288,7 +35288,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -35429,7 +35429,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -35472,7 +35472,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -35489,7 +35489,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -35600,7 +35600,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -35643,7 +35643,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -35660,7 +35660,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -35751,7 +35751,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -35794,7 +35794,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -35811,7 +35811,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -35912,7 +35912,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -35955,7 +35955,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -35972,7 +35972,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -36068,7 +36068,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -36111,7 +36111,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -36128,7 +36128,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -36239,7 +36239,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -36282,7 +36282,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -36299,7 +36299,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -36400,7 +36400,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -36443,7 +36443,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -36460,7 +36460,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -36571,7 +36571,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -36614,7 +36614,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -36631,7 +36631,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -36727,7 +36727,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -36774,7 +36774,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -36791,7 +36791,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -37048,7 +37048,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -37094,7 +37094,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -37111,7 +37111,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -37415,7 +37415,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -37461,7 +37461,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -37478,7 +37478,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -37782,7 +37782,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -37832,7 +37832,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -37849,7 +37849,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -38200,7 +38200,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -38246,7 +38246,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -38263,7 +38263,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -38508,7 +38508,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -38554,7 +38554,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -38571,7 +38571,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -38801,7 +38801,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -38847,7 +38847,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -38864,7 +38864,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -39168,7 +39168,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -39214,7 +39214,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -39231,7 +39231,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -39535,7 +39535,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -39581,7 +39581,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -39598,7 +39598,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -39865,7 +39865,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -39911,7 +39911,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -39928,7 +39928,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -40158,7 +40158,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -40204,7 +40204,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -40221,7 +40221,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -40456,7 +40456,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -40507,7 +40507,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -40524,7 +40524,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -40964,7 +40964,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -41012,7 +41012,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -41029,7 +41029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -41454,7 +41454,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -41504,7 +41504,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -41521,7 +41521,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -41877,7 +41877,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -41923,7 +41923,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -41940,7 +41940,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -42442,7 +42442,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -42489,7 +42489,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -42506,7 +42506,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -43008,7 +43008,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -43055,7 +43055,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -43072,7 +43072,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -43381,7 +43381,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -43426,7 +43426,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -43443,7 +43443,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -43737,7 +43737,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -43783,7 +43783,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -43800,7 +43800,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -44082,7 +44082,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -44133,7 +44133,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -44150,7 +44150,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -44966,7 +44966,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -45901,7 +45901,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -45918,7 +45918,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -46420,7 +46420,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -46469,7 +46469,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -46486,7 +46486,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -46810,7 +46810,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -46861,7 +46861,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -46878,7 +46878,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -47694,7 +47694,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -47745,7 +47745,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -47762,7 +47762,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -48578,7 +48578,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -48629,7 +48629,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -48646,7 +48646,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -49462,7 +49462,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -49513,7 +49513,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -49530,7 +49530,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -50346,7 +50346,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -50394,7 +50394,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -50411,7 +50411,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -50836,7 +50836,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -50884,7 +50884,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -50901,7 +50901,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -51326,7 +51326,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -51377,7 +51377,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -51394,7 +51394,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -52210,7 +52210,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -52259,7 +52259,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -52276,7 +52276,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -52664,7 +52664,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -52719,7 +52719,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -52736,7 +52736,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -53310,7 +53310,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -53362,7 +53362,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -53379,7 +53379,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -54195,7 +54195,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -54246,7 +54246,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -54263,7 +54263,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -55079,7 +55079,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -55131,7 +55131,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -55148,7 +55148,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -55937,7 +55937,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -55990,7 +55990,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -56007,7 +56007,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -56613,7 +56613,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -56663,7 +56663,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -56680,7 +56680,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -57172,7 +57172,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -57223,7 +57223,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -57240,7 +57240,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -58056,7 +58056,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -58107,7 +58107,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -58124,12 +58124,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -58171,7 +58171,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58258,7 +58258,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58305,7 +58305,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58337,7 +58337,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58389,7 +58389,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58426,7 +58426,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58473,7 +58473,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58520,7 +58520,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58577,7 +58577,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58624,7 +58624,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58656,7 +58656,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58708,7 +58708,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58745,7 +58745,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58792,7 +58792,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58839,7 +58839,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58901,7 +58901,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -58928,7 +58928,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -58940,7 +58940,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -58991,7 +58991,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -59008,7 +59008,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -59824,7 +59824,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -59870,7 +59870,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -59887,7 +59887,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -60149,7 +60149,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -60195,7 +60195,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -60212,7 +60212,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -60516,7 +60516,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -60562,7 +60562,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -60579,7 +60579,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -60856,7 +60856,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -60907,7 +60907,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -60924,7 +60924,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -61374,7 +61374,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -61422,7 +61422,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -61439,7 +61439,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -61864,7 +61864,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -61912,7 +61912,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -61929,7 +61929,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -62354,7 +62354,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -62402,7 +62402,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -62419,7 +62419,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -62844,7 +62844,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -62893,7 +62893,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -62910,7 +62910,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -63372,7 +63372,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -63420,7 +63420,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -63437,7 +63437,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -63699,7 +63699,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -63745,7 +63745,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -63762,7 +63762,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -64264,7 +64264,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -64310,7 +64310,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -64327,7 +64327,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -64829,7 +64829,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -64875,7 +64875,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -64892,7 +64892,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -65394,7 +65394,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -65441,7 +65441,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -65458,7 +65458,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -65933,7 +65933,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -65979,7 +65979,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -65996,7 +65996,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -66231,7 +66231,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -66277,7 +66277,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -66294,7 +66294,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -66796,7 +66796,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -66844,7 +66844,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -66861,7 +66861,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -67304,7 +67304,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -67352,7 +67352,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -67369,7 +67369,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -67794,7 +67794,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -67840,7 +67840,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -67857,7 +67857,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -68134,7 +68134,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -68180,7 +68180,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -68197,7 +68197,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -68442,7 +68442,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -68490,7 +68490,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -68507,7 +68507,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -68932,7 +68932,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -68981,7 +68981,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -68998,7 +68998,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -69423,7 +69423,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -69473,7 +69473,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -69490,7 +69490,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -69994,7 +69994,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -70042,7 +70042,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -70059,7 +70059,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -70390,7 +70390,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -70436,7 +70436,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -70453,7 +70453,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -70955,7 +70955,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -71001,7 +71001,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -71018,7 +71018,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -71520,7 +71520,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -71566,7 +71566,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -71583,7 +71583,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -71808,7 +71808,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -71852,7 +71852,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -71869,7 +71869,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -72153,7 +72153,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -72200,7 +72200,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -72217,7 +72217,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -72632,7 +72632,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -72680,7 +72680,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -72697,7 +72697,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -73112,7 +73112,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -73162,7 +73162,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -73179,7 +73179,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -73619,7 +73619,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -73666,7 +73666,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -73683,7 +73683,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -74098,7 +74098,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -74146,7 +74146,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -74163,7 +74163,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -74578,7 +74578,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -74625,7 +74625,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -74642,7 +74642,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -74904,7 +74904,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -74954,7 +74954,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -74971,7 +74971,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -75411,7 +75411,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -75458,7 +75458,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -75475,7 +75475,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -75890,7 +75890,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -75938,7 +75938,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -75955,7 +75955,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -76370,7 +76370,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -76416,7 +76416,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -76433,7 +76433,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -76663,7 +76663,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -76710,7 +76710,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -76727,7 +76727,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -77142,7 +77142,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -77190,7 +77190,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -77207,7 +77207,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -77622,7 +77622,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -77668,7 +77668,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -77685,7 +77685,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -77930,7 +77930,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -77977,7 +77977,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -77994,7 +77994,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -78409,7 +78409,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -78457,7 +78457,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -78474,7 +78474,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -78889,7 +78889,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -78935,7 +78935,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -78952,7 +78952,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -79197,7 +79197,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -79243,7 +79243,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -79260,7 +79260,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -79490,7 +79490,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -79539,7 +79539,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -79556,7 +79556,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -79944,7 +79944,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -79991,7 +79991,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -80008,7 +80008,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -80423,7 +80423,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -80471,7 +80471,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -80488,7 +80488,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -80903,7 +80903,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -80950,7 +80950,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -80967,7 +80967,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -81382,7 +81382,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -81430,7 +81430,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -81447,7 +81447,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -81862,7 +81862,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -81909,7 +81909,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -81926,7 +81926,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -82341,7 +82341,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -82868,7 +82868,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -82885,7 +82885,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -83300,7 +83300,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -83348,7 +83348,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -83365,7 +83365,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -83780,7 +83780,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -83828,7 +83828,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -83845,7 +83845,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -84260,7 +84260,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -84307,7 +84307,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -84324,7 +84324,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -84739,7 +84739,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -84787,7 +84787,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -84804,7 +84804,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -85219,7 +85219,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -85266,7 +85266,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -85283,7 +85283,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -85698,7 +85698,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -85746,7 +85746,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -85763,7 +85763,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -86178,7 +86178,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -86224,7 +86224,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -86241,7 +86241,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -86545,7 +86545,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -86592,7 +86592,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -86609,7 +86609,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -87024,7 +87024,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -87072,7 +87072,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -87089,7 +87089,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -87504,7 +87504,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -87552,7 +87552,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -87569,7 +87569,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -87984,7 +87984,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -88034,7 +88034,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -88051,7 +88051,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -88476,7 +88476,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -88523,7 +88523,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -88540,12 +88540,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -88587,7 +88587,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -88674,7 +88674,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -88721,7 +88721,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -88753,7 +88753,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -88790,7 +88790,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -88827,7 +88827,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -88864,7 +88864,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -88916,7 +88916,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -88943,7 +88943,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -88955,7 +88955,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -89003,7 +89003,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -89020,7 +89020,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -89435,7 +89435,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -89481,7 +89481,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -89498,7 +89498,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -89728,7 +89728,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -89779,7 +89779,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -89796,7 +89796,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -90392,7 +90392,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -90440,7 +90440,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -90457,7 +90457,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -91044,7 +91044,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -91093,7 +91093,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -91110,7 +91110,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -91627,7 +91627,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -91670,7 +91670,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -91687,7 +91687,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -91793,7 +91793,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -91836,7 +91836,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -91853,7 +91853,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -91949,7 +91949,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Crypto/xslstable/TEE_Crypto_API.xsl b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Crypto/xslstable/TEE_Crypto_API.xsl
new file mode 100644
index 0000000..3f63c85
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Crypto/xslstable/TEE_Crypto_API.xsl
@@ -0,0 +1,344 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Copyright (c) 2014, STMicroelectronics International N.V. -->
+<!-- All rights reserved. -->
+<!-- -->
+<!-- Redistribution and use in source and binary forms, with or without -->
+<!-- modification, are permitted provided that the following conditions are met: -->
+<!-- -->
+<!-- 1. Redistributions of source code must retain the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer. -->
+<!-- -->
+<!-- 2. Redistributions in binary form must reproduce the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer in the documentation -->
+<!-- and/or other materials provided with the distribution. -->
+<!-- -->
+<!-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -->
+<!-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -->
+<!-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -->
+<!-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -->
+<!-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
+<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
+<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -->
+<!-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -->
+<!-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -->
+<!-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -->
+<!-- POSSIBILITY OF SUCH DAMAGE. -->
+
+<xsl:stylesheet version="1.0"
+xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="text"/>
+<xsl:strip-space elements="*"/>
+<xsl:param name="target"/>
+
+<xsl:template match="package">
+<xsl:text>
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <ta_crypt.h>
+#include <tee_api_types.h>
+#include "TTA_Crypto_protocol.h"
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+#include "tee_internal_api.h"
+#undef TA_UUID
+#include "ta_answerSuccessTo_OpenSession_Invoke_test.h"
+#undef TA_UUID
+#include "tee_api_defines.h"
+#include "tee_client_api.h"
+#include "xml_crypto_api.h"
+
+static bool xtest_init = false;
+
+</xsl:text>
+static bool xtest_tee_init(ADBG_Case_t *c)
+{
+ if (xtest_init) {
+ return true;
+ }
+ SHARE_MEM01 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM01)) {
+ goto exit;
+ }
+ SHARE_MEM02 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM02)) {
+ goto exit;
+ }
+ SHARE_MEM03 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM03)) {
+ goto exit;
+ }
+ SHARE_MEM04 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM04)) {
+ goto exit;
+ }
+ SHARE_MEM05 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM05)) {
+ goto exit;
+ }
+ SHARE_MEM06 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM06)) {
+ goto exit;
+ }
+ SESSION01 = malloc(sizeof(TEEC_Session));
+ if (!ADBG_EXPECT_NOT_NULL(c, SESSION01)) {
+ goto exit;
+ }
+ CONTEXT01 = malloc(sizeof(TEEC_Context));
+ if (!ADBG_EXPECT_NOT_NULL(c, CONTEXT01)) {
+ goto exit;
+ }
+ OPERATION_HANDLE_01 = malloc(sizeof(TEE_OperationHandle));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION_HANDLE_01)) {
+ goto exit;
+ }
+ *OPERATION_HANDLE_01 = (TEE_OperationHandle)1;
+ OPERATION_HANDLE_02 = malloc(sizeof(TEE_OperationHandle));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION_HANDLE_02)) {
+ goto exit;
+ }
+ *OPERATION_HANDLE_02 = (TEE_OperationHandle)2;
+ OPERATION_HANDLE_INVALID = malloc(sizeof(TEE_OperationHandle));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION_HANDLE_INVALID)) {
+ goto exit;
+ }
+ *OPERATION_HANDLE_INVALID = (TEE_OperationHandle)4;
+ OBJECT_HANDLE_01 = malloc(sizeof(TEE_ObjectHandle));
+ if (!ADBG_EXPECT_NOT_NULL(c, OBJECT_HANDLE_01)) {
+ goto exit;
+ }
+ *OBJECT_HANDLE_01 = (TEE_ObjectHandle)1;
+ OBJECT_HANDLE_02 = malloc(sizeof(TEE_ObjectHandle));
+ if (!ADBG_EXPECT_NOT_NULL(c, OBJECT_HANDLE_02)) {
+ goto exit;
+ }
+ *OBJECT_HANDLE_02 = (TEE_ObjectHandle)2;
+ OBJECT_HANDLE_INVALID = malloc(sizeof(TEE_ObjectHandle));
+ if (!ADBG_EXPECT_NOT_NULL(c, OBJECT_HANDLE_INVALID)) {
+ goto exit;
+ }
+ *OBJECT_HANDLE_INVALID = (TEE_ObjectHandle)4;
+ xtest_init = true;
+ crypto_init();
+ return xtest_init;
+
+exit:
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SHARE_MEM03) {
+ free(SHARE_MEM03);
+ SHARE_MEM03 = NULL;
+ }
+ if (SHARE_MEM04) {
+ free(SHARE_MEM04);
+ SHARE_MEM04 = NULL;
+ }
+ if (SHARE_MEM05) {
+ free(SHARE_MEM05);
+ SHARE_MEM05 = NULL;
+ }
+ if (SHARE_MEM06) {
+ free(SHARE_MEM06);
+ SHARE_MEM06 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION_HANDLE_01) {
+ free(OPERATION_HANDLE_01);
+ OPERATION_HANDLE_01 = NULL;
+ }
+ if (OPERATION_HANDLE_02) {
+ free(OPERATION_HANDLE_02);
+ OPERATION_HANDLE_02 = NULL;
+ }
+ if (OPERATION_HANDLE_INVALID) {
+ free(OPERATION_HANDLE_INVALID);
+ OPERATION_HANDLE_INVALID = NULL;
+ }
+ if (OBJECT_HANDLE_01) {
+ free(OBJECT_HANDLE_01);
+ OBJECT_HANDLE_01 = NULL;
+ }
+ if (OBJECT_HANDLE_02) {
+ free(OBJECT_HANDLE_02);
+ OBJECT_HANDLE_02 = NULL;
+ }
+ if (OBJECT_HANDLE_INVALID) {
+ free(OBJECT_HANDLE_INVALID);
+ OBJECT_HANDLE_INVALID = NULL;
+ }
+
+ xtest_init = false;
+
+ return xtest_init;
+}
+
+static void xtest_tee_deinit(void)
+{
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SHARE_MEM03) {
+ free(SHARE_MEM03);
+ SHARE_MEM03 = NULL;
+ }
+ if (SHARE_MEM04) {
+ free(SHARE_MEM04);
+ SHARE_MEM04 = NULL;
+ }
+ if (SHARE_MEM05) {
+ free(SHARE_MEM05);
+ SHARE_MEM05 = NULL;
+ }
+ if (SHARE_MEM06) {
+ free(SHARE_MEM06);
+ SHARE_MEM06 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION_HANDLE_01) {
+ free(OPERATION_HANDLE_01);
+ OPERATION_HANDLE_01 = NULL;
+ }
+ if (OPERATION_HANDLE_02) {
+ free(OPERATION_HANDLE_02);
+ OPERATION_HANDLE_02 = NULL;
+ }
+ if (OPERATION_HANDLE_INVALID) {
+ free(OPERATION_HANDLE_INVALID);
+ OPERATION_HANDLE_INVALID = NULL;
+ }
+ if (OBJECT_HANDLE_01) {
+ free(OBJECT_HANDLE_01);
+ OBJECT_HANDLE_01 = NULL;
+ }
+ if (OBJECT_HANDLE_02) {
+ free(OBJECT_HANDLE_02);
+ OBJECT_HANDLE_02 = NULL;
+ }
+ if (OBJECT_HANDLE_INVALID) {
+ free(OBJECT_HANDLE_INVALID);
+ OBJECT_HANDLE_INVALID = NULL;
+ }
+
+ xtest_init = false;
+}
+
+<xsl:for-each select="initial-state/scenario">
+/*<xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" />*/
+static void xtest_tee_<xsl:value-of select="position()+9000" />(ADBG_Case_t *c)
+{
+<xsl:text> if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return ;
+</xsl:text>
+<xsl:for-each select="./body/call/operation">
+ <xsl:apply-templates select="."></xsl:apply-templates>
+</xsl:for-each><xsl:if test="position()=last()"><xsl:text> xtest_tee_deinit();
+ crypto_reset();</xsl:text></xsl:if>
+}
+</xsl:for-each>
+
+<xsl:for-each select="initial-state/scenario">
+<xsl:variable name="position" select="position()+9000" />
+ADBG_CASE_DEFINE(XTEST_TEE_<xsl:value-of select="$position" />, xtest_tee_<xsl:value-of select="$position" /><xsl:text>,
+ /* Title */
+ "</xsl:text><xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" /><xsl:text>",
+ /* Short description */
+ "</xsl:text><xsl:value-of select="substring-before(./@name, ' ')" /><xsl:text>",
+ /* Requirement IDs */
+ "</xsl:text><xsl:value-of select="./req[last()]/@name" /><xsl:text>",
+ /* How to implement */
+ "Description of how to implement ...");</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match="operation">
+<xsl:choose>
+<!--Call an operation with ADBG_EXPECT() macro.-->
+<xsl:when test="(contains(./argument[last()]/parameter/@name, 'xpected'))"> ADBG_EXPECT(c, <xsl:for-each select="./argument"><xsl:if test="position()=last()"><xsl:apply-templates select="value"></xsl:apply-templates></xsl:if></xsl:for-each>, <xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument/value"><xsl:if test="position()>1 and not(position()=last())">, </xsl:if><xsl:if test="not(position()=last())"><xsl:apply-templates select="."></xsl:apply-templates></xsl:if>
+ </xsl:for-each>));
+</xsl:when>
+<xsl:otherwise>
+<xsl:text> </xsl:text><xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument"><xsl:if test="position()>1">, </xsl:if>
+ <xsl:apply-templates select="./value"></xsl:apply-templates>
+</xsl:for-each>);
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="value">
+<xsl:choose>
+<xsl:when test="(contains(./@name, 'UUID'))"><xsl:text>&</xsl:text><xsl:value-of select="./@name" />
+</xsl:when>
+<xsl:when test="(contains(./@name, 'CMD_Crypto'))"><xsl:text>CMD</xsl:text><xsl:value-of select="substring(./@name, string-length('CMD_Crypto')+1)" />
+</xsl:when>
+<xsl:when test="(contains(../type/@name, 'ALL_ATTRIBUTE_VALUES'))"><xsl:value-of select="./@name" /><xsl:text>, sizeof(</xsl:text><xsl:value-of select="./@name" /><xsl:text>)</xsl:text>
+</xsl:when>
+<xsl:when test="(../type/@name='ALL_TEE_NAMES' and ./@name='NULL')"><xsl:text>_device</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<!--xsl:text>&</xsl:text--><xsl:value-of select="./@name" />
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="parameter">
+ <xsl:value-of select="./@name" />
+</xsl:template>
+
+<xsl:template match="@name">
+<xsl:choose>
+<xsl:when test="(contains(., 'Invoke'))"><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/DataStorage/xmlpatch/v1_1_0_4-2014_11_07/TEE_DataStorage_API.xml.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/DataStorage/xmlpatch/v1_1_0_4-2014_11_07/TEE_DataStorage_API.xml.patch
new file mode 100644
index 0000000..a2d7836
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/DataStorage/xmlpatch/v1_1_0_4-2014_11_07/TEE_DataStorage_API.xml.patch
@@ -0,0 +1,5597 @@
+--- TEE_DataStorage_API.xml.orig 2012-10-22 22:06:27.000000000 +0200
++++ TEE_DataStorage_API.xml 2015-06-09 16:33:29.757016493 +0200
+@@ -40,7 +40,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -57,7 +57,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -153,7 +153,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -199,7 +199,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -216,7 +216,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -312,7 +312,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -355,7 +355,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -372,7 +372,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -458,7 +458,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -501,7 +501,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -518,7 +518,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -664,7 +664,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -709,7 +709,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -726,7 +726,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -807,7 +807,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -850,7 +850,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -867,7 +867,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -953,7 +953,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1002,7 +1002,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1019,7 +1019,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1110,7 +1110,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1159,7 +1159,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1176,7 +1176,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1267,7 +1267,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1316,7 +1316,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1333,7 +1333,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1424,7 +1424,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1473,7 +1473,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1490,7 +1490,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1581,7 +1581,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1630,7 +1630,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1647,7 +1647,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1738,7 +1738,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1787,7 +1787,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1804,7 +1804,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1895,7 +1895,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1938,7 +1938,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1955,7 +1955,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2046,7 +2046,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2090,7 +2090,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2107,7 +2107,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2253,7 +2253,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2301,7 +2301,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2318,7 +2318,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2409,7 +2409,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2451,7 +2451,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2468,7 +2468,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2554,7 +2554,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2599,7 +2599,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2616,7 +2616,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2762,7 +2762,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2807,7 +2807,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2824,7 +2824,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2970,7 +2970,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3013,7 +3013,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3030,7 +3030,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3111,7 +3111,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3168,7 +3168,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3185,7 +3185,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3331,7 +3331,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3374,7 +3374,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3391,7 +3391,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3482,7 +3482,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3524,7 +3524,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3541,7 +3541,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3632,7 +3632,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3680,7 +3680,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3697,7 +3697,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3778,7 +3778,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3821,7 +3821,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3838,7 +3838,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3924,7 +3924,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3967,7 +3967,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3984,7 +3984,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4065,7 +4065,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4117,7 +4117,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4134,7 +4134,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4280,7 +4280,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4323,7 +4323,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4340,12 +4340,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -4387,7 +4387,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -4474,7 +4474,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4486,7 +4486,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4529,7 +4529,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4546,7 +4546,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4692,7 +4692,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4742,7 +4742,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4759,7 +4759,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4845,7 +4845,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4895,7 +4895,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4912,7 +4912,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4998,7 +4998,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5048,7 +5048,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5065,12 +5065,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -5112,7 +5112,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -5139,7 +5139,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5151,7 +5151,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5201,7 +5201,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5218,7 +5218,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5304,7 +5304,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5356,7 +5356,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5373,12 +5373,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -5420,7 +5420,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -5507,7 +5507,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5519,7 +5519,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5571,7 +5571,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5588,7 +5588,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5734,7 +5734,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5786,7 +5786,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5803,12 +5803,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -5850,7 +5850,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -5937,7 +5937,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5949,7 +5949,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6001,7 +6001,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6018,7 +6018,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6164,7 +6164,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6208,7 +6208,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6225,7 +6225,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6347,7 +6347,7 @@
+ <argument>
+ <parameter name="OUT_ExpectedReturn" />
+ <type name="ALL_TEE_RESULTS" />
+- <value name="TEE_ERROR_BAD_PARAMETERS" />
++ <value name="TEE_ERROR_TARGET_DEAD" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6371,7 +6371,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6424,7 +6424,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6441,12 +6441,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -6488,7 +6488,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -6575,7 +6575,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6587,7 +6587,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6639,7 +6639,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6656,7 +6656,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6802,7 +6802,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6859,7 +6859,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6876,7 +6876,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7022,7 +7022,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7078,7 +7078,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7095,7 +7095,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7241,7 +7241,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7288,7 +7288,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7305,7 +7305,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7436,7 +7436,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7484,7 +7484,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7501,12 +7501,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -7548,7 +7548,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -7620,7 +7620,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7632,7 +7632,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7680,7 +7680,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7697,7 +7697,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7828,7 +7828,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7876,7 +7876,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7893,7 +7893,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8024,7 +8024,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8073,7 +8073,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8090,7 +8090,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8221,7 +8221,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8269,7 +8269,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8286,7 +8286,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8417,7 +8417,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8465,7 +8465,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8482,7 +8482,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8613,7 +8613,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8661,7 +8661,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8678,7 +8678,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8809,7 +8809,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8857,7 +8857,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8874,12 +8874,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -8921,7 +8921,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -8993,7 +8993,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9005,7 +9005,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9053,7 +9053,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9070,7 +9070,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9201,7 +9201,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9249,7 +9249,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9266,7 +9266,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9397,7 +9397,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9445,7 +9445,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9462,7 +9462,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9593,7 +9593,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9641,7 +9641,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9658,7 +9658,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9789,7 +9789,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9837,7 +9837,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9854,7 +9854,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9985,7 +9985,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10033,7 +10033,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10050,7 +10050,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10181,7 +10181,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10230,7 +10230,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10247,7 +10247,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10378,7 +10378,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10425,7 +10425,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10442,7 +10442,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10573,7 +10573,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10628,7 +10628,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10645,7 +10645,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10791,7 +10791,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10839,7 +10839,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10856,7 +10856,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10942,7 +10942,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10991,7 +10991,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11008,7 +11008,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11094,7 +11094,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11143,7 +11143,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11160,7 +11160,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11246,7 +11246,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11289,7 +11289,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11306,7 +11306,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11387,7 +11387,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11430,7 +11430,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11447,7 +11447,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11533,7 +11533,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11576,7 +11576,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11593,7 +11593,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11689,7 +11689,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11733,7 +11733,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11750,12 +11750,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -11797,7 +11797,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -11819,7 +11819,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11831,7 +11831,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11877,7 +11877,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11894,7 +11894,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11990,7 +11990,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12036,7 +12036,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12053,7 +12053,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12149,7 +12149,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12190,7 +12190,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12207,7 +12207,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12293,7 +12293,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12336,7 +12336,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12353,7 +12353,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12434,7 +12434,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12477,7 +12477,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12494,7 +12494,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12580,7 +12580,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12622,7 +12622,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12639,7 +12639,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12720,7 +12720,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12763,7 +12763,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12780,7 +12780,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12871,7 +12871,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12928,7 +12928,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12945,12 +12945,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -12992,7 +12992,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -13024,7 +13024,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13036,7 +13036,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13080,7 +13080,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13097,12 +13097,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -13144,7 +13144,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -13166,7 +13166,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13178,7 +13178,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13221,7 +13221,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13238,7 +13238,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13319,7 +13319,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13362,7 +13362,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13379,7 +13379,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13525,7 +13525,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13568,7 +13568,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13585,7 +13585,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13671,7 +13671,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13714,7 +13714,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13731,7 +13731,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13817,7 +13817,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13860,7 +13860,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13877,7 +13877,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13963,7 +13963,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14006,7 +14006,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14023,7 +14023,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14104,7 +14104,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14147,7 +14147,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14164,7 +14164,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14245,7 +14245,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14288,7 +14288,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14305,7 +14305,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14386,7 +14386,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14430,7 +14430,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14447,7 +14447,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14593,7 +14593,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14638,7 +14638,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14655,7 +14655,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14801,7 +14801,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14844,7 +14844,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14861,12 +14861,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -14908,7 +14908,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -14935,7 +14935,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14947,7 +14947,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14990,7 +14990,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15007,7 +15007,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15153,7 +15153,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15196,7 +15196,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15213,7 +15213,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15304,7 +15304,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15356,7 +15356,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15373,7 +15373,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15519,7 +15519,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15562,7 +15562,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15579,7 +15579,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15665,7 +15665,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15708,7 +15708,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15725,7 +15725,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15811,7 +15811,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15854,7 +15854,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15871,7 +15871,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15957,7 +15957,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16000,7 +16000,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16017,7 +16017,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16103,7 +16103,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16146,7 +16146,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16163,7 +16163,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16244,7 +16244,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16294,7 +16294,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16311,7 +16311,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16397,7 +16397,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16439,7 +16439,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16456,7 +16456,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16542,7 +16542,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16587,7 +16587,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16604,12 +16604,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -16651,7 +16651,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -16738,7 +16738,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16750,7 +16750,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16795,7 +16795,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16812,12 +16812,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -16859,7 +16859,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -16946,7 +16946,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16958,7 +16958,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17003,7 +17003,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17020,7 +17020,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17166,7 +17166,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17211,7 +17211,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17228,7 +17228,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17374,7 +17374,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17419,7 +17419,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17436,7 +17436,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17582,7 +17582,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17627,7 +17627,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17644,12 +17644,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -17691,7 +17691,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -17778,7 +17778,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17790,7 +17790,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17835,7 +17835,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17852,7 +17852,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17998,7 +17998,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18042,7 +18042,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18059,7 +18059,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18205,7 +18205,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18250,7 +18250,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18267,7 +18267,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18413,7 +18413,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18457,7 +18457,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18474,7 +18474,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18620,7 +18620,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18664,7 +18664,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18681,7 +18681,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18827,7 +18827,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18872,7 +18872,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18889,7 +18889,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19035,7 +19035,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19080,7 +19080,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19097,7 +19097,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19243,7 +19243,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19288,7 +19288,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19305,7 +19305,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19451,7 +19451,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19494,7 +19494,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19511,12 +19511,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -19558,7 +19558,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -19590,7 +19590,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19602,7 +19602,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19645,7 +19645,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19662,7 +19662,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19753,7 +19753,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19796,7 +19796,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19813,7 +19813,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19904,7 +19904,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19947,7 +19947,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19964,7 +19964,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20055,7 +20055,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20098,7 +20098,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20115,12 +20115,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -20162,7 +20162,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -20194,7 +20194,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20206,7 +20206,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20249,7 +20249,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20266,7 +20266,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20357,7 +20357,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20400,7 +20400,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20417,12 +20417,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -20464,7 +20464,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -20496,7 +20496,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20508,7 +20508,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20551,7 +20551,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20568,7 +20568,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20659,7 +20659,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20708,7 +20708,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20725,7 +20725,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20816,7 +20816,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20865,7 +20865,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20882,7 +20882,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20973,7 +20973,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21022,7 +21022,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21039,7 +21039,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21130,7 +21130,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21179,7 +21179,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21196,7 +21196,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21287,7 +21287,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21339,7 +21339,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21356,7 +21356,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21502,7 +21502,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21545,7 +21545,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21562,7 +21562,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21693,7 +21693,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21736,7 +21736,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21753,7 +21753,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21884,7 +21884,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21927,7 +21927,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21944,7 +21944,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22075,7 +22075,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22118,7 +22118,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22135,7 +22135,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22221,7 +22221,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22264,7 +22264,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22281,7 +22281,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22367,7 +22367,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22410,7 +22410,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22427,7 +22427,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22518,7 +22518,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22561,7 +22561,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22578,7 +22578,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22664,7 +22664,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22707,7 +22707,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22724,7 +22724,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22805,7 +22805,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22854,7 +22854,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22871,7 +22871,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22957,7 +22957,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23012,7 +23012,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23029,7 +23029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23110,7 +23110,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23155,7 +23155,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23172,7 +23172,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23318,7 +23318,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23362,7 +23362,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23379,7 +23379,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23525,7 +23525,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23569,7 +23569,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23586,7 +23586,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23732,7 +23732,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23776,7 +23776,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23793,7 +23793,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23939,7 +23939,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23988,7 +23988,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24005,7 +24005,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24096,7 +24096,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24148,7 +24148,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24165,7 +24165,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24311,7 +24311,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24357,7 +24357,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24374,7 +24374,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24470,7 +24470,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24516,7 +24516,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24533,7 +24533,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24629,7 +24629,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24675,7 +24675,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24692,7 +24692,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24788,7 +24788,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24834,7 +24834,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24851,7 +24851,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24947,7 +24947,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24993,7 +24993,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25010,7 +25010,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25106,7 +25106,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25152,7 +25152,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25169,7 +25169,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25265,7 +25265,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25311,7 +25311,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25328,7 +25328,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25424,7 +25424,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25479,7 +25479,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25496,7 +25496,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25642,7 +25642,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25699,7 +25699,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25716,7 +25716,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25807,7 +25807,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25864,7 +25864,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25881,7 +25881,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25972,7 +25972,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26029,7 +26029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26046,7 +26046,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26137,7 +26137,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26194,7 +26194,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26211,7 +26211,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26302,7 +26302,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26359,7 +26359,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26376,7 +26376,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26467,7 +26467,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26524,7 +26524,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26541,7 +26541,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26632,7 +26632,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26689,7 +26689,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26706,7 +26706,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26797,7 +26797,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26854,7 +26854,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26871,7 +26871,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26962,7 +26962,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27019,7 +27019,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27036,7 +27036,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27127,7 +27127,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27184,7 +27184,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27201,12 +27201,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -27248,7 +27248,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -27280,7 +27280,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27292,7 +27292,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27349,7 +27349,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27366,12 +27366,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -27413,7 +27413,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -27445,7 +27445,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27457,7 +27457,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27514,7 +27514,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27531,7 +27531,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27622,7 +27622,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27679,7 +27679,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27696,7 +27696,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27787,7 +27787,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27833,7 +27833,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27850,7 +27850,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27946,7 +27946,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27992,7 +27992,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28009,7 +28009,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28105,7 +28105,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28151,7 +28151,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28168,7 +28168,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28264,7 +28264,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28310,7 +28310,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28327,7 +28327,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28423,7 +28423,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28469,7 +28469,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28486,7 +28486,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28582,7 +28582,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28628,7 +28628,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28645,7 +28645,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28741,7 +28741,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28787,7 +28787,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28804,7 +28804,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28900,7 +28900,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28946,7 +28946,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28963,7 +28963,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29059,7 +29059,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29101,7 +29101,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29118,7 +29118,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29204,7 +29204,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29247,7 +29247,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29264,7 +29264,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29360,7 +29360,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29402,7 +29402,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29419,7 +29419,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29505,7 +29505,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29548,7 +29548,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29565,7 +29565,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29672,7 +29672,7 @@
+ <argument>
+ <parameter name="OUT_ExpectedReturn" />
+ <type name="ALL_TEE_RESULTS" />
+- <value name="TEE_ERROR_TARGET_DEAD" />
++ <value name="TEE_ERROR_BAD_PARAMETERS" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29696,7 +29696,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29739,7 +29739,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29756,7 +29756,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29837,7 +29837,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29880,7 +29880,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29897,7 +29897,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29983,7 +29983,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30026,7 +30026,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30043,7 +30043,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -30129,7 +30129,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30172,7 +30172,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30189,7 +30189,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -30275,7 +30275,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30319,7 +30319,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30336,7 +30336,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -30482,7 +30482,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30525,7 +30525,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30542,7 +30542,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -30633,7 +30633,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30690,7 +30690,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30707,12 +30707,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -30754,7 +30754,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -30786,7 +30786,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30798,7 +30798,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30841,7 +30841,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -30858,12 +30858,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -30905,7 +30905,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -30937,7 +30937,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -30949,7 +30949,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31001,7 +31001,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31018,7 +31018,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -31164,7 +31164,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31213,7 +31213,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31230,7 +31230,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -31311,7 +31311,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31354,7 +31354,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31371,7 +31371,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -31457,7 +31457,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31500,7 +31500,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31517,7 +31517,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -31598,7 +31598,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31640,7 +31640,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31657,12 +31657,12 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_destination" />
+@@ -31704,7 +31704,7 @@
+ <argument>
+ <parameter name="IN_Session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ <argument>
+ <parameter name="IN_Cmd" />
+@@ -31726,7 +31726,7 @@
+ <argument>
+ <parameter name="IN_session" />
+ <type name="ALL_SESSIONS" />
+- <value name="SESSION02" />
++ <value name="SESSION01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31738,7 +31738,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31780,7 +31780,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31797,7 +31797,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -31893,7 +31893,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -31937,7 +31937,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -31954,7 +31954,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -32100,7 +32100,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/DataStorage/xslstable/TEE_DataStorage_API.xsl b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/DataStorage/xslstable/TEE_DataStorage_API.xsl
new file mode 100644
index 0000000..a0e5f8f
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/DataStorage/xslstable/TEE_DataStorage_API.xsl
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Copyright (c) 2014, STMicroelectronics International N.V. -->
+<!-- All rights reserved. -->
+<!-- -->
+<!-- Redistribution and use in source and binary forms, with or without -->
+<!-- modification, are permitted provided that the following conditions are met: -->
+<!-- -->
+<!-- 1. Redistributions of source code must retain the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer. -->
+<!-- -->
+<!-- 2. Redistributions in binary form must reproduce the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer in the documentation -->
+<!-- and/or other materials provided with the distribution. -->
+<!-- -->
+<!-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -->
+<!-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -->
+<!-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -->
+<!-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -->
+<!-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
+<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
+<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -->
+<!-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -->
+<!-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -->
+<!-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -->
+<!-- POSSIBILITY OF SUCH DAMAGE. -->
+
+<xsl:stylesheet version="1.0"
+xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="text"/>
+<xsl:strip-space elements="*"/>
+<xsl:param name="target"/>
+
+<xsl:template match="package">
+<xsl:text>
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+#include "tee_internal_api.h"
+#undef TA_UUID
+#include "ta_answerSuccessTo_OpenSession_Invoke_test.h"
+#undef TA_UUID
+#include "tee_api_defines.h"
+#include "xml_datastorage_api.h"
+
+static bool xtest_init = false;
+
+</xsl:text>
+static bool xtest_tee_init(ADBG_Case_t *c)
+{
+ if (xtest_init) {
+ return true;
+ }
+ SHARE_MEM01 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM01)) {
+ goto exit;
+ }
+ SHARE_MEM02 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM02)) {
+ goto exit;
+ }
+ SHARE_MEM03 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM03)) {
+ goto exit;
+ }
+ SHARE_MEM04 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM04)) {
+ goto exit;
+ }
+ SESSION01 = malloc(sizeof(TEEC_Session));
+ if (!ADBG_EXPECT_NOT_NULL(c, SESSION01)) {
+ goto exit;
+ }
+ CONTEXT01 = malloc(sizeof(TEEC_Context));
+ if (!ADBG_EXPECT_NOT_NULL(c, CONTEXT01)) {
+ goto exit;
+ }
+ OPERATION01 = malloc(sizeof(TEEC_Operation));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION01)) {
+ goto exit;
+ }
+ OPERATION02 = malloc(sizeof(TEEC_Operation));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION02)) {
+ goto exit;
+ }
+
+ xtest_init = true;
+
+ return xtest_init;
+
+exit:
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SHARE_MEM03) {
+ free(SHARE_MEM03);
+ SHARE_MEM03 = NULL;
+ }
+ if (SHARE_MEM04) {
+ free(SHARE_MEM04);
+ SHARE_MEM04 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+ if (OPERATION02) {
+ free(OPERATION02);
+ OPERATION02 = NULL;
+ }
+
+ xtest_init = false;
+ return xtest_init;
+}
+
+static void xtest_tee_deinit(void)
+{
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SHARE_MEM03) {
+ free(SHARE_MEM03);
+ SHARE_MEM03 = NULL;
+ }
+ if (SHARE_MEM04) {
+ free(SHARE_MEM04);
+ SHARE_MEM04 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+ if (OPERATION02) {
+ free(OPERATION02);
+ OPERATION02 = NULL;
+ }
+
+ xtest_init = false;
+}
+
+<xsl:for-each select="initial-state/scenario">
+/*<xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" />*/
+static void xtest_tee_<xsl:value-of select="position()+7500" />(ADBG_Case_t *c)
+{
+<xsl:text> if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return ;
+</xsl:text>
+<xsl:for-each select="./body/call/operation">
+ <xsl:apply-templates select="."></xsl:apply-templates>
+</xsl:for-each>
+<xsl:if test="position()=last()"><xsl:text> xtest_tee_deinit();</xsl:text></xsl:if>
+}
+</xsl:for-each>
+
+<xsl:for-each select="initial-state/scenario">
+<xsl:variable name="position" select="position()+7500" />
+ADBG_CASE_DEFINE(XTEST_TEE_<xsl:value-of select="$position" />, xtest_tee_<xsl:value-of select="$position" /><xsl:text>,
+ /* Title */
+ "</xsl:text><xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" /><xsl:text>",
+ /* Short description */
+ "</xsl:text><xsl:value-of select="substring-before(./@name, ' ')" /><xsl:text>",
+ /* Requirement IDs */
+ "</xsl:text><xsl:value-of select="./req[last()]/@name" /><xsl:text>",
+ /* How to implement */
+ "Description of how to implement ...");</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match="operation">
+<xsl:choose>
+<!--Call an operation with ADBG_EXPECT() macro.-->
+<xsl:when test="(contains(./argument[last()]/parameter/@name, 'xpected') and not(contains(./@name, 'OpenSession')) and not(contains(./@name, 'InitializeContext')) and not(contains(./@name, 'Invoke_TruncateReadObjectData')))"> ADBG_EXPECT(c, <xsl:for-each select="./argument"><xsl:if test="position()=last()"><xsl:apply-templates select="value"></xsl:apply-templates></xsl:if></xsl:for-each>, <xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument/value"><xsl:if test="position()>1 and not(position()=last())">, </xsl:if><xsl:if test="not(position()=last())"><xsl:apply-templates select="."></xsl:apply-templates></xsl:if>
+</xsl:for-each>));
+</xsl:when>
+<xsl:otherwise>
+<xsl:text> </xsl:text><xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument"><xsl:if test="position()>1">, </xsl:if>
+ <xsl:apply-templates select="./value"></xsl:apply-templates>
+</xsl:for-each>);
+</xsl:otherwise>
+</xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="value">
+<xsl:choose>
+<xsl:when test="(contains(./@name, 'UUID'))"><xsl:text>&</xsl:text><xsl:value-of select="./@name" />
+</xsl:when>
+<xsl:when test="(contains(./@name, 'CMD_DS'))"><xsl:text>CMD</xsl:text><xsl:value-of select="substring(./@name, string-length('CMD_DS')+1)" />
+</xsl:when>
+<xsl:when test="(contains(../type/@name, 'ALL_ATTRIBUTE_VALUES'))"><xsl:value-of select="./@name" /><xsl:text>, sizeof(</xsl:text><xsl:value-of select="./@name" /><xsl:text>)</xsl:text>
+</xsl:when>
+<xsl:when test="(../type/@name='ALL_TEE_NAMES' and ./@name='NULL')"><xsl:text>_device</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<!--xsl:text>&</xsl:text--><xsl:value-of select="./@name" />
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="parameter">
+ <xsl:value-of select="./@name" />
+</xsl:template>
+
+<xsl:template match="@name">
+<xsl:choose>
+<xsl:when test=".='InitializeContext'"><xsl:text>XML_</xsl:text><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:when test=".='OpenSession'"><xsl:text>XML_</xsl:text><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:when test=".='SelectApp'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='CloseSession'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='FinalizeContext'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Time_Arithmetical/xmlpatch/v1_1_0_4-2014_11_07/TEE_TimeArithm_API.xml.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Time_Arithmetical/xmlpatch/v1_1_0_4-2014_11_07/TEE_TimeArithm_API.xml.patch
new file mode 100644
index 0000000..c9f76a4
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Time_Arithmetical/xmlpatch/v1_1_0_4-2014_11_07/TEE_TimeArithm_API.xml.patch
@@ -0,0 +1,4673 @@
+--- TEE_TimeArithm_API.xml.ori 2015-02-02 22:06:10.335912118 +0100
++++ TEE_TimeArithm_API.xml 2015-02-02 22:06:37.688096703 +0100
+@@ -38,7 +38,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -55,7 +55,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -171,7 +171,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -215,7 +215,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -232,7 +232,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -348,7 +348,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -392,7 +392,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -409,7 +409,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -520,7 +520,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -564,7 +564,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -581,7 +581,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -692,7 +692,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -736,7 +736,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -753,7 +753,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -864,7 +864,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -908,7 +908,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -925,7 +925,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1036,7 +1036,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1080,7 +1080,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1097,7 +1097,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1208,7 +1208,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1252,7 +1252,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1269,7 +1269,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1380,7 +1380,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1425,7 +1425,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1442,7 +1442,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1558,7 +1558,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1603,7 +1603,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1620,7 +1620,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1736,7 +1736,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1781,7 +1781,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1798,7 +1798,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1914,7 +1914,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1959,7 +1959,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1976,7 +1976,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2092,7 +2092,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2137,7 +2137,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2154,7 +2154,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2270,7 +2270,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2315,7 +2315,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2332,7 +2332,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2448,7 +2448,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2493,7 +2493,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2510,7 +2510,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2626,7 +2626,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2671,7 +2671,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2688,7 +2688,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2804,7 +2804,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2850,7 +2850,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2867,7 +2867,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2983,7 +2983,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3029,7 +3029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3046,7 +3046,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3162,7 +3162,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3208,7 +3208,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3225,7 +3225,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3341,7 +3341,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3387,7 +3387,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3404,7 +3404,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3520,7 +3520,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3566,7 +3566,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3583,7 +3583,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3699,7 +3699,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3745,7 +3745,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3762,7 +3762,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3878,7 +3878,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3921,7 +3921,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3938,7 +3938,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4054,7 +4054,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4096,7 +4096,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4113,7 +4113,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4219,7 +4219,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4261,7 +4261,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4278,7 +4278,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4384,7 +4384,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4431,7 +4431,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4448,7 +4448,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4574,7 +4574,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4621,7 +4621,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4638,7 +4638,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4764,7 +4764,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4811,7 +4811,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4828,7 +4828,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4954,7 +4954,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4997,7 +4997,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5014,7 +5014,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5130,7 +5130,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5173,7 +5173,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5190,7 +5190,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5306,7 +5306,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5350,7 +5350,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5367,7 +5367,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5473,7 +5473,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5517,7 +5517,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5534,7 +5534,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5640,7 +5640,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5684,7 +5684,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5701,7 +5701,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5807,7 +5807,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5851,7 +5851,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5868,7 +5868,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5974,7 +5974,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6019,7 +6019,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6036,7 +6036,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6152,7 +6152,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6197,7 +6197,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6214,7 +6214,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6330,7 +6330,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6375,7 +6375,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6392,7 +6392,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6508,7 +6508,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6553,7 +6553,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6570,7 +6570,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6686,7 +6686,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6729,7 +6729,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6746,7 +6746,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6862,7 +6862,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6906,7 +6906,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6923,7 +6923,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7029,7 +7029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7073,7 +7073,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7090,7 +7090,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7196,7 +7196,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7240,7 +7240,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7257,7 +7257,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7363,7 +7363,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7407,7 +7407,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7424,7 +7424,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7530,7 +7530,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7574,7 +7574,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7591,7 +7591,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7702,7 +7702,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7746,7 +7746,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7763,7 +7763,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7874,7 +7874,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7918,7 +7918,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7935,7 +7935,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8046,7 +8046,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8090,7 +8090,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8107,7 +8107,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8218,7 +8218,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8261,7 +8261,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8278,7 +8278,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8389,7 +8389,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8432,7 +8432,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8449,7 +8449,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8560,7 +8560,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8603,7 +8603,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8620,7 +8620,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8731,7 +8731,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8774,7 +8774,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8791,7 +8791,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8907,7 +8907,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8950,7 +8950,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8967,7 +8967,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9083,7 +9083,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9126,7 +9126,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9143,7 +9143,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9259,7 +9259,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9302,7 +9302,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9319,7 +9319,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9435,7 +9435,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9478,7 +9478,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9495,7 +9495,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9611,7 +9611,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9656,7 +9656,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9673,7 +9673,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9789,7 +9789,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9834,7 +9834,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9851,7 +9851,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9967,7 +9967,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10012,7 +10012,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10029,7 +10029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10145,7 +10145,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10190,7 +10190,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10207,7 +10207,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10323,7 +10323,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10366,7 +10366,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10383,7 +10383,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10484,7 +10484,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10527,7 +10527,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10544,7 +10544,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10645,7 +10645,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10689,7 +10689,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10706,7 +10706,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10807,7 +10807,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10851,7 +10851,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10868,7 +10868,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10969,7 +10969,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11013,7 +11013,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11030,7 +11030,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11131,7 +11131,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11175,7 +11175,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11192,7 +11192,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11293,7 +11293,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11336,7 +11336,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11353,7 +11353,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11454,7 +11454,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11497,7 +11497,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11514,7 +11514,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11615,7 +11615,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11658,7 +11658,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11675,7 +11675,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11791,7 +11791,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11834,7 +11834,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11851,7 +11851,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11962,7 +11962,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12005,7 +12005,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12022,7 +12022,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12133,7 +12133,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12176,7 +12176,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12193,7 +12193,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12309,7 +12309,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12352,7 +12352,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12369,7 +12369,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12485,7 +12485,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12528,7 +12528,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12545,7 +12545,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12646,7 +12646,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12689,7 +12689,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12706,7 +12706,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12807,7 +12807,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -12851,7 +12851,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -12868,7 +12868,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -12969,7 +12969,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13013,7 +13013,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13030,7 +13030,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13131,7 +13131,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13174,7 +13174,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13191,7 +13191,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13292,7 +13292,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13335,7 +13335,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13352,7 +13352,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13453,7 +13453,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13496,7 +13496,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13513,7 +13513,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13614,7 +13614,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13657,7 +13657,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13674,7 +13674,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13775,7 +13775,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13819,7 +13819,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -13836,7 +13836,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -13952,7 +13952,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -13996,7 +13996,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14013,7 +14013,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14129,7 +14129,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14173,7 +14173,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14190,7 +14190,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14306,7 +14306,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14350,7 +14350,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14367,7 +14367,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14483,7 +14483,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14527,7 +14527,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14544,7 +14544,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14660,7 +14660,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14704,7 +14704,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14721,7 +14721,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14837,7 +14837,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -14879,7 +14879,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -14896,7 +14896,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -14977,7 +14977,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15022,7 +15022,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15039,7 +15039,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15155,7 +15155,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15200,7 +15200,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15217,7 +15217,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15333,7 +15333,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15378,7 +15378,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15395,7 +15395,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15511,7 +15511,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15556,7 +15556,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15573,7 +15573,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15689,7 +15689,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15733,7 +15733,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15750,7 +15750,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -15861,7 +15861,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -15905,7 +15905,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -15922,7 +15922,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16033,7 +16033,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16077,7 +16077,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16094,7 +16094,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16205,7 +16205,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16249,7 +16249,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16266,7 +16266,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16377,7 +16377,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16419,7 +16419,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16436,7 +16436,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16517,7 +16517,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16559,7 +16559,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16576,7 +16576,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16662,7 +16662,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16706,7 +16706,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16723,7 +16723,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -16839,7 +16839,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -16883,7 +16883,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -16900,7 +16900,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17016,7 +17016,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17060,7 +17060,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17077,7 +17077,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17193,7 +17193,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17236,7 +17236,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17253,7 +17253,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17344,7 +17344,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17387,7 +17387,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17404,7 +17404,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17520,7 +17520,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17563,7 +17563,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17580,7 +17580,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17696,7 +17696,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17739,7 +17739,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17756,7 +17756,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -17872,7 +17872,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -17915,7 +17915,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -17932,7 +17932,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18023,7 +18023,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18065,7 +18065,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18082,7 +18082,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18163,7 +18163,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18206,7 +18206,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18223,7 +18223,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18339,7 +18339,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18382,7 +18382,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18399,7 +18399,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18515,7 +18515,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18559,7 +18559,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18576,7 +18576,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18682,7 +18682,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18726,7 +18726,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18743,7 +18743,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -18849,7 +18849,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -18893,7 +18893,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -18910,7 +18910,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19016,7 +19016,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19060,7 +19060,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19077,7 +19077,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19183,7 +19183,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19226,7 +19226,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19243,7 +19243,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19324,7 +19324,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19366,7 +19366,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19383,7 +19383,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19464,7 +19464,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19507,7 +19507,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19524,7 +19524,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19625,7 +19625,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19668,7 +19668,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19685,7 +19685,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19786,7 +19786,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19829,7 +19829,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -19846,7 +19846,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -19947,7 +19947,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -19990,7 +19990,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20007,7 +20007,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20108,7 +20108,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20150,7 +20150,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20167,7 +20167,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20253,7 +20253,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20297,7 +20297,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20314,7 +20314,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20425,7 +20425,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20469,7 +20469,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20486,7 +20486,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20597,7 +20597,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20640,7 +20640,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20657,7 +20657,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20773,7 +20773,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20816,7 +20816,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -20833,7 +20833,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -20949,7 +20949,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -20992,7 +20992,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21009,7 +21009,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21125,7 +21125,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21168,7 +21168,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21185,7 +21185,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21301,7 +21301,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21344,7 +21344,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21361,7 +21361,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21462,7 +21462,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21505,7 +21505,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21522,7 +21522,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21623,7 +21623,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21666,7 +21666,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21683,7 +21683,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21784,7 +21784,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -21827,7 +21827,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -21844,7 +21844,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -21960,7 +21960,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22003,7 +22003,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22020,7 +22020,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22136,7 +22136,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22180,7 +22180,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22197,7 +22197,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22313,7 +22313,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22357,7 +22357,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22374,7 +22374,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22490,7 +22490,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22534,7 +22534,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22551,7 +22551,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22667,7 +22667,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22711,7 +22711,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22728,7 +22728,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -22844,7 +22844,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -22888,7 +22888,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -22905,7 +22905,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23021,7 +23021,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23065,7 +23065,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23082,7 +23082,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23198,7 +23198,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23242,7 +23242,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23259,7 +23259,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23375,7 +23375,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23419,7 +23419,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23436,7 +23436,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23552,7 +23552,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23596,7 +23596,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23613,7 +23613,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23729,7 +23729,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23772,7 +23772,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23789,7 +23789,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -23905,7 +23905,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -23948,7 +23948,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -23965,7 +23965,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24081,7 +24081,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24123,7 +24123,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24140,7 +24140,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24226,7 +24226,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24269,7 +24269,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24286,7 +24286,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24402,7 +24402,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24445,7 +24445,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24462,7 +24462,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24578,7 +24578,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24621,7 +24621,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24638,7 +24638,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24754,7 +24754,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24797,7 +24797,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24814,7 +24814,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -24930,7 +24930,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -24973,7 +24973,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -24990,7 +24990,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25106,7 +25106,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25149,7 +25149,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25166,7 +25166,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25282,7 +25282,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25325,7 +25325,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25342,7 +25342,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25458,7 +25458,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25501,7 +25501,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25518,7 +25518,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25634,7 +25634,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25678,7 +25678,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25695,7 +25695,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25811,7 +25811,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -25855,7 +25855,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -25872,7 +25872,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -25988,7 +25988,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26032,7 +26032,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26049,7 +26049,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26165,7 +26165,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26208,7 +26208,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26225,7 +26225,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26341,7 +26341,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26384,7 +26384,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26401,7 +26401,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26517,7 +26517,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26561,7 +26561,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26578,7 +26578,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26689,7 +26689,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26733,7 +26733,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26750,7 +26750,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -26861,7 +26861,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -26903,7 +26903,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -26920,7 +26920,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27001,7 +27001,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27043,7 +27043,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27060,7 +27060,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27146,7 +27146,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27189,7 +27189,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27206,7 +27206,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27317,7 +27317,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27362,7 +27362,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27379,7 +27379,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27495,7 +27495,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27540,7 +27540,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27557,7 +27557,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27673,7 +27673,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27718,7 +27718,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27735,7 +27735,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -27851,7 +27851,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -27896,7 +27896,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -27913,7 +27913,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28029,7 +28029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28071,7 +28071,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28088,7 +28088,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28204,7 +28204,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28246,7 +28246,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28263,7 +28263,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28379,7 +28379,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28421,7 +28421,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28438,7 +28438,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28524,7 +28524,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28567,7 +28567,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28584,7 +28584,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28700,7 +28700,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28743,7 +28743,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28760,7 +28760,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -28876,7 +28876,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -28919,7 +28919,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -28936,7 +28936,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29052,7 +29052,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29095,7 +29095,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29112,7 +29112,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29213,7 +29213,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29256,7 +29256,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29273,7 +29273,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29374,7 +29374,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -29665,7 +29665,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -29682,7 +29682,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -29763,7 +29763,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Time_Arithmetical/xslstable/TEE_TimeArithm_API.xsl b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Time_Arithmetical/xslstable/TEE_TimeArithm_API.xsl
new file mode 100644
index 0000000..fcd12fd
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/Time_Arithmetical/xslstable/TEE_TimeArithm_API.xsl
@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Copyright (c) 2014, STMicroelectronics International N.V. -->
+<!-- All rights reserved. -->
+<!-- -->
+<!-- Redistribution and use in source and binary forms, with or without -->
+<!-- modification, are permitted provided that the following conditions are met: -->
+<!-- -->
+<!-- 1. Redistributions of source code must retain the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer. -->
+<!-- -->
+<!-- 2. Redistributions in binary form must reproduce the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer in the documentation -->
+<!-- and/or other materials provided with the distribution. -->
+<!-- -->
+<!-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -->
+<!-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -->
+<!-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -->
+<!-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -->
+<!-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
+<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
+<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -->
+<!-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -->
+<!-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -->
+<!-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -->
+<!-- POSSIBILITY OF SUCH DAMAGE. -->
+
+<xsl:stylesheet version="1.0"
+xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="text"/>
+<xsl:strip-space elements="*"/>
+<xsl:param name="target"/>
+
+<xsl:template match="package">
+<xsl:text>
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <pthread.h>
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+#include "tee_internal_api.h"
+#undef TA_UUID
+#include "ta_answerSuccessTo_OpenSession_Invoke_test.h"
+#undef TA_UUID
+#include "tee_api_defines.h"
+#undef TA_UUID
+#include "TTA_Arithmetical_protocol.h"
+#undef TA_UUID
+#include "TTA_Time_protocol.h"
+#include "xml_timearithm_api.h"
+
+static bool xtest_init = false;
+
+</xsl:text>
+static bool xtest_tee_init(ADBG_Case_t *c)
+{
+ if (xtest_init) {
+ return true;
+ }
+ SHARE_MEM01 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM01)) {
+ goto exit;
+ }
+ SHARE_MEM02 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c,SHARE_MEM02)) {
+ goto exit;
+ }
+ SHARE_MEM03 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c,SHARE_MEM03)) {
+ goto exit;
+ }
+ SESSION01 = malloc(sizeof(TEEC_Session));
+ if (!ADBG_EXPECT_NOT_NULL(c,SESSION01)) {
+ goto exit;
+ }
+ CONTEXT01 = malloc(sizeof(TEEC_Context));
+ if (!ADBG_EXPECT_NOT_NULL(c,CONTEXT01)) {
+ goto exit;
+ }
+ OPERATION01 = malloc(sizeof(TEEC_Operation));
+ if (!ADBG_EXPECT_NOT_NULL(c,OPERATION01)) {
+ goto exit;
+ }
+
+ xtest_init = true;
+
+ return xtest_init;
+
+exit:
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SHARE_MEM03) {
+ free(SHARE_MEM03);
+ SHARE_MEM03 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+
+ xtest_init = false;
+ return xtest_init;
+}
+
+static void xtest_tee_deinit(void)
+{
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SHARE_MEM03) {
+ free(SHARE_MEM03);
+ SHARE_MEM03 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+
+ xtest_init = false;
+}
+
+<xsl:for-each select="initial-state/scenario">
+/*<xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" />*/
+static void xtest_tee_<xsl:value-of select="position()+8500" />(ADBG_Case_t *c)
+{
+<xsl:text> if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return ;
+</xsl:text>
+<xsl:for-each select="./body/call/operation">
+ <xsl:apply-templates select="."></xsl:apply-templates>
+</xsl:for-each>
+<xsl:if test="position()=last()"><xsl:text> xtest_tee_deinit();</xsl:text></xsl:if>
+}
+</xsl:for-each>
+
+<xsl:for-each select="initial-state/scenario">
+<xsl:variable name="position" select="position()+8500" />
+ADBG_CASE_DEFINE(XTEST_TEE_<xsl:value-of select="$position" />, xtest_tee_<xsl:value-of select="$position" /><xsl:text>,
+ /* Title */
+ "</xsl:text><xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" /><xsl:text>",
+ /* Short description */
+ "</xsl:text><xsl:value-of select="substring-before(./@name, ' ')" /><xsl:text>",
+ /* Requirement IDs */
+ "</xsl:text><xsl:value-of select="./req[last()]/@name" /><xsl:text>",
+ /* How to implement */
+ "Description of how to implement ...");</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match="operation">
+<xsl:choose>
+<!--Call an operation with ADBG_EXPECT() macro.-->
+<xsl:when test="(contains(./argument[last()]/parameter/@name, 'xpected') and not(contains(./@name, 'OpenSession')) and not(contains(./@name, 'InitializeContext')))"> ADBG_EXPECT(c, <xsl:for-each select="./argument"><xsl:if test="position()=last()"><xsl:apply-templates select="value"></xsl:apply-templates></xsl:if></xsl:for-each>, <xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument/value"><xsl:if test="position()>1 and not(position()=last())">, </xsl:if><xsl:if test="not(position()=last())"><xsl:apply-templates select="."></xsl:apply-templates></xsl:if>
+ </xsl:for-each>));
+</xsl:when>
+<xsl:when test="(contains(./@name, 'Invoke_ProcessInvokeTAOpenSession'))"> ADBG_EXPECT(c, <xsl:for-each select="./argument"><xsl:if test="position()=last()"><xsl:apply-templates select="value"></xsl:apply-templates></xsl:if></xsl:for-each>, <xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument/value"><xsl:if test="position()>1 and not(position()=last())">, </xsl:if><xsl:if test="not(position()=last())"><xsl:apply-templates select="."></xsl:apply-templates></xsl:if>
+ </xsl:for-each>));
+</xsl:when>
+<xsl:otherwise>
+<xsl:text> </xsl:text><xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument"><xsl:if test="position()>1">, </xsl:if>
+ <xsl:apply-templates select="./value"></xsl:apply-templates>
+ </xsl:for-each>);
+</xsl:otherwise>
+</xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="value">
+<xsl:choose>
+<!--xsl:when test=".='IN_sharedMem_size'"><xsl:value-of select="./@name" />
+</xsl:when-->
+<xsl:when test="((contains(./@name, 'UUID')) and not(contains(./@name, 'VALUE_PREDEFINED_UUID')) and not(contains(./@name, 'CMD_TEE_GetPropertyAsUUID_withoutEnum')))"><xsl:text>&</xsl:text><xsl:value-of select="./@name" />
+</xsl:when>
+<xsl:when test="(contains(./@name, 'CMD_DS'))"><xsl:text>CMD</xsl:text><xsl:value-of select="substring(./@name, string-length('CMD_DS')+1)" />
+</xsl:when>
+<xsl:when test="(../type/@name='ALL_TEE_NAMES' and ./@name='NULL')"><xsl:text>_device</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<!--xsl:text>&</xsl:text--><xsl:value-of select="./@name" />
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="parameter">
+ <xsl:value-of select="./@name" />
+</xsl:template>
+
+<xsl:template match="@name">
+<xsl:choose>
+<xsl:when test=".='RequestCancellation'"><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='InitializeContext'"><xsl:text>XML_</xsl:text><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:when test=".='OpenSession'"><xsl:text>XML_</xsl:text><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:when test=".='SelectApp'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='CloseSession'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='FinalizeContext'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='createThread'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='Test_Tool_Erase_Persistent_Time'"><xsl:value-of select="." /><xsl:text>(c, SESSION01, CMD_TEE_SetTAPersistentTime_and_GetTAPersistentTime</xsl:text>
+</xsl:when>
+<xsl:when test=".='PARAM_TYPES'"><xsl:text>OPERATION_TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/TrustedCoreFw/xmlpatch/v1_1_0_4-2014_11_07/TEE_Internal_API.xml.patch b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/TrustedCoreFw/xmlpatch/v1_1_0_4-2014_11_07/TEE_Internal_API.xml.patch
new file mode 100644
index 0000000..f00834a
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/TrustedCoreFw/xmlpatch/v1_1_0_4-2014_11_07/TEE_Internal_API.xml.patch
@@ -0,0 +1,1595 @@
+--- TEE_Internal_API.xml.ori 2012-10-22 22:13:30.000000000 +0200
++++ TEE_Internal_API.xml 2015-04-21 10:19:10.859488370 +0200
+@@ -46,7 +46,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -63,7 +63,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -144,7 +144,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -191,7 +191,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -208,7 +208,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -299,7 +299,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -353,7 +353,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -370,7 +370,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -451,7 +451,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -663,7 +663,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -680,7 +680,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -781,7 +781,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -828,7 +828,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -845,7 +845,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -946,7 +946,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -993,7 +993,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1010,7 +1010,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1111,7 +1111,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1158,7 +1158,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1175,7 +1175,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1271,7 +1271,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1320,7 +1320,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1337,7 +1337,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1455,7 +1455,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1503,7 +1503,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1520,7 +1520,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1616,7 +1616,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1828,7 +1828,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -1845,7 +1845,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -1946,7 +1946,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -1993,7 +1993,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2010,7 +2010,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2111,7 +2111,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2153,7 +2153,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2170,7 +2170,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2261,7 +2261,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2308,7 +2308,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2325,7 +2325,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2426,7 +2426,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2473,7 +2473,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -2490,7 +2490,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -2576,7 +2576,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -2704,7 +2704,7 @@
+ <argument>
+ <parameter name="OUT_Enumerator" />
+ <type name="ALL_ENUMERATORS" />
+- <value name="ENUMERATOR1" />
++ <value name="&ENUMERATOR1" />
+ </argument>
+ <argument>
+ <parameter name="OUT_ExpectedReturn" />
+@@ -3055,7 +3055,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3072,7 +3072,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3129,7 +3129,7 @@
+ <argument>
+ <parameter name="OUT_Enumerator" />
+ <type name="ALL_ENUMERATORS" />
+- <value name="ENUMERATOR1" />
++ <value name="&ENUMERATOR1" />
+ </argument>
+ <argument>
+ <parameter name="OUT_ExpectedReturn" />
+@@ -3227,7 +3227,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3278,7 +3278,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3295,7 +3295,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3352,7 +3352,7 @@
+ <argument>
+ <parameter name="OUT_Enumerator" />
+ <type name="ALL_ENUMERATORS" />
+- <value name="ENUMERATOR1" />
++ <value name="&ENUMERATOR1" />
+ </argument>
+ <argument>
+ <parameter name="OUT_ExpectedReturn" />
+@@ -3450,7 +3450,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3575,7 +3575,7 @@
+ <argument>
+ <parameter name="OUT_Enumerator" />
+ <type name="ALL_ENUMERATORS" />
+- <value name="ENUMERATOR1" />
++ <value name="&ENUMERATOR1" />
+ </argument>
+ <argument>
+ <parameter name="OUT_ExpectedReturn" />
+@@ -3707,7 +3707,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3724,7 +3724,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3781,7 +3781,7 @@
+ <argument>
+ <parameter name="OUT_Enumerator" />
+ <type name="ALL_ENUMERATORS" />
+- <value name="ENUMERATOR1" />
++ <value name="&ENUMERATOR1" />
+ </argument>
+ <argument>
+ <parameter name="OUT_ExpectedReturn" />
+@@ -3847,7 +3847,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -3899,7 +3899,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -3916,7 +3916,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -3997,7 +3997,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4044,7 +4044,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4061,7 +4061,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4162,7 +4162,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4209,7 +4209,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4226,7 +4226,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4327,7 +4327,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4539,7 +4539,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4556,7 +4556,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4657,7 +4657,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4704,7 +4704,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4721,7 +4721,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4822,7 +4822,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -4869,7 +4869,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -4886,7 +4886,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -4982,7 +4982,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5029,7 +5029,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5046,7 +5046,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5142,7 +5142,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5189,7 +5189,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5206,7 +5206,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5253,7 +5253,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5361,7 +5361,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5408,7 +5408,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5425,7 +5425,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5521,7 +5521,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5570,7 +5570,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5587,7 +5587,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5678,7 +5678,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5725,7 +5725,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5742,7 +5742,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5833,7 +5833,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -5882,7 +5882,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -5899,7 +5899,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -5990,7 +5990,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6037,7 +6037,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6054,7 +6054,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6155,7 +6155,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6202,7 +6202,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6219,7 +6219,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6320,7 +6320,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6367,7 +6367,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6384,7 +6384,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6485,7 +6485,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6533,7 +6533,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6550,7 +6550,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6631,7 +6631,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6678,7 +6678,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6695,7 +6695,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6786,7 +6786,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -6836,7 +6836,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -6853,7 +6853,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -6934,7 +6934,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7147,7 +7147,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7164,7 +7164,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7255,7 +7255,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7302,7 +7302,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7319,7 +7319,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7420,7 +7420,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7467,7 +7467,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7484,7 +7484,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7585,7 +7585,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -7632,7 +7632,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -7649,7 +7649,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -7750,7 +7750,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8508,7 +8508,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8525,7 +8525,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8626,7 +8626,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8675,7 +8675,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8692,7 +8692,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8788,7 +8788,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8837,7 +8837,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -8854,7 +8854,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -8950,7 +8950,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -8998,7 +8998,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9015,7 +9015,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9111,7 +9111,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9153,7 +9153,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9170,7 +9170,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9261,7 +9261,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9303,7 +9303,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9320,7 +9320,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9411,7 +9411,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9453,7 +9453,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9470,7 +9470,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9561,7 +9561,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9603,7 +9603,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9620,7 +9620,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9711,7 +9711,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9758,7 +9758,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9775,7 +9775,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -9866,7 +9866,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -9913,7 +9913,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -9930,7 +9930,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10016,7 +10016,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10063,7 +10063,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10080,7 +10080,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10171,7 +10171,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10213,7 +10213,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10230,7 +10230,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10321,7 +10321,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10363,7 +10363,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10380,7 +10380,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10471,7 +10471,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10519,7 +10519,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10536,7 +10536,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10632,7 +10632,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10679,7 +10679,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10696,7 +10696,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10792,7 +10792,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -10841,7 +10841,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -10858,7 +10858,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -10976,7 +10976,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11023,7 +11023,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11040,7 +11040,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11141,7 +11141,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
+@@ -11188,7 +11188,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="OUT_expected_TEEC_result" />
+@@ -11205,7 +11205,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ <argument>
+ <parameter name="IN_session" />
+@@ -11306,7 +11306,7 @@
+ <argument>
+ <parameter name="IN_context" />
+ <type name="ALL_CONTEXTS" />
+- <value name="CONTEXT02" />
++ <value name="CONTEXT01" />
+ </argument>
+ </operation>
+ <observations />
diff --git a/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/TrustedCoreFw/xslstable/TEE_Internal_API.xsl b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/TrustedCoreFw/xslstable/TEE_Internal_API.xsl
new file mode 100644
index 0000000..525ba3f
--- /dev/null
+++ b/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM/packages/TrustedCoreFw/xslstable/TEE_Internal_API.xsl
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Copyright (c) 2014, STMicroelectronics International N.V. -->
+<!-- All rights reserved. -->
+<!-- -->
+<!-- Redistribution and use in source and binary forms, with or without -->
+<!-- modification, are permitted provided that the following conditions are met: -->
+<!-- -->
+<!-- 1. Redistributions of source code must retain the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer. -->
+<!-- -->
+<!-- 2. Redistributions in binary form must reproduce the above copyright notice, -->
+<!-- this list of conditions and the following disclaimer in the documentation -->
+<!-- and/or other materials provided with the distribution. -->
+<!-- -->
+<!-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -->
+<!-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -->
+<!-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -->
+<!-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -->
+<!-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
+<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
+<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -->
+<!-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -->
+<!-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -->
+<!-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -->
+<!-- POSSIBILITY OF SUCH DAMAGE. -->
+
+<xsl:stylesheet version="1.0"
+xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="text"/>
+<xsl:strip-space elements="*"/>
+<xsl:param name="target"/>
+
+<xsl:template match="package">
+<xsl:text>
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "xtest_test.h"
+#include "xtest_helpers.h"
+#include "tee_internal_api.h"
+#undef TA_UUID
+#include "ta_answerSuccessTo_OpenSession_Invoke_test.h"
+#undef TA_UUID
+#include "tee_api_defines.h"
+#include "xml_internal_api.h"
+
+static bool xtest_init = false;
+
+</xsl:text>
+static bool xtest_tee_init(ADBG_Case_t *c)
+{
+ if (xtest_init) {
+ return true;
+ }
+ SHARE_MEM01 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM01)) {
+ goto exit;
+ }
+ SHARE_MEM02 = malloc(sizeof(TEEC_SharedMemory));
+ if (!ADBG_EXPECT_NOT_NULL(c, SHARE_MEM02)) {
+ goto exit;
+ }
+ SESSION01 = malloc(sizeof(TEEC_Session));
+ if (!ADBG_EXPECT_NOT_NULL(c, SESSION01)) {
+ goto exit;
+ }
+ SESSION02 = malloc(sizeof(TEEC_Session));
+ if (!ADBG_EXPECT_NOT_NULL(c, SESSION02)) {
+ goto exit;
+ }
+ CONTEXT01 = malloc(sizeof(TEEC_Context));
+ if (!ADBG_EXPECT_NOT_NULL(c, CONTEXT01)) {
+ goto exit;
+ }
+ OPERATION01 = malloc(sizeof(TEEC_Operation));
+ if (!ADBG_EXPECT_NOT_NULL(c, OPERATION01)) {
+ goto exit;
+ }
+
+ xtest_init = true;
+
+ return xtest_init;
+
+exit:
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (SESSION02) {
+ free(SESSION02);
+ SESSION02 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+
+ xtest_init = false;
+ return xtest_init;
+}
+
+static void xtest_tee_deinit(void)
+{
+ if (SHARE_MEM01) {
+ free(SHARE_MEM01);
+ SHARE_MEM01 = NULL;
+ }
+ if (SHARE_MEM02) {
+ free(SHARE_MEM02);
+ SHARE_MEM02 = NULL;
+ }
+ if (SESSION01) {
+ free(SESSION01);
+ SESSION01 = NULL;
+ }
+ if (SESSION02) {
+ free(SESSION02);
+ SESSION02 = NULL;
+ }
+ if (CONTEXT01) {
+ free(CONTEXT01);
+ CONTEXT01 = NULL;
+ }
+ if (OPERATION01) {
+ free(OPERATION01);
+ OPERATION01 = NULL;
+ }
+
+ xtest_init = false;
+}
+
+<xsl:for-each select="initial-state/scenario">
+/*<xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" />*/
+static void xtest_tee_<xsl:value-of select="position()+8000" />(ADBG_Case_t *c)
+{
+<xsl:text> if (!ADBG_EXPECT_TRUE(c, xtest_tee_init(c)))
+ return ;
+</xsl:text>
+<xsl:for-each select="./body/call/operation">
+ <xsl:apply-templates select="."></xsl:apply-templates>
+</xsl:for-each>
+<xsl:if test="position()=last()"><xsl:text> xtest_tee_deinit();</xsl:text></xsl:if>
+}
+</xsl:for-each>
+<xsl:for-each select="initial-state/scenario">
+<xsl:variable name="position" select="position()+8000" />
+ADBG_CASE_DEFINE(XTEST_TEE_<xsl:value-of select="$position" />, xtest_tee_<xsl:value-of select="$position" /><xsl:text>,
+ /* Title */
+ "</xsl:text><xsl:value-of select="substring(substring-after(./@name, '('), 0, 9)" /><xsl:text>",
+ /* Short description */
+ "</xsl:text><xsl:value-of select="substring-before(./@name, ' ')" /><xsl:text>",
+ /* Requirement IDs */
+ "</xsl:text><xsl:value-of select="./req[last()]/@name" /><xsl:text>",
+ /* How to implement */
+ "Description of how to implement ...");</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match="operation">
+<xsl:choose>
+<!--Call an operation with ADBG_EXPECT() macro.-->
+<xsl:when test="(contains(./argument[last()]/parameter/@name, 'xpected') and not(contains(./@name, 'OpenSession')) and not(contains(./@name, 'InitializeContext')))"> ADBG_EXPECT(c, <xsl:for-each select="./argument"><xsl:if test="position()=last()"><xsl:apply-templates select="value"></xsl:apply-templates></xsl:if></xsl:for-each>, <xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument/value"><xsl:if test="position()>1 and not(position()=last())">, </xsl:if><xsl:if test="not(position()=last())"><xsl:apply-templates select="."></xsl:apply-templates></xsl:if>
+ </xsl:for-each>));
+</xsl:when>
+<xsl:when test="(contains(./@name, 'Invoke_ProcessInvokeTAOpenSession'))"> ADBG_EXPECT(c, <xsl:for-each select="./argument"><xsl:if test="position()=last()"><xsl:apply-templates select="value"></xsl:apply-templates></xsl:if></xsl:for-each>, <xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument/value"><xsl:if test="position()>1 and not(position()=last())">, </xsl:if><xsl:if test="not(position()=last())"><xsl:apply-templates select="."></xsl:apply-templates></xsl:if>
+ </xsl:for-each>));
+</xsl:when>
+<xsl:otherwise>
+<xsl:text> </xsl:text><xsl:apply-templates select="./@name"></xsl:apply-templates><xsl:for-each select="./argument"><xsl:if test="position()>1">, </xsl:if>
+ <xsl:apply-templates select="./value"></xsl:apply-templates>
+ </xsl:for-each>);
+</xsl:otherwise>
+</xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="value">
+<xsl:choose>
+<xsl:when test="((contains(./@name, 'UUID')) and not(contains(./@name, 'VALUE_PREDEFINED_UUID')) and not(contains(./@name, 'CMD_TEE_GetPropertyAsUUID_withoutEnum')))"><xsl:text>&</xsl:text><xsl:value-of select="./@name" />
+</xsl:when>
+<xsl:when test="(contains(./@name, 'CMD_DS'))"><xsl:text>CMD</xsl:text><xsl:value-of select="substring(./@name, string-length('CMD_DS')+1)" />
+</xsl:when>
+<xsl:when test="(../type/@name='ALL_TEE_NAMES' and ./@name='NULL')"><xsl:text>_device</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<!--xsl:text>&</xsl:text--><xsl:value-of select="./@name" />
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="parameter">
+ <xsl:value-of select="./@name" />
+</xsl:template>
+
+<xsl:template match="@name">
+<xsl:choose>
+<xsl:when test=".='RequestCancellation'"><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='InitializeContext'"><xsl:text>XML_</xsl:text><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:when test=".='OpenSession'"><xsl:text>XML_</xsl:text><xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:when>
+<xsl:when test=".='SelectApp'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='CloseSession'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='FinalizeContext'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='createThread'"><xsl:text>TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:when test=".='PARAM_TYPES'"><xsl:text>OPERATION_TEEC_</xsl:text><xsl:value-of select="." /><xsl:text>(</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<xsl:value-of select="." /><xsl:text>(c, </xsl:text>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/scripts/.env b/scripts/.env
new file mode 100644
index 0000000..8259f75
--- /dev/null
+++ b/scripts/.env
@@ -0,0 +1,193 @@
+ERR=0
+red='\e[0;31;1m'
+green='\e[0;32;1m'
+yellow='\e[0;33m'
+blue='\e[0;34m'
+lightblue='\e[0;94m'
+blightblue='\e[0;94;1m'
+bold='\e[0;1m'
+NC='\e[0m' # No Color
+MSGNF="${red}[ NOT FOUND ]${NC}"
+
+LCI_MSG_OK=`printf "%s%10s%s" ${green} "OK" ${NC}`
+LCI_MSG_ERROR=`printf "%s%10s%s" ${red} "ERROR" ${NC}`
+LCI_MSG_INFO=`printf "%s%10s%s" ${lightblue} "Info" ${NC}`
+LCI_MSG_WARNING=`printf "%s%10s%s" ${yellow} "Warning" ${NC}`
+LCI_MSG=`printf "%s%10s%s" "" `
+LCI_MSG_HEADER=`printf "%s%10s%s" ${blightblue} "" ${NC}`
+MSGF="${green}[ FOUND ]${NC}"
+
+function LCI_QUIT () {
+ printf "${LCI_MSG_ERROR} | ${red}Check/Update your config${NC}\n";
+ LCI_PRINT_SEPARATOR
+ exit;
+}
+
+function LCI_FORCE_QUIT () {
+ printf "${LCI_MSG_ERROR} | ${red}%s${NC}\n" "${1}";
+ LCI_PRINT_SEPARATOR
+ exit;
+}
+
+function LCI_PRINT_MSG () {
+ printf "${LCI_MSG} | %-30s\n" "${1}";
+}
+
+function LCI_PRINT_INFO () {
+ printf "${LCI_MSG_INFO} | %-30s\n" "${1}";
+}
+
+function LCI_PRINT_WARNING () {
+ printf "${LCI_MSG_WARNING} | ${yellow}%-30s${NC}\n" "${1}";
+}
+
+function LCI_PRINT_L1 () {
+ printf "${LCI_MSG_INFO} | ${lightblue}%-30s${NC}\n" "${1}";
+}
+
+function LCI_PRINT_HEADER () {
+ printf "${LCI_MSG_HEADER} | ${blightblue}%-30s${NC}\n" "${1}";
+}
+
+function LCI_PRINT_SEPARATOR () {
+ echo -e "${bold}--------------------------------------------------------------------------${NC}";
+}
+
+function LCI_PRINT_CHECK_OK () {
+ printf "${LCI_MSG_OK} | %-30s : %s\n" ${1} ${!1};
+}
+
+function LCI_PRINT_PATCH_CHECK_OK () {
+ printf "${LCI_MSG_OK} | %s\n" ${1};
+}
+
+function LCI_PRINT_CHECK_WARNING () {
+ printf "${LCI_MSG_WARNING} | %-30s : %s\n" ${1} ${!1};
+}
+
+function LCI_PRINT_PATCH_CHECK_WARNING () {
+ printf "${LCI_MSG_WARNING} | %s NOT FOUND\n" ${1};
+}
+
+function LCI_PRINT_CHECK_ERROR () {
+ printf "${LCI_MSG_ERROR} | %-30s : %s\n" ${1} ${!1};
+ ERR=1;
+}
+
+function LCI_PRINT_PATCH_CHECK_ERROR () {
+ printf "${LCI_MSG_ERROR} | %s\n" ${1};
+ ERR=1;
+}
+
+function LCI_CHECKDIR () {
+if [ ! -z ${!1} ]&&[ -d ${!1} ]; then
+LCI_PRINT_CHECK_OK "${1}"
+else
+LCI_PRINT_CHECK_ERROR "${1}"
+fi
+}
+
+function LCI_CHECKFILE () {
+if [ -f ${!1} ]; then
+LCI_PRINT_CHECK_OK "${1}"
+else
+LCI_PRINT_CHECK_ERROR "${1}"
+fi
+}
+
+function LCI_PATCH_CHECKFILE () {
+if [ -f ${1} ]; then
+LCI_PRINT_PATCH_CHECK_OK "${1}"
+else
+LCI_PRINT_WARNING "${1} NOT FOUND"
+LCI_PRINT_WARNING "Create dummy ${1}"
+touch ${1}
+fi
+}
+
+
+function LCI_CHECKVAR () {
+if [ ! -z ${!1} ]; then
+LCI_PRINT_CHECK_OK "${1}"
+else
+LCI_PRINT_CHECK_ERROR "${1}"
+fi
+}
+
+function LCI_CHECKOPTDIR () {
+if [ ! -z ${!1} ]&&[ -d ${!1} ]; then
+LCI_PRINT_CHECK_OK "${1}"
+else
+LCI_PRINT_CHECK_WARNING "${1}"
+fi
+}
+
+function LCI_CHECKOPTVAR () {
+if [ ! -z ${!1} ]; then
+LCI_PRINT_CHECK_OK "${1}"
+else
+LCI_PRINT_CHECK_WARNING "${1}"
+fi
+}
+
+function LCI_CPF () {
+ #printf "${LCI_MSG} | copy %-s\n" "${1}";
+ #printf "${LCI_MSG} | to %-s\n" "${2}";
+ cp ${1} ${2};
+}
+
+function LCI_CPD () {
+ #printf "${LCI_MSG} | copy %-s\n" "${1}";
+ #printf "${LCI_MSG} | to %-s\n" "${2}";
+ cp -r ${1} ${2};
+}
+
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_SEPARATOR
+LCI_PRINT_HEADER "Linaro"
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_L1 "User environment"
+LCI_CHECKDIR "CFG_DEV_PATH"
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_L1 "OP-TEE components"
+LCI_CHECKDIR "TA_DEV_KIT_DIR"
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_L1 "Global Platform testsuite"
+LCI_CHECKVAR "CFG_GP_TESTSUITE_ENABLE"
+if [ ${CFG_GP_TESTSUITE_ENABLE} == "y" ]; then
+LCI_CHECKVAR "CFG_GP_API"
+LCI_CHECKDIR "CFG_GP_PACKAGE_PATH"
+LCI_CHECKDIR "CFG_GP_XSL_PACKAGE_PATH"
+fi
+
+LCI_PRINT_SEPARATOR
+if [ ${ERR} == 0 ]; then
+ if [ ! -f .conf ]; then
+ while true; do
+ echo -en "\n\t--> Is your TEE user environment setup correct [y/n] ? : "
+ read -p " " answer
+
+ case $answer in
+ [Nn]* ) YES=0; break;;
+ [Yy]* ) YES=1; break;;
+ * ) echo -e "Please enter yes or no.";;
+ esac
+ done
+
+ if [ ${YES} == 0 ]; then
+ if [ -f .conf ]; then
+ rm .conf;
+ fi
+ LCI_QUIT;
+ fi
+ touch .conf
+ fi
+
+else
+ LCI_QUIT;
+
+fi
diff --git a/scripts/enable_gp_testsuite.sh b/scripts/enable_gp_testsuite.sh
new file mode 100755
index 0000000..7712e38
--- /dev/null
+++ b/scripts/enable_gp_testsuite.sh
@@ -0,0 +1,358 @@
+#!/bin/bash
+
+# Initialization
+if [ -f .env ]; then
+. .env
+else
+echo -e " ERROR: .env NOT FOUND";
+echo -e " ERROR: .env must be at the same location as $0";
+exit 0;
+fi;
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_HEADER "Running `basename $0`"
+LCI_PRINT_SEPARATOR
+LCI_PRINT_HEADER "Enable Global Platform testsuite"
+LCI_PRINT_L1 "global platform package: ${CFG_GP_PACKAGE_PATH}"
+LCI_PRINT_L1 "stm package: ${CFG_GP_XSL_PACKAGE_PATH}"
+LCI_PRINT_L1 "GP api: ${CFG_GP_API}"
+
+LCI_PRINT_SEPARATOR
+echo -e "+ Install"
+echo -e "| Checking \"xalan\" tool ..."
+if [ "" = "`which xalan`" ]; then
+ echo -e "ERROR: \"xalan\" is not detected on the system. Please install it."
+ exit 1
+else
+ echo -e "OK: \"xalan\" is detected on the system."
+fi
+
+echo -e "| Processing ..."
+
+GP_XTEST_OUT_DIR="${CFG_DEV_PATH}/optee_test/host/xtest"
+export GP_XTEST_OUT_DIR
+GP_XTEST_IN_DIR="${GP_XTEST_OUT_DIR}/global_platform/${CFG_GP_API}"
+export GP_XTEST_IN_DIR
+
+GP_USERTA_DIR="${CFG_DEV_PATH}/optee_test/ta"
+export GP_USERTA_DIR
+
+echo -e "| Clean"
+RMFILELIST="adbg_case_declare.h adbg_entry_declare.h \
+ xtest_7000.c xtest_7500.c xtest_8000.c \
+ xtest_8500.c xtest_9000.c \
+ "
+for file in ${RMFILELIST}
+do
+ if [ -f ${GP_XTEST_OUT_DIR}/${file} ]; then
+ echo "${GP_XTEST_OUT_DIR}/${file} DELETED"
+ rm ${GP_XTEST_OUT_DIR}/$file
+ fi
+done
+
+echo -e "| Import"
+if [ ! -d ${GP_XTEST_IN_DIR} ]; then
+ mkdir -p ${GP_XTEST_IN_DIR}
+ fi
+rm ${GP_XTEST_IN_DIR}/*
+
+echo -e " *.xml in \"${GP_XTEST_IN_DIR}\""
+find ${CFG_GP_PACKAGE_PATH}/packages -type f -name "*.xml" -exec bash -c '\
+ # echo -e "cp -p $0 ${GP_XTEST_IN_DIR}"; \
+ cp -p $0 ${GP_XTEST_IN_DIR}; \
+ ' {} \;
+
+echo -e " *.xsl in \"${GP_XTEST_IN_DIR}\""
+find ${CFG_GP_XSL_PACKAGE_PATH}/packages -type f -name "*.xsl" -exec bash -c '\
+ # echo -e "cp -p $0 ${GP_XTEST_IN_DIR}"; \
+ cp -p $0 ${GP_XTEST_IN_DIR}; \
+ ' {} \;
+
+echo -e " TTAs in \"${GP_USERTA_DIR}\""
+find ${CFG_GP_PACKAGE_PATH}/TTAs -type d -name "code_files" -exec bash -c '\
+ if [ -d ${GP_USERTA_DIR}/GP_$(basename $(dirname $0)) ]; then \
+ # echo -e "rm ${GP_USERTA_DIR}/GP_$(basename $(dirname $0))/*" ;\
+ rm -rf ${GP_USERTA_DIR}/GP_$(basename $(dirname $0))/* ;\
+ else \
+ # echo -e "mkdir -p ${GP_USERTA_DIR}/GP_$(basename $(dirname $0))" ;\
+ mkdir -p ${GP_USERTA_DIR}/GP_$(basename $(dirname $0)) ;\
+ fi ;\
+ # echo -e "cp -p $0/* ${GP_USERTA_DIR}/GP_$(basename $(dirname $0))" ;\
+ cp -p $0/* ${GP_USERTA_DIR}/GP_$(basename $(dirname $0)) ;\
+ ' {} \;
+
+find ${CFG_GP_XSL_PACKAGE_PATH}/TTAs -type d -name "code_files" -exec bash -c '\
+ # echo -e "cp -p $0/* ${GP_USERTA_DIR}/GP_$(basename $(dirname $0))" ;\
+ cp -p $0/* ${GP_USERTA_DIR}/GP_$(basename $(dirname $0)) ;\
+ ' {} \;
+
+echo -e "| Generate"
+
+echo -e " file \"${GP_XTEST_OUT_DIR}/adbg_case_declare.h\""
+xalan -in ${GP_XTEST_IN_DIR}/TEE.xml -xsl ${GP_XTEST_IN_DIR}/adbg_case_declare.xsl -out ${GP_XTEST_OUT_DIR}/adbg_case_declare.h
+
+echo -e " file \"${GP_XTEST_OUT_DIR}/adbg_entry_declare.h\""
+xalan -in ${GP_XTEST_IN_DIR}/TEE.xml -xsl ${GP_XTEST_IN_DIR}/adbg_entry_declare.xsl -out ${GP_XTEST_OUT_DIR}/adbg_entry_declare.h
+
+echo -e " file \"${GP_XTEST_OUT_DIR}/xtest_7000.c\""
+xalan -in ${GP_XTEST_IN_DIR}/TEE.xml -xsl ${GP_XTEST_IN_DIR}/TEE.xsl -out ${GP_XTEST_OUT_DIR}/xtest_7000.c
+
+echo -e " file \"${GP_XTEST_OUT_DIR}/xtest_7500.c\""
+xalan -in ${GP_XTEST_IN_DIR}/TEE_DataStorage_API.xml -xsl ${GP_XTEST_IN_DIR}/TEE_DataStorage_API.xsl -out ${GP_XTEST_OUT_DIR}/xtest_7500.c
+
+echo -e " file \"${GP_XTEST_OUT_DIR}/xtest_8000.c\""
+xalan -in ${GP_XTEST_IN_DIR}/TEE_Internal_API.xml -xsl ${GP_XTEST_IN_DIR}/TEE_Internal_API.xsl -out ${GP_XTEST_OUT_DIR}/xtest_8000.c
+
+echo -e " file \"${GP_XTEST_OUT_DIR}/xtest_8500.c\""
+xalan -in ${GP_XTEST_IN_DIR}/TEE_TimeArithm_API.xml -xsl ${GP_XTEST_IN_DIR}/TEE_TimeArithm_API.xsl -out ${GP_XTEST_OUT_DIR}/xtest_8500.c
+
+echo -e " file \"${GP_XTEST_OUT_DIR}/xtest_9000.c\""
+xalan -in ${GP_XTEST_IN_DIR}/TEE_Crypto_API.xml -xsl ${GP_XTEST_IN_DIR}/TEE_Crypto_API.xsl -out ${GP_XTEST_OUT_DIR}/xtest_9000.c
+
+
+echo -e "| Filtering (known failing/crashing test cases)"
+# Linaro
+TESTFILTERLIST="8058 8059"
+# STM Legacy
+TESTFILTERLIST="${TESTFILTERLIST} 6010"
+TESTFILTERLIST="${TESTFILTERLIST} 7038"
+TESTFILTERLIST="${TESTFILTERLIST} 7522 7538 7540 7546 7557"
+TESTFILTERLIST="${TESTFILTERLIST} 7559 7577 7641 7642 7643"
+TESTFILTERLIST="${TESTFILTERLIST} 7644 7686"
+TESTFILTERLIST="${TESTFILTERLIST} 8025 8030 8066"
+TESTFILTERLIST="${TESTFILTERLIST} 8614 8643 8644 8673 8674"
+TESTFILTERLIST="${TESTFILTERLIST} 9001 9053 9072 9073 9074"
+TESTFILTERLIST="${TESTFILTERLIST} 9075 9079 9080 9081 9082"
+TESTFILTERLIST="${TESTFILTERLIST} 9085 9086 9087 9088 9090"
+TESTFILTERLIST="${TESTFILTERLIST} 9091 9092 9093 9095 9096"
+TESTFILTERLIST="${TESTFILTERLIST} 9098 9099 9104 9109 9110"
+TESTFILTERLIST="${TESTFILTERLIST} 9111 9145 9146 9147 9148"
+TESTFILTERLIST="${TESTFILTERLIST} 9149 9160 9174 9181 9182"
+TESTFILTERLIST="${TESTFILTERLIST} 9183 9184 9186 9187 9195"
+TESTFILTERLIST="${TESTFILTERLIST} 9196 9204 9239"
+
+for TEST in ${TESTFILTERLIST}
+do
+
+ echo -en " ${TEST}"
+
+ sed -i 's|^ADBG_SUITE_ENTRY(XTEST_TEE_'${TEST}', NULL)|/\*ADBG_SUITE_ENTRY(XTEST_TEE_'${TEST}', NULL)\*/|g' ${GP_XTEST_OUT_DIR}/xtest_main.c
+ sed -i 's| ADBG_SUITE_ENTRY(XTEST_TEE_'${TEST}', NULL)\\| /\*ADBG_SUITE_ENTRY(XTEST_TEE_'${TEST}', NULL)\*/\\|g' ${GP_XTEST_OUT_DIR}/adbg_entry_declare.h
+
+ # If this is the first/last test case we must move the init/deinit functions
+ # and we add descriptions about why the test case is disabled.
+ case ${TEST} in
+ "7038") #766
+ sed -i 's|/\*d3-ee-b1\*/|/*\n* XTEST test case 7038 fails.\n* TEEC_InvokeCommand: unexpected value 0xffff0000, expected 0xffff0002.\n*/\n\n/\*d3-ee-b1\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7000.c
+ sed -i '752 c\ xtest_tee_deinit();\n' ${GP_XTEST_OUT_DIR}/xtest_7000.c
+ ;;
+ "7522")
+ sed -i 's|/\*9d-76-9b\*/|/*\n* XTEST test case 7522 fails.\n* Invoke_Simple_Function_Object: unexpected value 0xffff3024, expected 0xffff0008.\n*/\n\n/\*9d-76-9b\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7538")
+ sed -i 's|/\*9d-56-33\*/|/*\n* XTEST test case 7538 fails.\n* Invoke_InitObjectAndAttributes: unexpected value 0xf004, expected 0x0.\n*/\n\n/\*9d-56-33\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7540")
+ sed -i 's|/\*9d-32-98\*/|/*\n* XTEST test case 7540 fails.\n* Invoke_InitObjectAndAttributes: unexpected value 0xf004, expected 0x0.\n*/\n\n/\*9d-32-98\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7546")
+ sed -i 's|/\*9d-2a-87\*/|/*\n* XTEST test case 7546 fails.\n* Invoke_GenerateKey: unexpected value 0xffff3024, expected 0xffff0006.\n*/\n\n/\*9d-2a-87\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7557")
+ sed -i 's|/\*9d-0c-88\*/|/*\n* XTEST test case 7557 fails.\n* Invoke_GenerateKey: unexpected value 0x0, expected 0xffff0006.\n*/\n\n/\*9d-0c-88\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7559")
+ sed -i 's|/\*9d-36-04\*/|/*\n* XTEST test case 7559 fails.\n* Invoke_InitObjectAndAttributes: unexpected value 0xf004, expected 0x0.\n*/\n\n/\*9d-36-04\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7577")
+ sed -i 's|/\*9d-ab-23\*/|/*\n* XTEST test case 7577 fails.\n* Invoke_InitObjectAndAttributes: unexpected value 0xffff3024, expected 0xffff0008.\n*/\n\n/\*9d-ab-23\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7641")
+ sed -i 's|/\*9d-bd-3c\*/|/*\n* XTEST test case 7641 fails.\n* Expressions in xml_datastorage_api.h on line 610 and line 613 are false.\n*/\n\n/\*9d-bd-3c\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7642")
+ sed -i 's|/\*9d-30-71\*/|/*\n* XTEST test case 7642 fails.\n* Expressions in xml_datastorage_api.h on line 610 and line 613 are false.\n*/\n\n/\*9d-30-71\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7643")
+ sed -i 's|/\*9d-e4-58\*/|/*\n* XTEST test case 7643 fails.\n* Expressions in xml_datastorage_api.h on line 610 and line 613 are false.\n*/\n\n/\*9d-e4-58\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7644")
+ sed -i 's|/\*9d-30-58\*/|/*\n* XTEST test case 7644 fails.\n* Expressions in xml_datastorage_api.h on line 610 and line 613 are false.\n*/\n\n/\*9d-30-58\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "7686")
+ sed -i 's|/\*9d-7e-c2\*/|/*\n* XTEST test case 7686 fails.\n* Invoke_SeekWriteReadObjectData: unexpected value 0xffff3024, expected 0xffff300f.\n* Expression in xml_datastorage_api.h on line 610 is false.\n*/\n\n/\*9d-7e-c2\*/|g' ${GP_XTEST_OUT_DIR}/xtest_7500.c
+ ;;
+ "8025")
+ sed -i 's|/\*a7-85-e1\*/|/*\n* XTEST test case 8025 fails.\n* Expression in xml_internal_api.h on line 333 is false.\n*/\n\n/\*a7-85-e1\*/|g' ${GP_XTEST_OUT_DIR}/xtest_8000.c
+ ;;
+ "8030")
+ sed -i 's|/\*a7-54-fd\*/|/*\n* XTEST test case 8030 fails.\n* TEEC_OpenSession: unexpected value 0xffff0008, expected 0x0.\n* Expression in xml_internal_api.h on line 450 is false.\n\* Invoke_ProcessInvokeTAOpenSession: unexpected value 0xffff0000, expected 0xffff000d.\n*/\n\n/\*a7-54-fd\*/|g' ${GP_XTEST_OUT_DIR}/xtest_8000.c
+ ;;
+ "8066")
+ sed -i 's|/\*a7-fe-d5\*/|/*\n* XTEST test case 8066 fails.\n* Invoke_GetCancellationFlag_RequestedCancel: unexpected value 0xffff0000, expected 0xffff0002.\n* Test case is crashing the XTEST application.\n*/\n\n/\*a7-fe-d5\*/|g' ${GP_XTEST_OUT_DIR}/xtest_8000.c
+ sed -i '1076 c\ xtest_tee_deinit();\n' ${GP_XTEST_OUT_DIR}/xtest_8000.c
+
+ # SED seems to have a bug i.e. it doesn't recognize the pattern below (the second one)
+ # The same two patterns are used in three other files and they work (files xtest_7000.c,
+ # xtest_8500.c and xtest_9000.c), but here in file xtest_8000.c the pattern doesn't work.
+ # That's why we use direct insertion on specific line.
+
+ #sed -i '{ N; N; s|\n/\*\n\* XTEST test case 8066 fails\.| xtest_tee_deinit();\n\}\n\n/\*\n\* XTEST test case 8066 fails\.|g; }' ${GP_XTEST_OUT_DIR}/xtest_8000.c
+ #sed -i -e '{ N; s|}\n xtest_tee_deinit();| xtest_tee_deinit();|g; }' ${GP_XTEST_OUT_DIR}/xtest_8000.c
+ ;;
+ "8614")
+ sed -i 's|/\*ce-cb-68\*/|/*\n* XTEST test case 8614 fails.\n* Invoke_Simple_Function: unexpected value 0xffff0010, expected 0xffff300f.\n*/\n\n/\*ce-cb-68\*/|g' ${GP_XTEST_OUT_DIR}/xtest_8500.c
+ ;;
+ "8643")
+ sed -i 's|/\*ce-22-81\*/|/*\n* XTEST test case 8643 fails.\n* Expression in xml_timearithm_api.h on line 1426 is false.\n*/\n\n/\*ce-22-81\*/|g' ${GP_XTEST_OUT_DIR}/xtest_8500.c
+ ;;
+ "8644")
+ sed -i 's|/\*ce-8d-59\*/|/*\n* XTEST test case 8644 fails.\n* Expression in xml_timearithm_api.h on line 1426 is false.\n*/\n\n/\*ce-8d-59\*/|g' ${GP_XTEST_OUT_DIR}/xtest_8500.c
+ ;;
+ "8673")
+ sed -i 's|/\*ce-41-5f\*/|/*\n* XTEST test case 8673 fails.\n* Test case is crashing the XTEST application.\n*/\n\n/\*ce-41-5f\*/|g' ${GP_XTEST_OUT_DIR}/xtest_8500.c
+ ;;
+ "8674")
+ sed -i 's|/\*ce-06-ce\*/|/*\n* XTEST test case 8674 fails.\n* Invoke_Simple_Function: unexpected value 0xffff0000, expected 0x0.\n*/\n\n/\*ce-06-ce\*/|g' ${GP_XTEST_OUT_DIR}/xtest_8500.c
+ sed -i '2549 c\ xtest_tee_deinit();\n' ${GP_XTEST_OUT_DIR}/xtest_8500.c
+ ;;
+ "9001")
+ sed -i 's|/\*3b-4a-c9\*/|/*\n* XTEST test case 9001 fails.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff000a, expected 0xffff000c.\n*/\n\n/\*3b-4a-c9\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ sed -i '246 c\ xtest_tee_deinit();\n' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9053")
+ sed -i 's|/\*b6-54-fb\*/|/*\n* XTEST test case 9053 fails.\n* Invoke_Crypto_CipherDoFinal: unexpected value: 0xffff3024, expected 0x0.\n* xml_crypto_api.h at line 1775: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*b6-54-fb\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9072")
+ sed -i 's|/\*50-b6-4b\*/|/*\n* XTEST test case 9072 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-b6-4b\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9073")
+ sed -i 's|/\*50-74-49\*/|/*\n* XTEST test case 9073 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-74-49\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9074")
+ sed -i 's|/\*50-a8-d1\*/|/*\n* XTEST test case 9074 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-a8-d1\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9075")
+ sed -i 's|/\*50-98-71\*/|/*\n* XTEST test case 9075 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-98-71\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9079")
+ sed -i 's|/\*50-36-58\*/|/*\n* XTEST test case 9079 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-36-58\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9080")
+ sed -i 's|/\*50-26-cd\*/|/*\n* XTEST test case 9080 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-26-cd\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9081")
+ sed -i 's|/\*50-d4-60\*/|/*\n* XTEST test case 9081 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-d4-60\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9082")
+ sed -i 's|/\*50-05-a3\*/|/*\n* XTEST test case 9082 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-05-a3\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9085")
+ sed -i 's|/\*50-13-32\*/|/*\n* XTEST test case 9085 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-13-32\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9086")
+ sed -i 's|/\*50-1d-5e\*/|/*\n* XTEST test case 9086 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-1d-5e\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9087")
+ sed -i 's|/\*50-5f-15\*/|/*\n* XTEST test case 9087 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-5f-15\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9088")
+ sed -i 's|/\*50-51-f3\*/|/*\n* XTEST test case 9088 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-51-f3\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9090")
+ sed -i 's|/\*50-47-84\*/|/*\n* XTEST test case 9090 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-47-84\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9091")
+ sed -i 's|/\*50-2a-85\*/|/*\n* XTEST test case 9091 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-2a-85\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9092")
+ sed -i 's|/\*50-df-71\*/|/*\n* XTEST test case 9092 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-df-71\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9093")
+ sed -i 's|/\*50-72-8d\*/|/*\n* XTEST test case 9093 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-72-8d\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9095")
+ sed -i 's|/\*50-bf-2e\*/|/*\n* XTEST test case 9095 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-bf-2e\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9096")
+ sed -i 's|/\*50-9c-c4\*/|/*\n* XTEST test case 9096 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-9c-c4\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9098")
+ sed -i 's|/\*50-e1-70\*/|/*\n* XTEST test case 9098 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-e1-70\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9099")
+ sed -i 's|/\*50-8d-0a\*/|/*\n* XTEST test case 9099 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-8d-0a\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9104")
+ sed -i 's|/\*50-7f-d0\*/|/*\n* XTEST test case 9104 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-7f-d0\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9109")
+ sed -i 's|/\*50-d0-59\*/|/*\n* XTEST test case 9109 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-d0-59\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9110")
+ sed -i 's|/\*50-31-23\*/|/*\n* XTEST test case 9110 fails.\n* Invoke_Crypto_AsymmetricVerifyDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-31-23\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9111")
+ sed -i 's|/\*50-a9-9d\*/|/*\n* XTEST test case 9111 fails.\n* Invoke_Crypto_AsymmetricSignDigest: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-a9-9d\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9145")
+ sed -i 's|/\*50-2b-7a\*/|/*\n* XTEST test case 9145 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-2b-7a\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9146")
+ sed -i 's|/\*50-e7-57\*/|/*\n* XTEST test case 9146 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AsymmetricDecrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-e7-57\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9147")
+ sed -i 's|/\*50-49-d8\*/|/*\n* XTEST test case 9147 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AsymmetricDecrypt: unexpected value 0xffff3024, expected 0xffff0010.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-49-d8\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9148")
+ sed -i 's|/\*50-51-15\*/|/*\n* XTEST test case 9148 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-51-15\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9149")
+ sed -i 's|/\*50-6d-0e\*/|/*\n* XTEST test case 9149 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0xffff0010.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-6d-0e\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9160")
+ sed -i 's|/\*50-83-fe\*/|/*\n* XTEST test case 9160 fails.\n* xml_crypto_api.h at line 1778: saved_cipher_update.buffer has an unexpected content.\n*/\n\n/\*50-83-fe\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9174")
+ sed -i 's|/\*50-7b-4d\*/|/*\n* XTEST test case 9174 fails.\n* Invoke_Crypto_AEInit: unexpected value 0x0, expected 0xffff3024.\n*/\n\n/\*50-7b-4d\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9181")
+ sed -i 's|/\*50-63-e5\*/|/*\n* XTEST test case 9181 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AsymmetricDecrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-63-e5\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9182")
+ sed -i 's|/\*50-ef-f0\*/|/*\n* XTEST test case 9182 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AsymmetricDecrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-ef-f0\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9183")
+ sed -i 's|/\*50-eb-0f\*/|/*\n* XTEST test case 9183 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AsymmetricDecrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-eb-0f\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9184")
+ sed -i 's|/\*50-94-06\*/|/*\n* XTEST test case 9184 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-94-06\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9186")
+ sed -i 's|/\*50-94-15\*/|/*\n* XTEST test case 9186 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AsymmetricDecrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-94-15\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9187")
+ sed -i 's|/\*50-ba-29\*/|/*\n* XTEST test case 9187 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-ba-29\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9195")
+ sed -i 's|/\*50-35-98\*/|/*\n* XTEST test case 9195 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AsymmetricDecrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-35-98\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9196")
+ sed -i 's|/\*50-6f-dd\*/|/*\n* XTEST test case 9196 fails.\n* Invoke_Crypto_AsymmetricEncrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_InitObjectWithKeys: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AllocateOperation: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_SetOperationKey: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_AsymmetricDecrypt: unexpected value 0xffff3024, expected 0x0.\n* Invoke_Crypto_FreeAllKeysAndOperations: unexpected value 0xffff3024, expected 0x0.\n*/\n\n/\*50-6f-dd\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9204")
+ sed -i 's|/\*50-ea-af\*/|/*\n* XTEST test case 9204 fails.\n* Invoke_Crypto_MACInit: unexpected value 0x0, expected 0xffff3024.\n*/\n\n/\*50-ea-af\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ "9239")
+ sed -i 's|/\*50-4a-56\*/|/*\n* XTEST test case 9239 fails.\n* xml_crypto_api.h at line 635: unexpected value 0x60000, expected 0xc0000.\n*/\n\n/\*50-4a-56\*/|g' ${GP_XTEST_OUT_DIR}/xtest_9000.c
+ ;;
+ esac
+
+done
+
+cd ${CDIR}
+
+echo -e ""
+echo -e "--------------------------------------------------------------------------"
+echo -e "+ `basename $0` finished";
+echo -e "--------------------------------------------------------------------------"
diff --git a/scripts/patch_gp_testsuite.sh b/scripts/patch_gp_testsuite.sh
new file mode 100755
index 0000000..8e15b13
--- /dev/null
+++ b/scripts/patch_gp_testsuite.sh
@@ -0,0 +1,242 @@
+#!/bin/bash
+
+cd $(dirname $0)
+export CDIR=${PWD}
+
+# Initialization
+if [ -f .env ]; then
+. .env
+else
+echo -e " ERROR: .env NOT FOUND";
+echo -e " ERROR: .env must be at the same location as $0";
+exit 0;
+fi;
+
+if [ ${CFG_GP_TESTSUITE_ENABLE} == "y" ]; then
+ cd ${CDIR}
+ echo ${CDIR}
+ ./enable_gp_testsuite.sh
+
+ # openssl .h file installation
+ if [ -d /usr/include/openssl ]; then
+ forgpdir=${CFG_DEV_PATH}/optee_test/host/xtest/for_gp/
+ mkdir -p ${forgpdir}/include/openssl ${forgpdir}/lib
+ [ -d /usr/include/x86_64-linux-gnu/openssl ] && LCI_CPD /usr/include/x86_64-linux-gnu/openssl ${forgpdir}/include
+ for f in /usr/include/openssl/*.h ; do
+ LCI_CPF $f ${forgpdir}/include/openssl
+ done
+ else
+ LCI_PRINT_WARNING "ERROR: '/usr/include/openssl' NOT FOUND"
+ exit;
+ fi;
+
+ if [ "${CFG_ARM32}" = "y" ]; then
+ LCI_CPF ${CFG_DEV_PATH}/optee_test/host/lib/armv7/libcrypto.a ${forgpdir}/lib
+ else
+ LCI_CPF ${CFG_DEV_PATH}/optee_test/host/lib/armv8/libcrypto.a ${forgpdir}/lib
+ fi
+fi
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_HEADER "Running `basename $0`"
+LCI_PRINT_SEPARATOR
+LCI_PRINT_HEADER "Patch Global Platform testsuite"
+LCI_PRINT_L1 "global platform package: ${CFG_GP_PACKAGE_PATH}"
+LCI_PRINT_L1 "stm package: ${CFG_GP_XSL_PACKAGE_PATH}"
+LCI_PRINT_L1 "GP api: ${CFG_GP_API}"
+
+if [ $(basename ${CFG_GP_PACKAGE_PATH}) == "TEE_Initial_Configuration-Test_Suite_v1_1_0_4-2014_11_07" ]; then
+ LCI_PRINT_L1 "GP package $(basename ${CFG_GP_PACKAGE_PATH}) SUPPORTED"
+
+
+else
+ LCI_FORCE_QUIT "$(basename ${CFG_GP_PACKAGE_PATH}) NOT SUPPORTED"
+ exit;
+
+fi
+
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_L1 "Patch directories structure"
+if [ ! -d ${CFG_GP_PACKAGE_PATH}/packages ]; then
+ LCI_PRINT_MSG "mkdir -p ${CFG_GP_PACKAGE_PATH}/packages"
+ mkdir -p ${CFG_GP_PACKAGE_PATH}/packages
+fi
+
+DIRLIST="ClientAPI Crypto DataStorage Time_Arithmetical TrustedCoreFw"
+for dir in ${DIRLIST}
+ do
+ if [ -d ${CFG_GP_PACKAGE_PATH}/${dir} ]; then
+ LCI_PRINT_MSG "mv ${CFG_GP_PACKAGE_PATH}/${dir}"
+ LCI_PRINT_MSG "to ${CFG_GP_PACKAGE_PATH}/packages"
+ mv ${CFG_GP_PACKAGE_PATH}/${dir} \
+ ${CFG_GP_PACKAGE_PATH}/packages
+ fi
+done
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_L1 "Patch XML files"
+
+declare -A ARRAY
+function LCI_PATCHFILE () {
+ #printf "${LCI_MSG} | apply patch %-s\n" "${2}";
+ #printf "${LCI_MSG} | on %-s\n" "${1}";
+ if [ ! -e ${1}.orig ]; then
+ patch -N -b ${1} < ${2};
+ else
+ LCI_PRINT_WARNING "${1}.orig ALREADY EXISTS"
+ LCI_PRINT_WARNING "PATCH NOT APPLIED"
+ fi
+}
+
+function LCI_PATCH () {
+ LCI_PATCH_CHECKFILE ${1}
+ LCI_PATCH_CHECKFILE "${2}"
+ LCI_PATCHFILE ${1} ${2}
+}
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/packages/ClientAPI/xmlStable/TEE.xml"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/packages/ClientAPI/xmlpatch/v1_1_0_4-2014_11_07/TEE.xml.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/packages/Crypto/xmlStable/TEE_Crypto_API.xml"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/packages/Crypto/xmlpatch/v1_1_0_4-2014_11_07/TEE_Crypto_API.xml.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/packages/DataStorage/xmlStable/TEE_DataStorage_API.xml"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/packages/DataStorage/xmlpatch/v1_1_0_4-2014_11_07/TEE_DataStorage_API.xml.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/packages/Time_Arithmetical/xmlStable/TEE_TimeArithm_API.xml"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/packages/Time_Arithmetical/xmlpatch/v1_1_0_4-2014_11_07/TEE_TimeArithm_API.xml.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/packages/TrustedCoreFw/xmlStable/TEE_Internal_API.xml"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/packages/TrustedCoreFw/xmlpatch/v1_1_0_4-2014_11_07/TEE_Internal_API.xml.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_L1 "Patch TTAs files"
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_Arithmetical/TTA_Arithmetical/code_files/TTA_Arithmetical.c"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_Arithmetical/code_patches/v1_1_0_4-2014_11_07/TTA_Arithmetical.c.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_Arithmetical/TTA_Arithmetical/code_files/TTA_Arithmetical_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_Arithmetical/code_patches/v1_1_0_4-2014_11_07/TTA_Arithmetical_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_files/TTA_check_OpenSession_with_4_parameters_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_check_OpenSession_with_4_parameters/code_patches/v1_1_0_4-2014_11_07/TTA_check_OpenSession_with_4_parameters_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_files/TTA_testingClientAPI_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_testingClientAPI/code_patches/v1_1_0_4-2014_11_07/TTA_testingClientAPI_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_files/TTA_answerSuccessTo_OpenSession_Invoke_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_answerSuccessTo_OpenSession_Invoke/code_patches/v1_1_0_4-2014_11_07/TTA_answerSuccessTo_OpenSession_Invoke_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_files/TTA_answerErrorTo_OpenSession_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_answerErrorTo_OpenSession/code_patches/v1_1_0_4-2014_11_07/TTA_answerErrorTo_OpenSession_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_files/TTA_answerErrorTo_Invoke_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_ClientAPI/TTA_answerErrorTo_Invoke/code_patches/v1_1_0_4-2014_11_07/TTA_answerErrorTo_Invoke_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_Crypto/TTA_Crypto/code_files/TTA_Crypto.c"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_Crypto/code_patches/v1_1_0_4-2014_11_07/TTA_Crypto.c.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_Crypto/TTA_Crypto/code_files/TTA_Crypto_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_Crypto/code_patches/v1_1_0_4-2014_11_07/TTA_Crypto_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_DS/TTA_DS/code_files/TTA_DS_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_DS/code_patches/v1_1_0_4-2014_11_07/TTA_DS_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_DS/TTA_DS/code_files/TTA_DS.c"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_DS/code_patches/v1_1_0_4-2014_11_07/TTA_DS.c.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TEE_include/tee_internal_api.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TEE_include/code_patches/v1_1_0_4-2014_11_07/tee_internal_api.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_TCF/TTA_TCF_ICA/code_files/TTA_TCF_ICA_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_TCF/TTA_TCF_ICA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_ICA_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_files/TTA_TCF_MultipleInstanceTA_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_TCF/TTA_TCF_MultipleInstanceTA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_MultipleInstanceTA_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_TCF/TTA_TCF/code_files/TTA_TCF.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_TCF/TTA_TCF/code_patches/v1_1_0_4-2014_11_07/TTA_TCF.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_files/TTA_TCF_SingleInstanceTA_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_TCF/TTA_TCF_SingleInstanceTA/code_patches/v1_1_0_4-2014_11_07/TTA_TCF_SingleInstanceTA_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_Time/TTA_Time/code_files/TTA_Time_protocol.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time_protocol.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_GP_PACKAGE_PATH}/TTAs/TTA_Time/TTA_Time/code_files/TTA_Time.c"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time.c.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+LCI_PRINT_L1 "Patch HOST files"
+
+ARRAY=(["FILE"]="${CFG_OPTEE_TEST_PATH}/host/xtest/xtest_6000.c"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/host/xtest/xtest_6000.c.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_OPTEE_TEST_PATH}/host/xtest/xtest_main.c"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/host/xtest/xtest_main.c.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_OPTEE_TEST_PATH}/host/xtest/xtest_test.c"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/host/xtest/xtest_test.c.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+ARRAY=(["FILE"]="${CFG_OPTEE_TEST_PATH}/host/xtest/xtest_test.h"
+ ["PATCH"]="${CFG_GP_XSL_PACKAGE_PATH}/host/xtest/xtest_test.h.patch")
+LCI_PATCH ${ARRAY[FILE]} ${ARRAY[PATCH]}
+LCI_PRINT_SEPARATOR
+
+cd ${CDIR}
+
+LCI_PRINT_SEPARATOR
+LCI_PRINT_HEADER "`basename $0` finished";
+LCI_PRINT_SEPARATOR
diff --git a/ta/Makefile b/ta/Makefile
new file mode 100644
index 0000000..92c9a86
--- /dev/null
+++ b/ta/Makefile
@@ -0,0 +1,41 @@
+# Normally this makefile shouldn't be called directly and we expect the output
+# path to be on a certain location to fit together with the other OP-TEE
+# gits and helper scripts.
+ifeq ($O,)
+$(error output path should be specified when calling this makefile)
+endif
+
+TA_DIRS := create_fail_test \
+ crypt \
+ os_test \
+ rpc_test \
+ sims \
+ storage
+
+ifeq ($(CFG_GP_TESTSUITE_ENABLE), y)
+TA_DIRS += GP_TTA_Arithmetical \
+ GP_TTA_Crypto \
+ GP_TTA_DS \
+ GP_TTA_TCF \
+ GP_TTA_TCF_ICA \
+ GP_TTA_TCF_ICA2 \
+ GP_TTA_TCF_MultipleInstanceTA \
+ GP_TTA_TCF_SingleInstanceTA \
+ GP_TTA_Time \
+ GP_TTA_answerErrorTo_Invoke \
+ GP_TTA_answerErrorTo_OpenSession \
+ GP_TTA_answerSuccessTo_OpenSession_Invoke \
+ GP_TTA_check_OpenSession_with_4_parameters \
+ GP_TTA_testingClientAPI
+endif
+
+.PHONY: all
+all: ta
+
+.PHONY: ta
+ta:
+ $(q)$(foreach dir,$(TA_DIRS), $(MAKE) -C $(dir) O=$(O)/$(dir) &&) true
+
+.PHONY: clean
+clean:
+ $(q)$(foreach dir,$(TA_DIRS), $(MAKE) -C $(dir) O=$(O)/$(dir) $@ &&) true
diff --git a/ta/create_fail_test/Makefile b/ta/create_fail_test/Makefile
new file mode 100644
index 0000000..c1b077c
--- /dev/null
+++ b/ta/create_fail_test/Makefile
@@ -0,0 +1,2 @@
+BINARY = c3f6e2c0-3548-11e1-b86c0800200c9a66
+include ../ta_common.mk
diff --git a/ta/create_fail_test/include/ta_create_fail_test.h b/ta/create_fail_test/include/ta_create_fail_test.h
new file mode 100644
index 0000000..7f07c80
--- /dev/null
+++ b/ta/create_fail_test/include/ta_create_fail_test.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TA_CREATE_FAIL_TEST_H
+#define TA_CREATE_FAIL_TEST_H
+
+/* This UUID is generated with the ITU-T UUID generator at
+ http://www.itu.int/ITU-T/asn1/uuid.html */
+#define TA_CREATE_FAIL_TEST_UUID { 0xc3f6e2c0, 0x3548, 0x11e1, \
+ { 0xb8, 0x6c, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
+
+#endif /*TA_CREATE_FAIL_TEST_H */
diff --git a/ta/create_fail_test/include/user_ta_header_defines.h b/ta/create_fail_test/include/user_ta_header_defines.h
new file mode 100644
index 0000000..6f599c0
--- /dev/null
+++ b/ta/create_fail_test/include/user_ta_header_defines.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include <ta_create_fail_test.h>
+
+#define TA_UUID TA_CREATE_FAIL_TEST_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR)
+#define TA_STACK_SIZE (1 * 1024)
+#define TA_DATA_SIZE (32 * 1024)
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/ta/create_fail_test/sub.mk b/ta/create_fail_test/sub.mk
new file mode 100644
index 0000000..d5e3f32
--- /dev/null
+++ b/ta/create_fail_test/sub.mk
@@ -0,0 +1,2 @@
+global-incdirs-y += include
+srcs-y += ta_entry.c
diff --git a/ta/create_fail_test/ta_entry.c b/ta/create_fail_test/ta_entry.c
new file mode 100644
index 0000000..17a5765
--- /dev/null
+++ b/ta/create_fail_test/ta_entry.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <tee_ta_api.h>
+#include <user_ta_header_defines.h>
+
+/*
+ * Trusted Application Entry Points
+ */
+
+/* Called each time a new instance is created */
+TEE_Result TA_CreateEntryPoint(void)
+{
+ return TEE_ERROR_GENERIC;
+}
+
+/* Called each time an instance is destroyed */
+void TA_DestroyEntryPoint(void)
+{
+}
+
+/* Called each time a session is opened */
+TEE_Result TA_OpenSessionEntryPoint(uint32_t nParamTypes,
+ TEE_Param pParams[4],
+ void **ppSessionContext)
+{
+ (void)nParamTypes;
+ (void)pParams;
+ (void)ppSessionContext;
+ return TEE_SUCCESS;
+}
+
+/* Called each time a session is closed */
+void TA_CloseSessionEntryPoint(void *pSessionContext)
+{
+ (void)pSessionContext;
+}
+
+/* Called when a command is invoked */
+TEE_Result TA_InvokeCommandEntryPoint(void *pSessionContext,
+ uint32_t nCommandID,
+ uint32_t nParamTypes,
+ TEE_Param pParams[4])
+{
+ (void)pSessionContext;
+ (void)nCommandID;
+ (void)nParamTypes;
+ (void)pParams;
+ return TEE_ERROR_NOT_SUPPORTED;
+}
diff --git a/ta/crypt/Makefile b/ta/crypt/Makefile
new file mode 100644
index 0000000..ed9caa5
--- /dev/null
+++ b/ta/crypt/Makefile
@@ -0,0 +1,2 @@
+BINARY = cb3e5ba0-adf1-11e0-998b0002a5d5c51b
+include ../ta_common.mk
diff --git a/ta/crypt/aes_impl.c b/ta/crypt/aes_impl.c
new file mode 100644
index 0000000..d0b93b1
--- /dev/null
+++ b/ta/crypt/aes_impl.c
@@ -0,0 +1,1254 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* #define FULL_UNROLL */
+
+#include "aes_impl.h"
+
+typedef unsigned long u32;
+typedef unsigned char u8;
+
+static const u32 Te0[256] = {
+ 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
+ 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
+ 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
+ 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
+ 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
+ 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
+ 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
+ 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
+ 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
+ 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
+ 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
+ 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
+ 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
+ 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
+ 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
+ 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
+ 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
+ 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
+ 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
+ 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
+ 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
+ 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
+ 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
+ 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
+ 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
+ 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
+ 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
+ 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
+ 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
+ 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
+ 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
+ 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
+ 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
+ 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
+ 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
+ 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
+ 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
+ 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
+ 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
+ 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
+ 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
+ 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
+ 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
+ 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
+ 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
+ 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
+ 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
+ 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
+ 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
+ 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
+ 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
+ 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
+ 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
+ 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
+ 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
+ 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
+ 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
+ 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
+ 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
+ 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
+ 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
+ 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
+ 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
+ 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
+};
+
+static const u32 Te1[256] = {
+ 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
+ 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
+ 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
+ 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
+ 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
+ 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
+ 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
+ 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
+ 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
+ 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
+ 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
+ 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
+ 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
+ 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
+ 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
+ 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
+ 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
+ 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
+ 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
+ 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
+ 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
+ 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
+ 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
+ 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
+ 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
+ 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
+ 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
+ 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
+ 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
+ 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
+ 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
+ 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
+ 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
+ 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
+ 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
+ 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
+ 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
+ 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
+ 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
+ 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
+ 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
+ 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
+ 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
+ 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
+ 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
+ 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
+ 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
+ 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
+ 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
+ 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
+ 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
+ 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
+ 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
+ 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
+ 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
+ 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
+ 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
+ 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
+ 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
+ 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
+ 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
+ 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
+ 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
+ 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
+};
+
+static const u32 Te2[256] = {
+ 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
+ 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
+ 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
+ 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
+ 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
+ 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
+ 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
+ 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
+ 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
+ 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
+ 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
+ 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
+ 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
+ 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
+ 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
+ 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
+ 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
+ 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
+ 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
+ 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
+ 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
+ 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
+ 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
+ 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
+ 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
+ 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
+ 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
+ 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
+ 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
+ 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
+ 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
+ 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
+ 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
+ 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
+ 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
+ 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
+ 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
+ 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
+ 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
+ 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
+ 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
+ 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
+ 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
+ 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
+ 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
+ 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
+ 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
+ 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
+ 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
+ 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
+ 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
+ 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
+ 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
+ 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
+ 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
+ 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
+ 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
+ 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
+ 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
+ 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
+ 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
+ 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
+ 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
+ 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
+};
+
+static const u32 Te3[256] = {
+ 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
+ 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
+ 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
+ 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
+ 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
+ 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
+ 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
+ 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
+ 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
+ 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
+ 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
+ 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
+ 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
+ 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
+ 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
+ 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
+ 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
+ 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
+ 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
+ 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
+ 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
+ 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
+ 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
+ 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
+ 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
+ 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
+ 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
+ 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
+ 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
+ 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
+ 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
+ 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
+ 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
+ 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
+ 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
+ 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
+ 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
+ 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
+ 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
+ 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
+ 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
+ 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
+ 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
+ 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
+ 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
+ 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
+ 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
+ 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
+ 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
+ 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
+ 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
+ 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
+ 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
+ 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
+ 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
+ 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
+ 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
+ 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
+ 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
+ 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
+ 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
+ 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
+ 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
+ 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
+};
+
+static const u32 Te4[256] = {
+ 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
+ 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
+ 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,
+ 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U,
+ 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU,
+ 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U,
+ 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU,
+ 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U,
+ 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U,
+ 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU,
+ 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U,
+ 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U,
+ 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U,
+ 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU,
+ 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U,
+ 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U,
+ 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU,
+ 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U,
+ 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U,
+ 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U,
+ 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU,
+ 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU,
+ 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U,
+ 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU,
+ 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU,
+ 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U,
+ 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU,
+ 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U,
+ 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU,
+ 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U,
+ 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U,
+ 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U,
+ 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU,
+ 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U,
+ 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU,
+ 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U,
+ 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU,
+ 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U,
+ 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U,
+ 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU,
+ 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU,
+ 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU,
+ 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U,
+ 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U,
+ 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU,
+ 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U,
+ 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU,
+ 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U,
+ 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU,
+ 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U,
+ 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU,
+ 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU,
+ 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U,
+ 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU,
+ 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U,
+ 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU,
+ 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U,
+ 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U,
+ 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U,
+ 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU,
+ 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU,
+ 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U,
+ 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,
+ 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
+};
+
+static const u32 Td0[256] = {
+ 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
+ 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
+ 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
+ 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
+ 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
+ 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
+ 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
+ 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
+ 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
+ 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
+ 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
+ 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
+ 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
+ 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
+ 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
+ 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
+ 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
+ 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
+ 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
+ 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
+ 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
+ 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
+ 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
+ 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
+ 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
+ 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
+ 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
+ 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
+ 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
+ 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
+ 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
+ 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
+ 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
+ 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
+ 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
+ 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
+ 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
+ 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
+ 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
+ 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
+ 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
+ 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
+ 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
+ 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
+ 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
+ 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
+ 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
+ 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
+ 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
+ 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
+ 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
+ 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
+ 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
+ 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
+ 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
+ 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
+ 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
+ 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
+ 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
+ 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
+ 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
+ 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
+ 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
+ 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
+};
+
+static const u32 Td1[256] = {
+ 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
+ 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
+ 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
+ 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
+ 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
+ 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
+ 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
+ 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
+ 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
+ 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
+ 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
+ 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
+ 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
+ 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
+ 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
+ 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
+ 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
+ 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
+ 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
+ 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
+ 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
+ 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
+ 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
+ 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
+ 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
+ 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
+ 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
+ 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
+ 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
+ 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
+ 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
+ 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
+ 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
+ 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
+ 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
+ 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
+ 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
+ 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
+ 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
+ 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
+ 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
+ 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
+ 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
+ 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
+ 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
+ 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
+ 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
+ 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
+ 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
+ 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
+ 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
+ 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
+ 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
+ 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
+ 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
+ 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
+ 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
+ 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
+ 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
+ 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
+ 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
+ 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
+ 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
+ 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
+};
+
+static const u32 Td2[256] = {
+ 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
+ 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
+ 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
+ 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
+ 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
+ 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
+ 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
+ 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
+ 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
+ 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
+ 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
+ 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
+ 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
+ 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
+ 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
+ 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
+ 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
+ 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
+ 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
+ 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
+ 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
+ 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
+ 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
+ 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
+ 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
+ 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
+ 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
+ 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
+ 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
+ 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
+ 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
+ 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
+ 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
+ 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
+ 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
+ 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
+ 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
+ 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
+ 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
+ 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
+ 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
+ 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
+ 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
+ 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
+ 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
+ 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
+ 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
+ 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
+ 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
+ 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
+ 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
+ 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
+ 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
+ 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
+ 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
+ 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
+ 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
+ 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
+ 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
+ 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
+ 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
+ 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
+ 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
+ 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
+};
+
+static const u32 Td3[256] = {
+ 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
+ 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
+ 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
+ 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
+ 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
+ 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
+ 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
+ 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
+ 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
+ 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
+ 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
+ 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
+ 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
+ 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
+ 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
+ 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
+ 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
+ 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
+ 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
+ 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
+ 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
+ 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
+ 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
+ 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
+ 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
+ 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
+ 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
+ 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
+ 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
+ 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
+ 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
+ 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
+ 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
+ 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
+ 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
+ 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
+ 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
+ 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
+ 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
+ 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
+ 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
+ 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
+ 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
+ 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
+ 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
+ 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
+ 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
+ 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
+ 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
+ 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
+ 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
+ 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
+ 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
+ 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
+ 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
+ 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
+ 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
+ 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
+ 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
+ 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
+ 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
+ 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
+ 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
+ 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
+};
+
+static const u32 Td4[256] = {
+ 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
+ 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,
+ 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,
+ 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU,
+ 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U,
+ 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U,
+ 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U,
+ 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU,
+ 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U,
+ 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU,
+ 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU,
+ 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU,
+ 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U,
+ 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U,
+ 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U,
+ 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U,
+ 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U,
+ 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U,
+ 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU,
+ 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U,
+ 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U,
+ 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU,
+ 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U,
+ 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U,
+ 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U,
+ 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU,
+ 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U,
+ 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U,
+ 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU,
+ 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U,
+ 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U,
+ 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU,
+ 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U,
+ 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU,
+ 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU,
+ 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U,
+ 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U,
+ 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U,
+ 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U,
+ 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU,
+ 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U,
+ 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U,
+ 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU,
+ 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU,
+ 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU,
+ 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U,
+ 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU,
+ 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U,
+ 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U,
+ 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U,
+ 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U,
+ 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU,
+ 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U,
+ 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU,
+ 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU,
+ 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU,
+ 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU,
+ 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U,
+ 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU,
+ 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U,
+ 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU,
+ 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U,
+ 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,
+ 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,
+};
+
+static const u32 rcon[] = {
+ 0x01000000, 0x02000000, 0x04000000, 0x08000000,
+ 0x10000000, 0x20000000, 0x40000000, 0x80000000,
+ 0x1B000000, 0x36000000,
+/* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
+};
+
+#define GETU32(plaintext) (((u32)(plaintext)[0] << 24) ^ \
+ ((u32)(plaintext)[1] << 16) ^ \
+ ((u32)(plaintext)[2] << 8) ^ \
+ ((u32)(plaintext)[3]))
+
+#define PUTU32(ciphertext, st) { (ciphertext)[0] = (u8)((st) >> 24); \
+ (ciphertext)[1] = (u8)((st) >> 16); \
+ (ciphertext)[2] = (u8)((st) >> 8); \
+ (ciphertext)[3] = (u8)(st); }
+
+/**
+ * Expand the cipher key into the encryption key schedule.
+ *
+ * @return the number of rounds for the given cipher key size.
+ */
+int rijndaelSetupEncrypt(u32 *rk, const u8 *key, int keybits)
+{
+ int i = 0;
+ u32 temp;
+
+ rk[0] = GETU32(key);
+ rk[1] = GETU32(key + 4);
+ rk[2] = GETU32(key + 8);
+ rk[3] = GETU32(key + 12);
+ if (keybits == 128) {
+ for (;;) {
+ temp = rk[3];
+ rk[4] = rk[0] ^
+ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te4[(temp) & 0xff] & 0x0000ff00) ^
+ (Te4[(temp >> 24)] & 0x000000ff) ^ rcon[i];
+ rk[5] = rk[1] ^ rk[4];
+ rk[6] = rk[2] ^ rk[5];
+ rk[7] = rk[3] ^ rk[6];
+ if (++i == 10)
+ return 10;
+ rk += 4;
+ }
+ }
+ rk[4] = GETU32(key + 16);
+ rk[5] = GETU32(key + 20);
+ if (keybits == 192) {
+ for (;;) {
+ temp = rk[5];
+ rk[6] = rk[0] ^
+ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te4[(temp) & 0xff] & 0x0000ff00) ^
+ (Te4[(temp >> 24)] & 0x000000ff) ^ rcon[i];
+ rk[7] = rk[1] ^ rk[6];
+ rk[8] = rk[2] ^ rk[7];
+ rk[9] = rk[3] ^ rk[8];
+ if (++i == 8)
+ return 12;
+ rk[10] = rk[4] ^ rk[9];
+ rk[11] = rk[5] ^ rk[10];
+ rk += 6;
+ }
+ }
+ rk[6] = GETU32(key + 24);
+ rk[7] = GETU32(key + 28);
+ if (keybits == 256) {
+ for (;;) {
+ temp = rk[7];
+ rk[8] = rk[0] ^
+ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te4[(temp) & 0xff] & 0x0000ff00) ^
+ (Te4[(temp >> 24)] & 0x000000ff) ^ rcon[i];
+ rk[9] = rk[1] ^ rk[8];
+ rk[10] = rk[2] ^ rk[9];
+ rk[11] = rk[3] ^ rk[10];
+ if (++i == 7)
+ return 14;
+ temp = rk[11];
+ rk[12] = rk[4] ^
+ (Te4[(temp >> 24)] & 0xff000000) ^
+ (Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(temp >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[(temp) & 0xff] & 0x000000ff);
+ rk[13] = rk[5] ^ rk[12];
+ rk[14] = rk[6] ^ rk[13];
+ rk[15] = rk[7] ^ rk[14];
+ rk += 8;
+ }
+ }
+ return 0;
+}
+
+/**
+ * Expand the cipher key into the decryption key schedule.
+ *
+ * @return the number of rounds for the given cipher key size.
+ */
+int rijndaelSetupDecrypt(u32 *rk, const u8 *key, int keybits)
+{
+ int nrounds, i, j;
+ u32 temp;
+
+/* expand the cipher key: */
+ nrounds = rijndaelSetupEncrypt(rk, key, keybits);
+/* invert the order of the round keys: */
+ for (i = 0, j = 4 * nrounds; i < j; i += 4, j -= 4) {
+ temp = rk[i];
+ rk[i] = rk[j];
+ rk[j] = temp;
+ temp = rk[i + 1];
+ rk[i + 1] = rk[j + 1];
+ rk[j + 1] = temp;
+ temp = rk[i + 2];
+ rk[i + 2] = rk[j + 2];
+ rk[j + 2] = temp;
+ temp = rk[i + 3];
+ rk[i + 3] = rk[j + 3];
+ rk[j + 3] = temp;
+ }
+/* apply the inverse MixColumn transform to all round keys
+ but the first and the last: */
+ for (i = 1; i < nrounds; i++) {
+ rk += 4;
+ rk[0] =
+ Td0[Te4[(rk[0] >> 24)] & 0xff] ^
+ Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^
+ Td2[Te4[(rk[0] >> 8) & 0xff] & 0xff] ^
+ Td3[Te4[(rk[0]) & 0xff] & 0xff];
+ rk[1] =
+ Td0[Te4[(rk[1] >> 24)] & 0xff] ^
+ Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^
+ Td2[Te4[(rk[1] >> 8) & 0xff] & 0xff] ^
+ Td3[Te4[(rk[1]) & 0xff] & 0xff];
+ rk[2] =
+ Td0[Te4[(rk[2] >> 24)] & 0xff] ^
+ Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^
+ Td2[Te4[(rk[2] >> 8) & 0xff] & 0xff] ^
+ Td3[Te4[(rk[2]) & 0xff] & 0xff];
+ rk[3] =
+ Td0[Te4[(rk[3] >> 24)] & 0xff] ^
+ Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^
+ Td2[Te4[(rk[3] >> 8) & 0xff] & 0xff] ^
+ Td3[Te4[(rk[3]) & 0xff] & 0xff];
+ }
+ return nrounds;
+}
+
+void rijndaelEncrypt(const u32 *rk, int nrounds, const u8 plaintext[16],
+ u8 ciphertext[16])
+{
+ u32 s0, s1, s2, s3, t0, t1, t2, t3;
+#ifndef FULL_UNROLL
+ int r;
+#endif /* ?FULL_UNROLL */
+/*
+ * map byte array block to cipher state
+ * and add initial round key:
+*/
+ s0 = GETU32(plaintext) ^ rk[0];
+ s1 = GETU32(plaintext + 4) ^ rk[1];
+ s2 = GETU32(plaintext + 8) ^ rk[2];
+ s3 = GETU32(plaintext + 12) ^ rk[3];
+#ifdef FULL_UNROLL
+ /* round 1: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[4];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[5];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[6];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[7];
+ /* round 2: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[8];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[9];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11];
+ /* round 3: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15];
+ /* round 4: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19];
+ /* round 5: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23];
+ /* round 6: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27];
+ /* round 7: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31];
+ /* round 8: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35];
+ /* round 9: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39];
+ if (nrounds > 10) {
+ /* round 10: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43];
+ /* round 11: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47];
+ if (nrounds > 12) {
+ /* round 12: */
+ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48];
+ s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49];
+ s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50];
+ s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51];
+ /* round 13: */
+ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52];
+ t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53];
+ t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54];
+ t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55];
+ }
+ }
+ rk += nrounds << 2;
+#else /* !FULL_UNROLL */
+ /*
+ * nrounds - 1 full rounds:
+ */
+ r = nrounds >> 1;
+ for (;;) {
+ t0 = Te0[(s0 >> 24)] ^
+ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[4];
+ t1 = Te0[(s1 >> 24)] ^
+ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[5];
+ t2 = Te0[(s2 >> 24)] ^
+ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[6];
+ t3 = Te0[(s3 >> 24)] ^
+ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[7];
+ rk += 8;
+ if (--r == 0)
+ break;
+ s0 = Te0[(t0 >> 24)] ^
+ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[0];
+ s1 = Te0[(t1 >> 24)] ^
+ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[1];
+ s2 = Te0[(t2 >> 24)] ^
+ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[2];
+ s3 = Te0[(t3 >> 24)] ^
+ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[3];
+ }
+#endif /* ?FULL_UNROLL */
+/*
+* apply last round and
+* map cipher state to byte array block:
+*/
+ s0 = (Te4[(t0 >> 24)] & 0xff000000) ^
+ (Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[t3 & 0xff] & 0x000000ff) ^ rk[0];
+ PUTU32(ciphertext, s0);
+ s1 = (Te4[(t1 >> 24)] & 0xff000000) ^
+ (Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(t3 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[t0 & 0xff] & 0x000000ff) ^ rk[1];
+ PUTU32(ciphertext + 4, s1);
+ s2 = (Te4[(t2 >> 24)] & 0xff000000) ^
+ (Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(t0 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[t1 & 0xff] & 0x000000ff) ^ rk[2];
+ PUTU32(ciphertext + 8, s2);
+ s3 = (Te4[(t3 >> 24)] & 0xff000000) ^
+ (Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(t1 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[t2 & 0xff] & 0x000000ff) ^ rk[3];
+ PUTU32(ciphertext + 12, s3);
+}
+
+void rijndaelDecrypt(const u32 *rk, int nrounds, const u8 ciphertext[16],
+ u8 plaintext[16])
+{
+ u32 s0, s1, s2, s3, t0, t1, t2, t3;
+#ifndef FULL_UNROLL
+ int r;
+#endif /* ?FULL_UNROLL */
+
+/*
+* map byte array block to cipher state
+* and add initial round key:
+*/
+ s0 = GETU32(ciphertext) ^ rk[0];
+ s1 = GETU32(ciphertext + 4) ^ rk[1];
+ s2 = GETU32(ciphertext + 8) ^ rk[2];
+ s3 = GETU32(ciphertext + 12) ^ rk[3];
+#ifdef FULL_UNROLL
+ /* round 1: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[4];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[5];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[6];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[7];
+ /* round 2: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[8];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[9];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11];
+ /* round 3: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15];
+ /* round 4: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19];
+ /* round 5: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23];
+ /* round 6: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27];
+ /* round 7: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31];
+ /* round 8: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35];
+ /* round 9: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39];
+ if (nrounds > 10) {
+ /* round 10: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43];
+ /* round 11: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47];
+ if (nrounds > 12) {
+ /* round 12: */
+ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48];
+ s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49];
+ s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50];
+ s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51];
+ /* round 13: */
+ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52];
+ t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53];
+ t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54];
+ t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55];
+ }
+ }
+ rk += nrounds << 2;
+#else /* !FULL_UNROLL */
+ /*
+ * nrounds - 1 full rounds:
+ */
+ r = nrounds >> 1;
+ for (;;) {
+ t0 = Td0[(s0 >> 24)] ^
+ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[4];
+ t1 = Td0[(s1 >> 24)] ^
+ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[5];
+ t2 = Td0[(s2 >> 24)] ^
+ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[6];
+ t3 = Td0[(s3 >> 24)] ^
+ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[7];
+ rk += 8;
+ if (--r == 0)
+ break;
+ s0 = Td0[(t0 >> 24)] ^
+ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[0];
+ s1 = Td0[(t1 >> 24)] ^
+ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[1];
+ s2 = Td0[(t2 >> 24)] ^
+ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[2];
+ s3 = Td0[(t3 >> 24)] ^
+ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[3];
+ }
+#endif /* ?FULL_UNROLL */
+/*
+* apply last round and
+* map cipher state to byte array block:
+*/
+ s0 = (Td4[(t0 >> 24)] & 0xff000000) ^
+ (Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
+ (Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
+ (Td4[(t1) & 0xff] & 0x000000ff) ^ rk[0];
+ PUTU32(plaintext, s0);
+ s1 = (Td4[(t1 >> 24)] & 0xff000000) ^
+ (Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
+ (Td4[(t3 >> 8) & 0xff] & 0x0000ff00) ^
+ (Td4[(t2) & 0xff] & 0x000000ff) ^ rk[1];
+ PUTU32(plaintext + 4, s1);
+ s2 = (Td4[(t2 >> 24)] & 0xff000000) ^
+ (Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
+ (Td4[(t0 >> 8) & 0xff] & 0x0000ff00) ^
+ (Td4[(t3) & 0xff] & 0x000000ff) ^ rk[2];
+ PUTU32(plaintext + 8, s2);
+ s3 = (Td4[(t3 >> 24)] & 0xff000000) ^
+ (Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
+ (Td4[(t1 >> 8) & 0xff] & 0x0000ff00) ^
+ (Td4[(t0) & 0xff] & 0x000000ff) ^ rk[3];
+ PUTU32(plaintext + 12, s3);
+}
diff --git a/ta/crypt/aes_taf.c b/ta/crypt/aes_taf.c
new file mode 100644
index 0000000..be3ca3b
--- /dev/null
+++ b/ta/crypt/aes_taf.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "aes_taf.h"
+#include "aes_impl.h"
+
+/* Encryption/decryption key */
+const unsigned char key[KEYLENGTH(AES_256)] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
+};
+
+/* Encryption/decryption buffer */
+unsigned long rk[RKLENGTH(AES_256)];
+
+TEE_Result ta_entry_aes256ecb_encrypt(uint32_t param_types, TEE_Param params[4])
+{
+ size_t n_input_blocks;
+ size_t i;
+
+/*
+ * It is expected that memRef[0] is input buffer and memRef[1] is
+ * output buffer.
+ */
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+
+/* Check that input buffer is whole mult. of block size, in bits */
+ if ((params[0].memref.size << 8) % AES_BLOCK_SIZE != 0)
+ return TEE_ERROR_BAD_PARAMETERS;
+
+/* Check that output buffer is whole mult. of block size, in bits */
+ if ((params[1].memref.size << 8) % AES_BLOCK_SIZE != 0)
+ return TEE_ERROR_BAD_PARAMETERS;
+
+/* Set up for encryption */
+ (void)rijndaelSetupEncrypt(rk, key, AES_256);
+
+ n_input_blocks = params[0].memref.size / (AES_BLOCK_SIZE / 8);
+
+ for (i = 0; i < n_input_blocks; i++) {
+ const unsigned char *ciphertext = params[0].memref.buffer;
+ unsigned char *plaintext = params[1].memref.buffer;
+
+ rijndaelEncrypt(rk, NROUNDS(AES_256),
+ &ciphertext[i * (AES_BLOCK_SIZE / 8)],
+ &plaintext[i * (AES_BLOCK_SIZE / 8)]);
+ }
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_aes256ecb_decrypt(uint32_t param_types, TEE_Param params[4])
+{
+ size_t n_input_blocks;
+ size_t i;
+
+/*
+ * It is expected that memRef[0] is input buffer and memRef[1] is
+ * output buffer.
+ */
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+
+/* Check that input buffer is whole mult. of block size, in bits */
+ if ((params[0].memref.size << 8) % AES_BLOCK_SIZE != 0)
+ return TEE_ERROR_BAD_PARAMETERS;
+
+/* Check that output buffer is whole mult. of block size, in bits */
+ if ((params[1].memref.size << 8) % AES_BLOCK_SIZE != 0)
+ return TEE_ERROR_BAD_PARAMETERS;
+
+/* Set up for decryption */
+ (void)rijndaelSetupDecrypt(rk, key, AES_256);
+
+ n_input_blocks = params[0].memref.size / (AES_BLOCK_SIZE / 8);
+
+ for (i = 0; i < n_input_blocks; i++) {
+ const unsigned char *ciphertext = params[0].memref.buffer;
+ unsigned char *plaintext = params[1].memref.buffer;
+
+ rijndaelDecrypt(rk, NROUNDS(AES_256),
+ &ciphertext[i * (AES_BLOCK_SIZE / 8)],
+ &plaintext[i * (AES_BLOCK_SIZE / 8)]);
+ }
+
+ return TEE_SUCCESS;
+}
diff --git a/ta/crypt/cryp_taf.c b/ta/crypt/cryp_taf.c
new file mode 100644
index 0000000..d5570f4
--- /dev/null
+++ b/ta/crypt/cryp_taf.c
@@ -0,0 +1,648 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <tee_internal_api.h>
+#include "cryp_taf.h"
+
+#define ASSERT_PARAM_TYPE(pt) \
+do { \
+ if ((pt) != param_type) \
+ return TEE_ERROR_BAD_PARAMETERS; \
+} while (0)
+
+TEE_Result ta_entry_allocate_operation(uint32_t param_type, TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_OperationHandle op;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INOUT,
+ TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ res = TEE_AllocateOperation(&op,
+ params[0].value.b, params[1].value.a,
+ params[1].value.b);
+ params[0].value.a = (uint32_t) op;
+ return res;
+}
+
+TEE_Result ta_entry_free_operation(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_FreeOperation((TEE_OperationHandle) params[0].value.a);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_get_operation_info(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+ if (params[1].memref.size < sizeof(TEE_OperationInfo))
+ return TEE_ERROR_SHORT_BUFFER;
+ params[1].memref.size = sizeof(TEE_OperationInfo);
+
+ TEE_GetOperationInfo((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_reset_operation(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_ResetOperation((TEE_OperationHandle) params[0].value.a);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_set_operation_key(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ return TEE_SetOperationKey((TEE_OperationHandle) params[0].value.a,
+ (TEE_ObjectHandle) params[0].value.b);
+}
+
+TEE_Result ta_entry_set_operation_key2(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ return TEE_SetOperationKey2((TEE_OperationHandle) params[0].value.a,
+ (TEE_ObjectHandle) params[0].value.b,
+ (TEE_ObjectHandle) params[1].value.a);
+}
+
+TEE_Result ta_entry_copy_operation(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_CopyOperation((TEE_OperationHandle) params[0].value.a,
+ (TEE_OperationHandle) params[0].value.b);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_digest_update(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ TEE_DigestUpdate((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_digest_do_final(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE));
+ return TEE_DigestDoFinal((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size,
+ params[2].memref.buffer,
+ ¶ms[2].memref.size);
+}
+
+TEE_Result ta_entry_cipher_init(uint32_t param_type, TEE_Param params[4])
+{
+ void *buffer;
+ size_t size;
+
+ if (param_type == TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ buffer = NULL;
+ size = 0;
+ } else if (param_type == TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ buffer = params[1].memref.buffer;
+ size = params[1].memref.size;
+ } else
+ return TEE_ERROR_BAD_PARAMETERS;
+ TEE_CipherInit((TEE_OperationHandle) params[0].value.a, buffer, size);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_cipher_update(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE));
+ return TEE_CipherUpdate((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size,
+ params[2].memref.buffer,
+ ¶ms[2].memref.size);
+}
+
+TEE_Result ta_entry_cipher_do_final(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE));
+ return TEE_CipherDoFinal((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size,
+ params[2].memref.buffer,
+ ¶ms[2].memref.size);
+}
+
+TEE_Result ta_entry_mac_init(uint32_t param_type, TEE_Param params[4])
+{
+ void *buffer;
+ size_t size;
+
+ if (param_type == TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ buffer = NULL;
+ size = 0;
+ } else if (param_type == TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ buffer = params[1].memref.buffer;
+ size = params[1].memref.size;
+ } else
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ TEE_MACInit((TEE_OperationHandle) params[0].value.a, buffer, size);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_mac_update(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ TEE_MACUpdate((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_mac_final_compute(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE));
+ return TEE_MACComputeFinal((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer,
+ params[1].memref.size,
+ params[2].memref.buffer,
+ ¶ms[2].memref.size);
+}
+
+TEE_Result ta_entry_mac_final_compare(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, TEE_PARAM_TYPE_NONE));
+ return TEE_MACCompareFinal((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer,
+ params[1].memref.size,
+ params[2].memref.buffer,
+ params[2].memref.size);
+}
+
+TEE_Result ta_entry_allocate_transient_object(uint32_t param_type,
+ TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_ObjectHandle o;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_VALUE_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+ res =
+ TEE_AllocateTransientObject(params[0].value.a, params[0].value.b,
+ &o);
+ if (res == TEE_SUCCESS)
+ params[1].value.a = (uint32_t) o;
+ return res;
+}
+
+TEE_Result ta_entry_free_transient_object(uint32_t param_type,
+ TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+ TEE_FreeTransientObject((TEE_ObjectHandle) params[0].value.a);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_reset_transient_object(uint32_t param_type,
+ TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+ TEE_ResetTransientObject((TEE_ObjectHandle) params[0].value.a);
+ return TEE_SUCCESS;
+}
+
+static TEE_Result unpack_attrs(const uint8_t *buf, size_t blen,
+ TEE_Attribute **attrs, uint32_t *attr_count)
+{
+ TEE_Result res = TEE_SUCCESS;
+ TEE_Attribute *a = NULL;
+ size_t num_attrs = 0;
+ const size_t num_attrs_size = sizeof(uint32_t);
+
+ if (blen == 0)
+ goto out;
+
+ if (((uint32_t) buf & 0x3) != 0 || blen < num_attrs_size)
+ return TEE_ERROR_BAD_PARAMETERS;
+ num_attrs = *(uint32_t *) (void *)buf;
+ if ((blen - num_attrs_size) < (num_attrs * sizeof(TEE_Attribute)))
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ if (num_attrs > 0) {
+ size_t n;
+
+ a = TEE_Malloc(num_attrs * sizeof(TEE_Attribute), 0);
+ if (a == NULL)
+ return TEE_ERROR_OUT_OF_MEMORY;
+ TEE_MemMove(a, buf + num_attrs_size,
+ num_attrs * sizeof(TEE_Attribute));
+
+ for (n = 0; n < num_attrs; n++) {
+ uintptr_t p;
+
+#define TEE_ATTR_BIT_VALUE (1 << 29)
+ if ((a[n].attributeID & TEE_ATTR_BIT_VALUE) != 0)
+ continue; /* Only memrefs need to be updated */
+
+ p = (uintptr_t) a[n].content.ref.buffer;
+ if (p == 0)
+ continue;
+
+ if ((p + a[n].content.ref.length) > blen) {
+ res = TEE_ERROR_BAD_PARAMETERS;
+ goto out;
+ }
+ p += (uintptr_t) buf;
+ a[n].content.ref.buffer = (void *)p;
+ }
+ }
+
+ res = TEE_SUCCESS;
+out:
+ if (res == TEE_SUCCESS) {
+ *attrs = a;
+ *attr_count = num_attrs;
+ } else {
+ TEE_Free(a);
+ }
+ return res;
+}
+
+TEE_Result ta_entry_populate_transient_object(uint32_t param_type,
+ TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_Attribute *attrs;
+ uint32_t attr_count;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ res = unpack_attrs(params[1].memref.buffer, params[1].memref.size,
+ &attrs, &attr_count);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = TEE_PopulateTransientObject((TEE_ObjectHandle) params[0].value.a,
+ attrs, attr_count);
+ TEE_Free(attrs);
+ return res;
+}
+
+TEE_Result ta_entry_copy_object_attributes(uint32_t param_type,
+ TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_CopyObjectAttributes1((TEE_ObjectHandle) params[0].value.a,
+ (TEE_ObjectHandle) params[0].value.b);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_generate_key(uint32_t param_type, TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_Attribute *attrs;
+ uint32_t attr_count;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ res = unpack_attrs(params[1].memref.buffer, params[1].memref.size,
+ &attrs, &attr_count);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = TEE_GenerateKey((TEE_ObjectHandle) params[0].value.a,
+ params[0].value.b, attrs, attr_count);
+ TEE_Free(attrs);
+ return res;
+}
+
+TEE_Result ta_entry_asymmetric_encrypt(uint32_t param_type, TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_Attribute *attrs;
+ uint32_t attr_count;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT));
+
+ res = unpack_attrs(params[1].memref.buffer, params[1].memref.size,
+ &attrs, &attr_count);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = TEE_AsymmetricEncrypt((TEE_OperationHandle) params[0].value.a,
+ attrs, attr_count, params[2].memref.buffer,
+ params[2].memref.size,
+ params[3].memref.buffer,
+ ¶ms[3].memref.size);
+ TEE_Free(attrs);
+ return res;
+}
+
+TEE_Result ta_entry_asymmetric_decrypt(uint32_t param_type, TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_Attribute *attrs;
+ uint32_t attr_count;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT));
+
+ res = unpack_attrs(params[1].memref.buffer, params[1].memref.size,
+ &attrs, &attr_count);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = TEE_AsymmetricDecrypt((TEE_OperationHandle) params[0].value.a,
+ attrs, attr_count, params[2].memref.buffer,
+ params[2].memref.size,
+ params[3].memref.buffer,
+ ¶ms[3].memref.size);
+ TEE_Free(attrs);
+ return res;
+}
+
+TEE_Result ta_entry_asymmetric_sign_digest(uint32_t param_type,
+ TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_Attribute *attrs;
+ uint32_t attr_count;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT));
+
+ res = unpack_attrs(params[1].memref.buffer, params[1].memref.size,
+ &attrs, &attr_count);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = TEE_AsymmetricSignDigest((TEE_OperationHandle) params[0].value.a,
+ attrs, attr_count,
+ params[2].memref.buffer,
+ params[2].memref.size,
+ params[3].memref.buffer,
+ ¶ms[3].memref.size);
+ TEE_Free(attrs);
+ return res;
+}
+
+TEE_Result ta_entry_asymmetric_verify_digest(uint32_t param_type,
+ TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_Attribute *attrs;
+ uint32_t attr_count;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT));
+
+ res = unpack_attrs(params[1].memref.buffer, params[1].memref.size,
+ &attrs, &attr_count);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res =
+ TEE_AsymmetricVerifyDigest((TEE_OperationHandle) params[0].value.a,
+ attrs, attr_count,
+ params[2].memref.buffer,
+ params[2].memref.size,
+ params[3].memref.buffer,
+ params[3].memref.size);
+ TEE_Free(attrs);
+ return res;
+}
+
+TEE_Result ta_entry_derive_key(uint32_t param_type, TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_Attribute *attrs;
+ uint32_t attr_count;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ res = unpack_attrs(params[1].memref.buffer, params[1].memref.size,
+ &attrs, &attr_count);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ TEE_DeriveKey((TEE_OperationHandle) params[0].value.a,
+ attrs, attr_count, (TEE_ObjectHandle) params[0].value.b);
+ TEE_Free(attrs);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_random_number_generate(uint32_t param_type,
+ TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_GenerateRandom(params[0].memref.buffer, params[0].memref.size);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_ae_init(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_VALUE_OUTPUT, TEE_PARAM_TYPE_NONE));
+ return TEE_AEInit((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size,
+ params[0].value.b * 8, /* tag_len in bits */
+ params[2].value.a, params[2].value.b);
+}
+
+TEE_Result ta_entry_ae_update_aad(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ TEE_AEUpdateAAD((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_ae_update(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE));
+
+ TEE_AEUpdate((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size,
+ params[2].memref.buffer, ¶ms[2].memref.size);
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_ae_encrypt_final(uint32_t param_type, TEE_Param params[4])
+{
+ TEE_Result res;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT));
+
+ res = TEE_AEEncryptFinal((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer, params[1].memref.size,
+ params[2].memref.buffer,
+ ¶ms[2].memref.size,
+ params[3].memref.buffer,
+ ¶ms[3].memref.size);
+ return res;
+}
+
+TEE_Result ta_entry_ae_decrypt_final(uint32_t param_type, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT));
+
+ return TEE_AEDecryptFinal((TEE_OperationHandle) params[0].value.a,
+ params[1].memref.buffer,
+ params[1].memref.size,
+ params[2].memref.buffer,
+ ¶ms[2].memref.size,
+ params[3].memref.buffer,
+ params[3].memref.size);
+}
+
+TEE_Result ta_entry_get_object_buffer_attribute(uint32_t param_type,
+ TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ return TEE_GetObjectBufferAttribute((TEE_ObjectHandle) params[0].value.
+ a, params[0].value.b,
+ params[1].memref.buffer,
+ ¶ms[1].memref.size);
+}
+
+TEE_Result ta_entry_get_object_value_attribute(uint32_t param_type,
+ TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_VALUE_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ return TEE_GetObjectValueAttribute((TEE_ObjectHandle) params[0].value.a,
+ params[0].value.b,
+ ¶ms[1].value.a,
+ ¶ms[1].value.b);
+}
diff --git a/ta/crypt/include/aes_impl.h b/ta/crypt/include/aes_impl.h
new file mode 100644
index 0000000..a1c4257
--- /dev/null
+++ b/ta/crypt/include/aes_impl.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AES_IMPL_H
+#define AES_IMPL_H
+
+int rijndaelSetupEncrypt(unsigned long *rk, const unsigned char *key,
+ int keybits);
+
+int rijndaelSetupDecrypt(unsigned long *rk, const unsigned char *key,
+ int keybits);
+
+void rijndaelEncrypt(const unsigned long *rk, int nrounds,
+ const unsigned char plaintext[16],
+ unsigned char ciphertext[16]);
+
+void rijndaelDecrypt(const unsigned long *rk, int nrounds,
+ const unsigned char ciphertext[16],
+ unsigned char plaintext[16]);
+
+#define AES_BLOCK_SIZE 128
+
+#define AES_128 128
+#define AES_192 192
+#define AES_256 256
+
+#define KEYLENGTH(keybits) ((keybits)/8)
+#define RKLENGTH(keybits) ((keybits)/8+28)
+#define NROUNDS(keybits) ((keybits)/32+6)
+
+#endif
diff --git a/ta/crypt/include/aes_taf.h b/ta/crypt/include/aes_taf.h
new file mode 100644
index 0000000..415f549
--- /dev/null
+++ b/ta/crypt/include/aes_taf.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AES_TAF_H
+#define AES_TAF_H
+
+#include <tee_api.h>
+
+/* params[0] is input buffer and params[1] is output buffer */
+TEE_Result ta_entry_aes256ecb_encrypt(uint32_t param_types,
+ TEE_Param params[4]);
+
+/* params[0] is input buffer and params[1] is output buffer */
+TEE_Result ta_entry_aes256ecb_decrypt(uint32_t param_types,
+ TEE_Param params[4]);
+
+#endif
diff --git a/ta/crypt/include/cryp_taf.h b/ta/crypt/include/cryp_taf.h
new file mode 100644
index 0000000..31fcf6c
--- /dev/null
+++ b/ta/crypt/include/cryp_taf.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CRYP_TAF_H
+#define CRYP_TAF_H
+
+#include <tee_api.h>
+
+TEE_Result ta_entry_allocate_operation(uint32_t param_type, TEE_Param params[4]
+);
+
+TEE_Result ta_entry_free_operation(uint32_t param_type, TEE_Param params[4]
+);
+
+TEE_Result ta_entry_get_operation_info(uint32_t param_type, TEE_Param params[4]
+);
+
+TEE_Result ta_entry_reset_operation(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_set_operation_key(uint32_t param_type, TEE_Param params[4]
+);
+
+TEE_Result ta_entry_set_operation_key2(uint32_t param_type, TEE_Param params[4]
+);
+
+TEE_Result ta_entry_copy_operation(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_digest_update(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_digest_do_final(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_cipher_init(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_cipher_update(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_cipher_do_final(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_mac_init(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_mac_update(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_mac_final_compute(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_mac_final_compare(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_allocate_transient_object(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_free_transient_object(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_reset_transient_object(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_populate_transient_object(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_copy_object_attributes(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_generate_key(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_asymmetric_encrypt(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_asymmetric_decrypt(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_asymmetric_sign_digest(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_asymmetric_verify_digest(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_derive_key(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_random_number_generate(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_ae_init(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_ae_update_aad(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_ae_update(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_ae_encrypt_final(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_ae_decrypt_final(uint32_t param_type, TEE_Param params[4]);
+
+TEE_Result ta_entry_get_object_buffer_attribute(uint32_t param_type,
+ TEE_Param params[4]);
+
+TEE_Result ta_entry_get_object_value_attribute(uint32_t param_type,
+ TEE_Param params[4]);
+
+#endif /*CRYP_TAF_H */
diff --git a/ta/crypt/include/sha2_impl.h b/ta/crypt/include/sha2_impl.h
new file mode 100644
index 0000000..5938705
--- /dev/null
+++ b/ta/crypt/include/sha2_impl.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * FIPS 180-2 SHA-224/256/384/512 implementation
+ * Last update: 02/02/2007
+ * Issue date: 04/30/2005
+ *
+ * Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include "stdint.h"
+
+#ifndef SHA2_IMPL_H
+#define SHA2_IMPL_H
+
+#define SHA224_DIGEST_SIZE (224 / 8)
+#define SHA256_DIGEST_SIZE (256 / 8)
+
+#define SHA256_BLOCK_SIZE (512 / 8)
+#define SHA224_BLOCK_SIZE SHA256_BLOCK_SIZE
+
+struct sha224_ctx {
+ unsigned int tot_len;
+ unsigned int len;
+ unsigned char block[2 * SHA224_BLOCK_SIZE];
+ uint32_t h[8];
+};
+
+struct sha256_ctx {
+ unsigned int tot_len;
+ unsigned int len;
+ unsigned char block[2 * SHA256_BLOCK_SIZE];
+ uint32_t h[8];
+};
+
+void sha224_init(struct sha224_ctx *ctx);
+void sha224_update(struct sha224_ctx *ctx, const unsigned char *message,
+ unsigned int len);
+void sha224_final(struct sha224_ctx *ctx, unsigned char *digest);
+void sha224(const unsigned char *message, unsigned int len,
+ unsigned char *digest);
+
+void sha256_init(struct sha256_ctx *ctx);
+void sha256_update(struct sha256_ctx *ctx, const unsigned char *message,
+ unsigned int len);
+void sha256_final(struct sha256_ctx *ctx, unsigned char *digest);
+void sha256(const unsigned char *message, unsigned int len,
+ unsigned char *digest);
+
+void sha256_transf(struct sha256_ctx *ctx, const unsigned char *message,
+ unsigned int block_nb);
+#endif
diff --git a/ta/crypt/include/sha2_taf.h b/ta/crypt/include/sha2_taf.h
new file mode 100644
index 0000000..1d4b2d9
--- /dev/null
+++ b/ta/crypt/include/sha2_taf.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SHA2_TAF_H
+#define SHA2_TAF_H
+
+#include <tee_api.h>
+
+/* params[0] is input buffer and params[1] is output buffer */
+TEE_Result ta_entry_sha224(uint32_t param_types, TEE_Param params[4]);
+
+/* params[0] is input buffer and params[1] is output buffer */
+TEE_Result ta_entry_sha256(uint32_t param_types, TEE_Param params[4]);
+
+#endif
diff --git a/ta/crypt/include/ta_crypt.h b/ta/crypt/include/ta_crypt.h
new file mode 100644
index 0000000..18b9716
--- /dev/null
+++ b/ta/crypt/include/ta_crypt.h
@@ -0,0 +1,365 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TA_CRYPT_H
+#define TA_CRYPT_H
+
+/* This UUID is generated with the ITU-T UUID generator at
+ http://www.itu.int/ITU-T/asn1/uuid.html */
+#define TA_CRYPT_UUID { 0xcb3e5ba0, 0xadf1, 0x11e0, \
+ { 0x99, 0x8b, 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }
+
+#define TA_CRYPT_CMD_SHA224 1
+#define TA_CRYPT_CMD_SHA256 2
+#define TA_CRYPT_CMD_AES256ECB_ENC 3
+#define TA_CRYPT_CMD_AES256ECB_DEC 4
+
+/*
+ * TEE_Result TEE_AllocateOperation(TEE_OperationHandle *operation,
+ * uint32_t algorithm, uint32_t mode, uint32_t maxKeySize);
+ * in/out params[0].value.a = operation
+ * in/out params[0].value.b = algorithm
+ * in params[1].value.a = mode
+ * in params[2].value.b = maxKeySize
+ */
+#define TA_CRYPT_CMD_ALLOCATE_OPERATION 5
+
+/*
+ * void TEE_FreeOperation(TEE_OperationHandle operation);
+ * in params[0].value.a = operation
+ */
+#define TA_CRYPT_CMD_FREE_OPERATION 6
+
+/*
+ * void TEE_GetOperationInfo(TEE_OperationHandle operation,
+ * TEE_OperationInfo* operationInfo);
+ * in params[0].value.a = operation
+ * out params[1].memref = operationInfo
+ */
+#define TA_CRYPT_CMD_GET_OPERATION_INFO 7
+
+/*
+ * void TEE_ResetOperation(TEE_OperationHandle operation);
+ * in params[0].value.a = operation
+ */
+#define TA_CRYPT_CMD_RESET_OPERATION 8
+
+/*
+ * TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation,
+ * TEE_ObjectHandle key);
+ * in params[0].value.a = operation
+ * in params[0].value.b = key
+ */
+#define TA_CRYPT_CMD_SET_OPERATION_KEY 9
+
+/*
+ * TEE_Result TEE_SetOperationKey2(TEE_OperationHandle operation,
+ * TEE_ObjectHandle key1, TEE_ObjectHandle key2);
+ * in params[0].value.a = operation
+ * in params[0].value.b = key1
+ * in params[0].value.a = key2
+ */
+#define TA_CRYPT_CMD_SET_OPERATION_KEY2 10
+
+/*
+ * void TEE_CopyOperation(TEE_OperationHandle dstOperation,
+ * TEE_OperationHandle srcOperation);
+ * in params[0].value.a = dstOperation
+ * in params[0].value.b = srcOperation
+ */
+#define TA_CRYPT_CMD_COPY_OPERATION 11
+
+/*
+ * void TEE_DigestUpdate(TEE_OperationHandle operation,
+ * void *chunk, size_t chunkSize);
+ * in params[0].value.a = operation
+ * in params[1].memref = chunk
+ */
+#define TA_CRYPT_CMD_DIGEST_UPDATE 12
+
+/*
+ * TEE_Result TEE_DigestDoFinal(TEE_OperationHandle operation,
+ * const void *chunk, size_t chunkLen,
+ * void *hash, size_t *hashLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = chunk
+ * out params[2].memref = hash
+ */
+#define TA_CRYPT_CMD_DIGEST_DO_FINAL 13
+
+/*
+ * void TEE_CipherInit(TEE_OperationHandle operation, const void *IV,
+ * size_t IVLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = IV
+ */
+#define TA_CRYPT_CMD_CIPHER_INIT 14
+
+/*
+ * TEE_Result TEE_CipherUpdate(TEE_OperationHandle operation,
+ * const void *srcData, size_t srcLen,
+ * void *destData, size_t *destLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = srcData
+ * out params[2].memref = dstData
+ */
+#define TA_CRYPT_CMD_CIPHER_UPDATE 15
+
+/*
+ * TEE_Result TEE_CipherDoFinal(TEE_OperationHandle operation,
+ * const void *srcData, size_t srcLen,
+ * void *destData, size_t *destLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = srcData
+ * out params[2].memref = destData
+ */
+#define TA_CRYPT_CMD_CIPHER_DO_FINAL 16
+
+/*
+ * void TEE_MACInit(TEE_OperationHandle operation,
+ * const void *IV, size_t IVLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = IV
+ */
+#define TA_CRYPT_CMD_MAC_INIT 17
+
+/*
+ * void TEE_MACUpdate(TEE_OperationHandle operation,
+ * const void *chunk, size_t chunkSize);
+ * in params[0].value.a = operation
+ * in params[1].memref = chunk
+ */
+#define TA_CRYPT_CMD_MAC_UPDATE 18
+
+/*
+ * TEE_Result TEE_MACFinalCompute(TEE_OperationHandle operation,
+ * const void *message, size_t messageLen,
+ * void *mac, size_t *macLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = message
+ * out params[2].memref = mac
+ */
+#define TA_CRYPT_CMD_MAC_FINAL_COMPUTE 19
+
+/*
+ * TEE_Result TEE_MACFinalCompare(TEE_OperationHandle operation,
+ * const void *message, size_t messageLen,
+ * const void *mac, size_t *macLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = message
+ * in params[2].memref = mac
+ */
+#define TA_CRYPT_CMD_MAC_FINAL_COMPARE 20
+
+/*
+ * TEE_Result TEE_AllocateTransientObject(TEE_ObjectType objectType,
+ * uint32_t maxObjectSize, TEE_ObjectHandle* object);
+ * in params[0].value.a = objectType
+ * in params[0].value.b = maxObjectSize
+ * out params[1].value.a = object;
+ */
+#define TA_CRYPT_CMD_ALLOCATE_TRANSIENT_OBJECT 21
+
+/*
+ * void TEE_FreeTransientObject(TEE_ObjectHandle object);
+ * in params[0].value.a = object
+ */
+#define TA_CRYPT_CMD_FREE_TRANSIENT_OBJECT 22
+
+/*
+ * void TEE_ResetTransientObject(TEE_ObjectHandle object);
+ * in params[0].value.a = object
+ */
+#define TA_CRYPT_CMD_RESET_TRANSIENT_OBJECT 23
+
+/*
+ * TEE_Result TEE_PopulateTransientObject(TEE_ObjectHandle object,
+ * TEE_Attribute *attrs, uint32_t attrCount);
+ * in params[0].value.a = object
+ * in params[1].memref = attrs
+ */
+#define TA_CRYPT_CMD_POPULATE_TRANSIENT_OBJECT 24
+
+/*
+ * void TEE_CopyObjectAttributes(TEE_ObjectHandle destObject,
+ * TEE_ObjectHandle srcObject);
+ * in params[0].value.a = destObject
+ * in params[0].value.b = srcObject
+ */
+#define TA_CRYPT_CMD_COPY_OBJECT_ATTRIBUTES 25
+
+/*
+ * TEE_Result TEE_GenerateKey(TEE_ObjectHandle object, uint32_t keySize,
+ * TEE_Attribute *params, uint32_t paramCount);
+ * in params[0].value.a = object
+ * in params[0].value.b = keySize
+ * in params[1].memref = params
+ */
+#define TA_CRYPT_CMD_GENERATE_KEY 26
+
+/*
+ * TEE_Result TEE_AsymmetricEncrypt(TEE_OperationHandle operation,
+ * const TEE_Attribute *params, uint32_t paramCount,
+ * const void *srcData, size_t srcLen, void *destData,
+ * size_t *destLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = params
+ * in params[2].memref = srcData
+ * out params[3].memref = destData
+ */
+#define TA_CRYPT_CMD_ASYMMETRIC_ENCRYPT 27
+
+/*
+ * TEE_Result TEE_AsymmetricDecrypt(TEE_OperationHandle operation,
+ * const TEE_Attribute *params, uint32_t paramCount,
+ * const void *srcData, size_t srcLen, void *destData,
+ * size_t *destLen)
+ * in params[0].value.a = operation
+ * in params[1].memref = params
+ * in params[2].memref = srcData
+ * out params[3].memref = destData
+ */
+#define TA_CRYPT_CMD_ASYMMETRIC_DECRYPT 28
+
+/*
+ * TEE_Result TEE_AsymmetricSignDigest(TEE_OperationHandle operation,
+ * const TEE_Attribute *params, uint32_t paramCount,
+ * const void *digest, size_t digestLen, void *signature,
+ * size_t *signatureLen)
+ * in params[0].value.a = operation
+ * in params[1].memref = params
+ * in params[2].memref = digest
+ * out params[3].memref = signature
+ */
+#define TA_CRYPT_CMD_ASYMMETRIC_SIGN_DIGEST 29
+
+/*
+ * TEE_Result TEE_AsymmetricVerifyDigest(TEE_OperationHandle operation,
+ * const TEE_Attribute *params, uint32_t paramCount,
+ * const void *digest, size_t digestLen, const void *signature,
+ * size_t signatureLen)
+ * in params[0].value.a = operation
+ * in params[1].memref = params
+ * in params[2].memref = digest
+ * in params[3].memref = signature
+ */
+#define TA_CRYPT_CMD_ASYMMETRIC_VERIFY_DIGEST 30
+
+/*
+ * void TEE_DeriveKey(TEE_OperationHandle operation,
+ * const TEE_Attribute *params, uint32_t paramCount,
+ * TEE_ObjectHandle derivedKey)
+ * in params[0].value.a = operation
+ * in params[1].memref = params
+ * in params[0].value.b = derivedKey
+ */
+#define TA_CRYPT_CMD_DERIVE_KEY 31
+
+/*
+ * void TEE_RandomNumberGenerate(void *randomBuffer, size_t randomBufferLen);
+ * out params[0].memref = randomBuffer
+ */
+#define TA_CRYPT_CMD_RANDOM_NUMBER_GENEREATE 32
+
+/*
+ * TEE_Result TEE_AEInit(TEE_OperationHandle operation,
+ * const void* nonce, size_t nonceLen,
+ * uint32_t tagLen, uint32_t AADLen, uint32_t payloadLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = nonce
+ * in params[0].value.b = tagLen
+ * in params[2].value.a = AADLen
+ * in params[2].value.b = payloadLen
+ */
+#define TA_CRYPT_CMD_AE_INIT 33
+
+/*
+ * void TEE_AEUpdateAAD(TEE_OperationHandle operation,
+ * void* AADdata, size_t AADdataLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = AADdata
+ */
+#define TA_CRYPT_CMD_AE_UPDATE_AAD 34
+
+/*
+ * TEE_Result TEE_AEUpdate(TEE_OperationHandle operation,
+ * const void* srcData, size_t srcLen,
+ * void* destData, size_t *destLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = srcData
+ * out params[2].memref = destData
+ */
+#define TA_CRYPT_CMD_AE_UPDATE 35
+
+/*
+ * TEE_Result TEE_AEEncryptFinal(TEE_OperationHandle operation,
+ * const void* srcData, size_t srcLen,
+ * void* destData, size_t* destLen,
+ * void* tag, size_t* tagLen);
+ * in params[0].value[0].a = operation
+ * in params[1].memref = srcData
+ * out params[2].memref = destData
+ * out params[3].memref = tag
+ */
+#define TA_CRYPT_CMD_AE_ENCRYPT_FINAL 36
+
+/*
+ * TEE_Result TEE_AEDecryptFinal(TEE_OperationHandle operation,
+ * const void* srcData, size_t srcLen,
+ * void* destData, size_t *destLen,
+ * const void* tag, size_t tagLen);
+ * in params[0].value.a = operation
+ * in params[1].memref = srcData
+ * out params[2].memref = destData
+ * in params[3].memref = tag
+ */
+#define TA_CRYPT_CMD_AE_DECRYPT_FINAL 37
+
+/*
+ * TEE_Result TEE_GetObjectBufferAttribute(TEE_ObjectHandle object,
+ * uint32_t attributeID, void* buffer, size_t* size);
+ * in params[0].value.a = object
+ * in params[0].value.b = attributeID
+ * out params[1].memrefs = buffer
+ */
+#define TA_CRYPT_CMD_GET_OBJECT_BUFFER_ATTRIBUTE 38
+
+/*
+ * TEE_Result TEE_GetObjectValueAttribute(TEE_ObjectHandle object,
+ * uint32_t attributeID, void* buffer, size_t* size);
+ * in params[0].value.a = object
+ * in params[0].value.b = attributeID
+ * out params[1].value.a = value a
+ * out params[1].value.b = value b
+ */
+#define TA_CRYPT_CMD_GET_OBJECT_VALUE_ATTRIBUTE 39
+
+/* To set or get a global value */
+#define TA_CRYPT_CMD_SETGLOBAL 40
+#define TA_CRYPT_CMD_GETGLOBAL 41
+
+#endif /*TA_CRYPT_H */
diff --git a/ta/crypt/include/user_ta_header_defines.h b/ta/crypt/include/user_ta_header_defines.h
new file mode 100644
index 0000000..75819e6
--- /dev/null
+++ b/ta/crypt/include/user_ta_header_defines.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include <ta_crypt.h>
+
+#define TA_UUID TA_CRYPT_UUID
+
+/* It is important to leave it as TA_FLAG_SINGLE_INSTANCE
+ and TA_FLAG_MULTI_SESSION */
+/* It is not possible to open it twice in a raw */
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE | \
+ TA_FLAG_MULTI_SESSION \
+ )
+#define TA_STACK_SIZE (2 * 1024)
+#define TA_DATA_SIZE (32 * 1024)
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/ta/crypt/sha2_impl.c b/ta/crypt/sha2_impl.c
new file mode 100644
index 0000000..27c56b0
--- /dev/null
+++ b/ta/crypt/sha2_impl.c
@@ -0,0 +1,545 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * FIPS 180-2 SHA-224/256/384/512 implementation
+ * Last update: 02/02/2007
+ * Issue date: 04/30/2005
+ *
+ * Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include "stdint.h"
+#include "sha2_impl.h"
+
+#define SHFR(x, n) (x >> n)
+#define ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
+#define ROTL(x, n) ((x << n) | (x >> ((sizeof(x) << 3) - n)))
+#define CH(x, y, z) ((x & y) ^ (~x & z))
+#define MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
+
+#define SHA256_F1(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
+#define SHA256_F2(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
+#define SHA256_F3(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHFR(x, 3))
+#define SHA256_F4(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHFR(x, 10))
+
+#define UNPACK32(x, str) \
+ { \
+ *((str) + 3) = (uint8_t) ((x)); \
+ *((str) + 2) = (uint8_t) ((x) >> 8); \
+ *((str) + 1) = (uint8_t) ((x) >> 16); \
+ *((str) + 0) = (uint8_t) ((x) >> 24); \
+ }
+
+#define PACK32(str, x) \
+ { \
+ *(x) = ((uint32_t) *((str) + 3)) \
+ | ((uint32_t) *((str) + 2) << 8) \
+ | ((uint32_t) *((str) + 1) << 16) \
+ | ((uint32_t) *((str) + 0) << 24); \
+ }
+
+/* Macros used for loops unrolling */
+#define SHA256_SCR(i) \
+{ \
+ w[i] = SHA256_F4(w[i - 2]) + w[i - 7] \
+ + SHA256_F3(w[i - 15]) + w[i - 16]; \
+}
+
+#define SHA256_EXP(a, b, c, d, e, f, g, h, j) \
+{ \
+ t1 = wv[h] + SHA256_F2(wv[e]) + CH(wv[e], wv[f], wv[g]) \
+ + sha256_k[j] + w[j]; \
+ t2 = SHA256_F1(wv[a]) + MAJ(wv[a], wv[b], wv[c]); \
+ wv[d] += t1; \
+ wv[h] = t1 + t2; \
+}
+
+uint32_t sha224_h0[8] = {
+ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
+ 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
+};
+
+uint32_t sha256_h0[8] = {
+ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
+ 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
+};
+
+uint32_t sha256_k[64] = {
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
+ 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
+ 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
+ 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
+ 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
+ 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
+ 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
+ 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
+ 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
+ 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
+ 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
+ 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
+ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
+ 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
+};
+
+/* SHA-256 functions */
+void sha256_transf(struct sha256_ctx *ctx, const unsigned char *message,
+ unsigned int block_nb)
+{
+ uint32_t w[64];
+ uint32_t wv[8];
+ uint32_t t1, t2;
+ const unsigned char *sub_block;
+ int i;
+
+#ifndef UNROLL_LOOPS
+ int j;
+#endif
+
+ for (i = 0; i < (int)block_nb; i++) {
+ sub_block = message + (i << 6);
+
+#ifndef UNROLL_LOOPS
+ for (j = 0; j < 16; j++)
+ PACK32(&sub_block[j << 2], &w[j]);
+
+ for (j = 16; j < 64; j++)
+ SHA256_SCR(j);
+
+ for (j = 0; j < 8; j++)
+ wv[j] = ctx->h[j];
+
+ for (j = 0; j < 64; j++) {
+ t1 = wv[7] + SHA256_F2(wv[4]) + CH(wv[4], wv[5], wv[6])
+ + sha256_k[j] + w[j];
+ t2 = SHA256_F1(wv[0]) + MAJ(wv[0], wv[1], wv[2]);
+ wv[7] = wv[6];
+ wv[6] = wv[5];
+ wv[5] = wv[4];
+ wv[4] = wv[3] + t1;
+ wv[3] = wv[2];
+ wv[2] = wv[1];
+ wv[1] = wv[0];
+ wv[0] = t1 + t2;
+ }
+
+ for (j = 0; j < 8; j++)
+ ctx->h[j] += wv[j];
+#else
+ PACK32(&sub_block[0], &w[0]);
+ PACK32(&sub_block[4], &w[1]);
+ PACK32(&sub_block[8], &w[2]);
+ PACK32(&sub_block[12], &w[3]);
+ PACK32(&sub_block[16], &w[4]);
+ PACK32(&sub_block[20], &w[5]);
+ PACK32(&sub_block[24], &w[6]);
+ PACK32(&sub_block[28], &w[7]);
+ PACK32(&sub_block[32], &w[8]);
+ PACK32(&sub_block[36], &w[9]);
+ PACK32(&sub_block[40], &w[10]);
+ PACK32(&sub_block[44], &w[11]);
+ PACK32(&sub_block[48], &w[12]);
+ PACK32(&sub_block[52], &w[13]);
+ PACK32(&sub_block[56], &w[14]);
+ PACK32(&sub_block[60], &w[15]);
+
+ SHA256_SCR(16);
+ SHA256_SCR(17);
+ SHA256_SCR(18);
+ SHA256_SCR(19);
+ SHA256_SCR(20);
+ SHA256_SCR(21);
+ SHA256_SCR(22);
+ SHA256_SCR(23);
+ SHA256_SCR(24);
+ SHA256_SCR(25);
+ SHA256_SCR(26);
+ SHA256_SCR(27);
+ SHA256_SCR(28);
+ SHA256_SCR(29);
+ SHA256_SCR(30);
+ SHA256_SCR(31);
+ SHA256_SCR(32);
+ SHA256_SCR(33);
+ SHA256_SCR(34);
+ SHA256_SCR(35);
+ SHA256_SCR(36);
+ SHA256_SCR(37);
+ SHA256_SCR(38);
+ SHA256_SCR(39);
+ SHA256_SCR(40);
+ SHA256_SCR(41);
+ SHA256_SCR(42);
+ SHA256_SCR(43);
+ SHA256_SCR(44);
+ SHA256_SCR(45);
+ SHA256_SCR(46);
+ SHA256_SCR(47);
+ SHA256_SCR(48);
+ SHA256_SCR(49);
+ SHA256_SCR(50);
+ SHA256_SCR(51);
+ SHA256_SCR(52);
+ SHA256_SCR(53);
+ SHA256_SCR(54);
+ SHA256_SCR(55);
+ SHA256_SCR(56);
+ SHA256_SCR(57);
+ SHA256_SCR(58);
+ SHA256_SCR(59);
+ SHA256_SCR(60);
+ SHA256_SCR(61);
+ SHA256_SCR(62);
+ SHA256_SCR(63);
+
+ wv[0] = ctx->h[0];
+ wv[1] = ctx->h[1];
+ wv[2] = ctx->h[2];
+ wv[3] = ctx->h[3];
+ wv[4] = ctx->h[4];
+ wv[5] = ctx->h[5];
+ wv[6] = ctx->h[6];
+ wv[7] = ctx->h[7];
+
+ SHA256_EXP(0, 1, 2, 3, 4, 5, 6, 7, 0);
+ SHA256_EXP(7, 0, 1, 2, 3, 4, 5, 6, 1);
+ SHA256_EXP(6, 7, 0, 1, 2, 3, 4, 5, 2);
+ SHA256_EXP(5, 6, 7, 0, 1, 2, 3, 4, 3);
+ SHA256_EXP(4, 5, 6, 7, 0, 1, 2, 3, 4);
+ SHA256_EXP(3, 4, 5, 6, 7, 0, 1, 2, 5);
+ SHA256_EXP(2, 3, 4, 5, 6, 7, 0, 1, 6);
+ SHA256_EXP(1, 2, 3, 4, 5, 6, 7, 0, 7);
+ SHA256_EXP(0, 1, 2, 3, 4, 5, 6, 7, 8);
+ SHA256_EXP(7, 0, 1, 2, 3, 4, 5, 6, 9);
+ SHA256_EXP(6, 7, 0, 1, 2, 3, 4, 5, 10);
+ SHA256_EXP(5, 6, 7, 0, 1, 2, 3, 4, 11);
+ SHA256_EXP(4, 5, 6, 7, 0, 1, 2, 3, 12);
+ SHA256_EXP(3, 4, 5, 6, 7, 0, 1, 2, 13);
+ SHA256_EXP(2, 3, 4, 5, 6, 7, 0, 1, 14);
+ SHA256_EXP(1, 2, 3, 4, 5, 6, 7, 0, 15);
+ SHA256_EXP(0, 1, 2, 3, 4, 5, 6, 7, 16);
+ SHA256_EXP(7, 0, 1, 2, 3, 4, 5, 6, 17);
+ SHA256_EXP(6, 7, 0, 1, 2, 3, 4, 5, 18);
+ SHA256_EXP(5, 6, 7, 0, 1, 2, 3, 4, 19);
+ SHA256_EXP(4, 5, 6, 7, 0, 1, 2, 3, 20);
+ SHA256_EXP(3, 4, 5, 6, 7, 0, 1, 2, 21);
+ SHA256_EXP(2, 3, 4, 5, 6, 7, 0, 1, 22);
+ SHA256_EXP(1, 2, 3, 4, 5, 6, 7, 0, 23);
+ SHA256_EXP(0, 1, 2, 3, 4, 5, 6, 7, 24);
+ SHA256_EXP(7, 0, 1, 2, 3, 4, 5, 6, 25);
+ SHA256_EXP(6, 7, 0, 1, 2, 3, 4, 5, 26);
+ SHA256_EXP(5, 6, 7, 0, 1, 2, 3, 4, 27);
+ SHA256_EXP(4, 5, 6, 7, 0, 1, 2, 3, 28);
+ SHA256_EXP(3, 4, 5, 6, 7, 0, 1, 2, 29);
+ SHA256_EXP(2, 3, 4, 5, 6, 7, 0, 1, 30);
+ SHA256_EXP(1, 2, 3, 4, 5, 6, 7, 0, 31);
+ SHA256_EXP(0, 1, 2, 3, 4, 5, 6, 7, 32);
+ SHA256_EXP(7, 0, 1, 2, 3, 4, 5, 6, 33);
+ SHA256_EXP(6, 7, 0, 1, 2, 3, 4, 5, 34);
+ SHA256_EXP(5, 6, 7, 0, 1, 2, 3, 4, 35);
+ SHA256_EXP(4, 5, 6, 7, 0, 1, 2, 3, 36);
+ SHA256_EXP(3, 4, 5, 6, 7, 0, 1, 2, 37);
+ SHA256_EXP(2, 3, 4, 5, 6, 7, 0, 1, 38);
+ SHA256_EXP(1, 2, 3, 4, 5, 6, 7, 0, 39);
+ SHA256_EXP(0, 1, 2, 3, 4, 5, 6, 7, 40);
+ SHA256_EXP(7, 0, 1, 2, 3, 4, 5, 6, 41);
+ SHA256_EXP(6, 7, 0, 1, 2, 3, 4, 5, 42);
+ SHA256_EXP(5, 6, 7, 0, 1, 2, 3, 4, 43);
+ SHA256_EXP(4, 5, 6, 7, 0, 1, 2, 3, 44);
+ SHA256_EXP(3, 4, 5, 6, 7, 0, 1, 2, 45);
+ SHA256_EXP(2, 3, 4, 5, 6, 7, 0, 1, 46);
+ SHA256_EXP(1, 2, 3, 4, 5, 6, 7, 0, 47);
+ SHA256_EXP(0, 1, 2, 3, 4, 5, 6, 7, 48);
+ SHA256_EXP(7, 0, 1, 2, 3, 4, 5, 6, 49);
+ SHA256_EXP(6, 7, 0, 1, 2, 3, 4, 5, 50);
+ SHA256_EXP(5, 6, 7, 0, 1, 2, 3, 4, 51);
+ SHA256_EXP(4, 5, 6, 7, 0, 1, 2, 3, 52);
+ SHA256_EXP(3, 4, 5, 6, 7, 0, 1, 2, 53);
+ SHA256_EXP(2, 3, 4, 5, 6, 7, 0, 1, 54);
+ SHA256_EXP(1, 2, 3, 4, 5, 6, 7, 0, 55);
+ SHA256_EXP(0, 1, 2, 3, 4, 5, 6, 7, 56);
+ SHA256_EXP(7, 0, 1, 2, 3, 4, 5, 6, 57);
+ SHA256_EXP(6, 7, 0, 1, 2, 3, 4, 5, 58);
+ SHA256_EXP(5, 6, 7, 0, 1, 2, 3, 4, 59);
+ SHA256_EXP(4, 5, 6, 7, 0, 1, 2, 3, 60);
+ SHA256_EXP(3, 4, 5, 6, 7, 0, 1, 2, 61);
+ SHA256_EXP(2, 3, 4, 5, 6, 7, 0, 1, 62);
+ SHA256_EXP(1, 2, 3, 4, 5, 6, 7, 0, 63);
+
+ ctx->h[0] += wv[0];
+ ctx->h[1] += wv[1];
+ ctx->h[2] += wv[2];
+ ctx->h[3] += wv[3];
+ ctx->h[4] += wv[4];
+ ctx->h[5] += wv[5];
+ ctx->h[6] += wv[6];
+ ctx->h[7] += wv[7];
+#endif
+ }
+}
+
+void sha256(const unsigned char *message,
+ unsigned int len, unsigned char *digest)
+{
+ struct sha256_ctx ctx;
+
+ sha256_init(&ctx);
+ sha256_update(&ctx, message, len);
+ sha256_final(&ctx, digest);
+}
+
+void sha256_init(struct sha256_ctx *ctx)
+{
+#ifndef UNROLL_LOOPS
+ int i;
+
+ for (i = 0; i < 8; i++)
+ ctx->h[i] = sha256_h0[i];
+#else
+ ctx->h[0] = sha256_h0[0];
+ ctx->h[1] = sha256_h0[1];
+ ctx->h[2] = sha256_h0[2];
+ ctx->h[3] = sha256_h0[3];
+ ctx->h[4] = sha256_h0[4];
+ ctx->h[5] = sha256_h0[5];
+ ctx->h[6] = sha256_h0[6];
+ ctx->h[7] = sha256_h0[7];
+#endif
+
+ ctx->len = 0;
+ ctx->tot_len = 0;
+}
+
+void sha256_update(struct sha256_ctx *ctx, const unsigned char *message,
+ unsigned int len)
+{
+ unsigned int block_nb;
+ unsigned int new_len, rem_len, tmp_len;
+ const unsigned char *shifted_message;
+ unsigned long int i;
+
+ tmp_len = SHA256_BLOCK_SIZE - ctx->len;
+ rem_len = len < tmp_len ? len : tmp_len;
+
+ for (i = 0; i < rem_len; i++)
+ ctx->block[ctx->len + i] = message[i];
+
+ if (ctx->len + len < SHA256_BLOCK_SIZE) {
+ ctx->len += len;
+ return;
+ }
+
+ new_len = len - rem_len;
+ block_nb = new_len / SHA256_BLOCK_SIZE;
+
+ shifted_message = message + rem_len;
+
+ sha256_transf(ctx, ctx->block, 1);
+ sha256_transf(ctx, shifted_message, block_nb);
+
+ rem_len = new_len % SHA256_BLOCK_SIZE;
+
+ for (i = 0; i < rem_len; i++)
+ ctx->block[i] = shifted_message[(block_nb << 6) + i];
+
+ ctx->len = rem_len;
+ ctx->tot_len += (block_nb + 1) << 6;
+}
+
+void sha256_final(struct sha256_ctx *ctx, unsigned char *digest)
+{
+ unsigned int block_nb;
+ unsigned int pm_len;
+ unsigned int len_b;
+ unsigned long int i_m;
+
+#ifndef UNROLL_LOOPS
+ int i;
+#endif
+
+ block_nb = (1 + ((SHA256_BLOCK_SIZE - 9)
+ < (ctx->len % SHA256_BLOCK_SIZE)));
+
+ len_b = (ctx->tot_len + ctx->len) << 3;
+ pm_len = block_nb << 6;
+
+ for (i_m = 0; i_m < pm_len - ctx->len; i_m++)
+ ctx->block[ctx->len + i_m] = 0;
+
+ ctx->block[ctx->len] = 0x80;
+ UNPACK32(len_b, ctx->block + pm_len - 4);
+
+ sha256_transf(ctx, ctx->block, block_nb);
+
+#ifndef UNROLL_LOOPS
+ for (i = 0; i < 8; i++)
+ UNPACK32(ctx->h[i], &digest[i << 2]);
+#else
+ UNPACK32(ctx->h[0], &digest[0]);
+ UNPACK32(ctx->h[1], &digest[4]);
+ UNPACK32(ctx->h[2], &digest[8]);
+ UNPACK32(ctx->h[3], &digest[12]);
+ UNPACK32(ctx->h[4], &digest[16]);
+ UNPACK32(ctx->h[5], &digest[20]);
+ UNPACK32(ctx->h[6], &digest[24]);
+ UNPACK32(ctx->h[7], &digest[28]);
+#endif
+}
+
+/* SHA-224 functions */
+void sha224(const unsigned char *message, unsigned int len,
+ unsigned char *digest)
+{
+ struct sha224_ctx ctx;
+
+ sha224_init(&ctx);
+ sha224_update(&ctx, message, len);
+ sha224_final(&ctx, digest);
+}
+
+void sha224_init(struct sha224_ctx *ctx)
+{
+#ifndef UNROLL_LOOPS
+ int i;
+
+ for (i = 0; i < 8; i++)
+ ctx->h[i] = sha224_h0[i];
+#else
+ ctx->h[0] = sha224_h0[0];
+ ctx->h[1] = sha224_h0[1];
+ ctx->h[2] = sha224_h0[2];
+ ctx->h[3] = sha224_h0[3];
+ ctx->h[4] = sha224_h0[4];
+ ctx->h[5] = sha224_h0[5];
+ ctx->h[6] = sha224_h0[6];
+ ctx->h[7] = sha224_h0[7];
+#endif
+
+ ctx->len = 0;
+ ctx->tot_len = 0;
+}
+
+void sha224_update(struct sha224_ctx *ctx, const unsigned char *message,
+ unsigned int len)
+{
+ unsigned int block_nb;
+ unsigned int new_len, rem_len, tmp_len;
+ const unsigned char *shifted_message;
+ unsigned long int i;
+
+ tmp_len = SHA224_BLOCK_SIZE - ctx->len;
+ rem_len = len < tmp_len ? len : tmp_len;
+
+ for (i = 0; i < rem_len; i++)
+ ctx->block[ctx->len + i] = message[i];
+
+ if (ctx->len + len < SHA224_BLOCK_SIZE) {
+ ctx->len += len;
+ return;
+ }
+
+ new_len = len - rem_len;
+ block_nb = new_len / SHA224_BLOCK_SIZE;
+
+ shifted_message = message + rem_len;
+
+ sha256_transf((struct sha256_ctx *)ctx, ctx->block, 1);
+ sha256_transf((struct sha256_ctx *)ctx, shifted_message, block_nb);
+
+ rem_len = new_len % SHA224_BLOCK_SIZE;
+
+ for (i = 0; i < rem_len; i++)
+ ctx->block[i] = shifted_message[(block_nb << 6) + i];
+
+ ctx->len = rem_len;
+ ctx->tot_len += (block_nb + 1) << 6;
+}
+
+void sha224_final(struct sha224_ctx *ctx, unsigned char *digest)
+{
+ unsigned int block_nb;
+ unsigned int pm_len;
+ unsigned int len_b;
+ unsigned long int i_m;
+
+#ifndef UNROLL_LOOPS
+ int i;
+#endif
+
+ block_nb = (1 + ((SHA224_BLOCK_SIZE - 9)
+ < (ctx->len % SHA224_BLOCK_SIZE)));
+
+ len_b = (ctx->tot_len + ctx->len) << 3;
+ pm_len = block_nb << 6;
+
+ for (i_m = 0; i_m < pm_len - ctx->len; i_m++)
+ ctx->block[ctx->len + i_m] = 0;
+
+ ctx->block[ctx->len] = 0x80;
+ UNPACK32(len_b, ctx->block + pm_len - 4);
+
+ sha256_transf((struct sha256_ctx *)ctx, ctx->block, block_nb);
+
+#ifndef UNROLL_LOOPS
+ for (i = 0; i < 7; i++)
+ UNPACK32(ctx->h[i], &digest[i << 2]);
+#else
+ UNPACK32(ctx->h[0], &digest[0]);
+ UNPACK32(ctx->h[1], &digest[4]);
+ UNPACK32(ctx->h[2], &digest[8]);
+ UNPACK32(ctx->h[3], &digest[12]);
+ UNPACK32(ctx->h[4], &digest[16]);
+ UNPACK32(ctx->h[5], &digest[20]);
+ UNPACK32(ctx->h[6], &digest[24]);
+#endif
+}
diff --git a/ta/crypt/sha2_taf.c b/ta/crypt/sha2_taf.c
new file mode 100644
index 0000000..3d86428
--- /dev/null
+++ b/ta/crypt/sha2_taf.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sha2_taf.h"
+#include "sha2_impl.h"
+
+TEE_Result ta_entry_sha224(uint32_t param_types, TEE_Param params[4])
+{
+/*
+ * It is expected that memRef[0] is input buffer and memRef[1] is
+ * output buffer.
+ */
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+
+ if (params[1].memref.size < SHA224_DIGEST_SIZE)
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ sha224((unsigned char *)params[0].memref.buffer,
+ (unsigned int)params[0].memref.size,
+ (unsigned char *)params[1].memref.buffer);
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_sha256(uint32_t param_types, TEE_Param params[4])
+{
+/*
+ * It is expected that memRef[0] is input buffer and memRef[1] is
+ * output buffer.
+ */
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+
+ if (params[1].memref.size < SHA256_DIGEST_SIZE)
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ sha256((unsigned char *)params[0].memref.buffer,
+ (unsigned int)params[0].memref.size,
+ (unsigned char *)params[1].memref.buffer);
+
+ return TEE_SUCCESS;
+}
diff --git a/ta/crypt/sub.mk b/ta/crypt/sub.mk
new file mode 100644
index 0000000..83286c2
--- /dev/null
+++ b/ta/crypt/sub.mk
@@ -0,0 +1,7 @@
+global-incdirs-y += include
+srcs-y += aes_impl.c
+srcs-y += aes_taf.c
+srcs-y += cryp_taf.c
+srcs-y += sha2_impl.c
+srcs-y += sha2_taf.c
+srcs-y += ta_entry.c
diff --git a/ta/crypt/ta_entry.c b/ta/crypt/ta_entry.c
new file mode 100644
index 0000000..0672b22
--- /dev/null
+++ b/ta/crypt/ta_entry.c
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <tee_ta_api.h>
+#include <ta_crypt.h>
+#include <aes_taf.h>
+#include <sha2_taf.h>
+#include <cryp_taf.h>
+
+static TEE_Result set_global(uint32_t param_types, TEE_Param params[4]);
+static TEE_Result get_global(uint32_t param_types, TEE_Param params[4]);
+static int _globalvalue;
+
+/*
+ * Trusted Application Entry Points
+ */
+
+/* Called each time a new instance is created */
+TEE_Result TA_CreateEntryPoint(void)
+{
+ return TEE_SUCCESS;
+}
+
+/* Called each time an instance is destroyed */
+void TA_DestroyEntryPoint(void)
+{
+}
+
+/* Called each time a session is opened */
+TEE_Result TA_OpenSessionEntryPoint(uint32_t nParamTypes,
+ TEE_Param pParams[4],
+ void **ppSessionContext)
+{
+ (void)nParamTypes;
+ (void)pParams;
+ (void)ppSessionContext;
+ return TEE_SUCCESS;
+}
+
+/* Called each time a session is closed */
+void TA_CloseSessionEntryPoint(void *pSessionContext)
+{
+ (void)pSessionContext;
+}
+
+/* Called when a command is invoked */
+TEE_Result TA_InvokeCommandEntryPoint(void *pSessionContext,
+ uint32_t nCommandID, uint32_t nParamTypes,
+ TEE_Param pParams[4])
+{
+ (void)pSessionContext;
+
+ switch (nCommandID) {
+ case TA_CRYPT_CMD_SHA224:
+ return ta_entry_sha224(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_SHA256:
+ return ta_entry_sha256(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_AES256ECB_ENC:
+ return ta_entry_aes256ecb_encrypt(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_AES256ECB_DEC:
+ return ta_entry_aes256ecb_decrypt(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_ALLOCATE_OPERATION:
+ return ta_entry_allocate_operation(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_FREE_OPERATION:
+ return ta_entry_free_operation(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_GET_OPERATION_INFO:
+ return ta_entry_get_operation_info(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_RESET_OPERATION:
+ return ta_entry_reset_operation(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_SET_OPERATION_KEY:
+ return ta_entry_set_operation_key(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_SET_OPERATION_KEY2:
+ return ta_entry_set_operation_key2(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_COPY_OPERATION:
+ return ta_entry_copy_operation(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_DIGEST_UPDATE:
+ return ta_entry_digest_update(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_DIGEST_DO_FINAL:
+ return ta_entry_digest_do_final(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_CIPHER_INIT:
+ return ta_entry_cipher_init(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_CIPHER_UPDATE:
+ return ta_entry_cipher_update(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_CIPHER_DO_FINAL:
+ return ta_entry_cipher_do_final(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_MAC_INIT:
+ return ta_entry_mac_init(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_MAC_UPDATE:
+ return ta_entry_mac_update(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_MAC_FINAL_COMPUTE:
+ return ta_entry_mac_final_compute(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_MAC_FINAL_COMPARE:
+ return ta_entry_mac_final_compare(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_ALLOCATE_TRANSIENT_OBJECT:
+ return ta_entry_allocate_transient_object(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_FREE_TRANSIENT_OBJECT:
+ return ta_entry_free_transient_object(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_RESET_TRANSIENT_OBJECT:
+ return ta_entry_reset_transient_object(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_POPULATE_TRANSIENT_OBJECT:
+ return ta_entry_populate_transient_object(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_COPY_OBJECT_ATTRIBUTES:
+ return ta_entry_copy_object_attributes(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_GENERATE_KEY:
+ return ta_entry_generate_key(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_ASYMMETRIC_ENCRYPT:
+ return ta_entry_asymmetric_encrypt(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_ASYMMETRIC_DECRYPT:
+ return ta_entry_asymmetric_decrypt(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_ASYMMETRIC_SIGN_DIGEST:
+ return ta_entry_asymmetric_sign_digest(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_ASYMMETRIC_VERIFY_DIGEST:
+ return ta_entry_asymmetric_verify_digest(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_DERIVE_KEY:
+ return ta_entry_derive_key(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_RANDOM_NUMBER_GENEREATE:
+ return ta_entry_random_number_generate(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_AE_INIT:
+ return ta_entry_ae_init(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_AE_UPDATE_AAD:
+ return ta_entry_ae_update_aad(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_AE_UPDATE:
+ return ta_entry_ae_update(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_AE_ENCRYPT_FINAL:
+ return ta_entry_ae_encrypt_final(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_AE_DECRYPT_FINAL:
+ return ta_entry_ae_decrypt_final(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_GET_OBJECT_BUFFER_ATTRIBUTE:
+ return ta_entry_get_object_buffer_attribute(nParamTypes,
+ pParams);
+ case TA_CRYPT_CMD_GET_OBJECT_VALUE_ATTRIBUTE:
+ return ta_entry_get_object_value_attribute(nParamTypes,
+ pParams);
+ case TA_CRYPT_CMD_SETGLOBAL:
+ return set_global(nParamTypes, pParams);
+
+ case TA_CRYPT_CMD_GETGLOBAL:
+ return get_global(nParamTypes, pParams);
+
+ default:
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+}
+
+static TEE_Result set_global(uint32_t param_types, TEE_Param params[4])
+{
+ int i;
+
+ /* Param 0 is a memref, input/output */
+ if (TEE_PARAM_TYPE_VALUE_INPUT != TEE_PARAM_TYPE_GET(param_types, 0))
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ /* Other parameters must be of type TEE_PARAM_TYPE_NONE */
+ for (i = 1; i < 4; i++) {
+ if (TEE_PARAM_TYPE_NONE != TEE_PARAM_TYPE_GET(param_types, i))
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+
+ _globalvalue = params[0].value.a;
+ return TEE_SUCCESS;
+}
+
+static TEE_Result get_global(uint32_t param_types, TEE_Param params[4])
+{
+ int i;
+
+ /* Param 0 is a memref, input/output */
+ if (TEE_PARAM_TYPE_VALUE_OUTPUT != TEE_PARAM_TYPE_GET(param_types, 0))
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ /* Other parameters must be of type TEE_PARAM_TYPE_NONE */
+ for (i = 1; i < 4; i++) {
+ if (TEE_PARAM_TYPE_NONE != TEE_PARAM_TYPE_GET(param_types, i))
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+
+ params[0].value.a = _globalvalue;
+ return TEE_SUCCESS;
+}
diff --git a/ta/enc_fs/include/enc_fs_key_manager_test.h b/ta/enc_fs/include/enc_fs_key_manager_test.h
new file mode 100644
index 0000000..50c7b36
--- /dev/null
+++ b/ta/enc_fs/include/enc_fs_key_manager_test.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef ENC_FS_KEY_MANAGER_TEST_H
+#define ENC_FS_KEY_MANAGER_TEST_H
+
+/* This UUID is generated with uuidgen
+ the ITU-T UUID generator at http://www.itu.int/ITU-T/asn1/uuid.html */
+#define ENC_FS_KEY_MANAGER_TEST_UUID \
+ { 0x17E5E280, 0xD12E, 0x11E4, \
+ { 0xA4, 0x1A, 0x00, 0x02, 0xA5, 0xD5, 0xC5, 0x1B } }
+/* The TAFs ID implemented in this TA */
+#define CMD_SELF_TESTS 0
+
+#endif /*ENC_FS_KEY_MANAGER_TEST_H*/
diff --git a/ta/os_test/Makefile b/ta/os_test/Makefile
new file mode 100644
index 0000000..add25bb
--- /dev/null
+++ b/ta/os_test/Makefile
@@ -0,0 +1,2 @@
+BINARY = 5b9e0e40-2636-11e1-ad9e0002a5d5c51b
+include ../ta_common.mk
diff --git a/ta/os_test/include/init.h b/ta/os_test/include/init.h
new file mode 100644
index 0000000..69bf171
--- /dev/null
+++ b/ta/os_test/include/init.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef INIT_H
+#define INIT_H
+
+#include <tee_api.h>
+
+TEE_Result ta_entry_init(uint32_t param_types, TEE_Param params[4]);
+
+#endif
diff --git a/ta/os_test/include/os_test.h b/ta/os_test/include/os_test.h
new file mode 100644
index 0000000..7c014b8
--- /dev/null
+++ b/ta/os_test/include/os_test.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef OS_TEST_H
+#define OS_TEST_H
+
+#include <tee_api.h>
+
+TEE_Result ta_entry_basic(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_entry_client_with_timeout(uint32_t param_types,
+ TEE_Param params[4]);
+TEE_Result ta_entry_panic(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_entry_client(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_entry_private_params(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_entry_wait(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_entry_bad_mem_access(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_entry_mfw_apply_ddr_rules(uint32_t param_types,
+ TEE_Param params[4]);
+TEE_Result ta_entry_mfw_apply_esram_rules(uint32_t param_types,
+ TEE_Param params[4]);
+TEE_Result ta_entry_mfw_buffer_is_firewalled(uint32_t param_types,
+ TEE_Param params[4]);
+TEE_Result ta_entry_mfw_cache_mainenance(uint32_t param_types,
+ TEE_Param params[4]);
+
+#endif /*OS_TEST_H */
diff --git a/ta/os_test/include/ta_os_test.h b/ta/os_test/include/ta_os_test.h
new file mode 100644
index 0000000..be84e4e
--- /dev/null
+++ b/ta/os_test/include/ta_os_test.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TA_OS_TEST_H
+#define TA_OS_TEST_H
+
+/* This UUID is generated with the ITU-T UUID generator at
+ http://www.itu.int/ITU-T/asn1/uuid.html */
+#define TA_OS_TEST_UUID { 0x5b9e0e40, 0x2636, 0x11e1, \
+ { 0xad, 0x9e, 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }
+
+#define TA_OS_TEST_CMD_INIT 0
+#define TA_OS_TEST_CMD_CLIENT_WITH_TIMEOUT 1
+#define TA_OS_TEST_CMD_BASIC 5
+#define TA_OS_TEST_CMD_PANIC 6
+#define TA_OS_TEST_CMD_CLIENT 7
+#define TA_OS_TEST_CMD_PRIVATE_PARAMS 8
+#define TA_OS_TEST_CMD_WAIT 9
+#define TA_OS_TEST_CMD_BAD_MEM_ACCESS 10
+
+/* TA_MEM_FIREWALL commands TA_OS_TEST_MFW_CMD_BASE + TA_MEM_FIREWALL_CMD_* */
+#define TA_OS_TEST_MFW_CMD_BASE 11
+#define TA_OS_TEST_MFW_CMD_LAST 16
+
+#endif /*TA_OS_TEST_H */
diff --git a/ta/os_test/include/tb_asserts.h b/ta/os_test/include/tb_asserts.h
new file mode 100644
index 0000000..60a900d
--- /dev/null
+++ b/ta/os_test/include/tb_asserts.h
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TB_ASSERTS_H
+#define TB_ASSERTS_H
+
+#include <trace.h>
+#include "tb_macros.h"
+
+/*
+ * TB_ASSERT_MSG general assert function with a message.
+ */
+#define TB_ASSERT_MSG(cond, str) \
+do { \
+ if (!(cond)) { \
+ EMSG("Assertion failed at line %d in file:\n%s\n", \
+ __LINE__, __FILE__); \
+ EMSG("Message: %s\n", str); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT general assert function.
+ */
+#define TB_ASSERT(cond) \
+do { \
+ if (!(cond)) { \
+ EMSG("Assertion failed at line %d in file:\n%s\n", \
+ __LINE__, __FILE__); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_EQ_SHORT checks that src equals the short value.
+ */
+#define TB_ASSERT_EQ_SHORT(src, short) \
+do { \
+ if (((short) == 0) && (__mpanum_size((mpanum)src) != 0)) { \
+ EMSG("Assertion failed at line %d in file:\n%s\n", \
+ __LINE__, __FILE__); \
+ EMSG("short == 0, but size != 0\n"); \
+ HALT; \
+ } else if (__mpanum_size((mpanum)src) > 1) { \
+ EMSG("Assertion failed at line %d in file:\n%s\n", \
+ __LINE__, __FILE__); \
+ EMSG("size > 1, cannot be equal to a short.\n"); \
+ HALT; \
+ } else if ( \
+ (int)(__mpanum_lsw((mpanum)src)*__mpanum_sign((mpanum)src)) != \
+ (int)(short)) { \
+ EMSG("Assertion failed at line %d in file:\n%s\n", \
+ __LINE__, __FILE__); \
+ EMSG("short == %d, but src == %d\n", (short), \
+ (int)(__mpanum_lsw((mpanum)src) \
+ *__mpanum_sign((mpanum)src))); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_STR_EQ checks that the two strings a and b are equal.
+ */
+#define TB_ASSERT_STR_EQ(a, b) \
+do { \
+ if (my_strcmp((a), (b)) != 0) { \
+ EMSG("Assertion failed %s != %s\n", (a), (b)); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_HEX_VALUE checks that a prints to the string v in hex.
+ */
+#define TB_ASSERT_HEX_PRINT_VALUE(a, v, grpsize) \
+do { \
+ char *_str_; \
+ _str_ = TEE_BigIntConvertToString(NULL, \
+ TEE_STRING_MODE_HEX_UC, grpsize, (a)); \
+ TB_ASSERT_STR_EQ(_str_, (v)); \
+ TEE_Free(_str_); \
+} while (0)
+
+/*
+ * TB_ASSERT_POINTER_NULL(p) checks that p is null
+ */
+#define TB_ASSERT_POINTER_NULL(p) \
+do { \
+ if ((p) != 0) { \
+ EMSG("Assertion failed, pointer was not null.\n"); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_POINTERS_EQ checks that p, q are pointing to the same element
+ */
+#define TB_ASSERT_POINTERS_EQ(p, q) \
+do { \
+ if ((p) != (q)) { \
+ EMSG("Assertion failed, pointers are not equal.\n"); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_POINTERS_NEQ checks that p, q are not pointing to the same element
+ */
+#define TB_ASSERT_POINTERS_NEQ(p, q) \
+do { \
+ if ((p) == (q)) { \
+ EMSG("Assertion failed, pointers are equal.\n"); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_BIGINT_EQ Checks that a and b are equal
+ */
+#define TB_ASSERT_BIGINT_EQ(a, b) \
+do { \
+ if (TEE_BigIntCmp((a), (b)) != 0) { \
+ EMSG("Assertion failed, numbers are not equal.\n"); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_BIGINT_NEQ Checks that a and b are different
+ */
+#define TB_ASSERT_BIGINT_NEQ(a, b) \
+do { \
+ if (TEE_BigIntCmp((a), (b)) == 0) { \
+ EMSG("Assertion failed, numbers are equal.\n"); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_BIGINT_LESS Checks that a < b
+ */
+#define TB_ASSERT_BIGINT_LESS(a, b) \
+do { \
+ if (TEE_BigIntCmp((a), (b)) >= 0) { \
+ EMSG("Assertion failed, first is not less than second.\n"); \
+ HALT; \
+ }; \
+} while (0)
+
+/*
+ * TB_ASSERT_INT_EQ Checks that a and be are equal
+ */
+#define TB_ASSERT_INT_EQ(a, b) \
+do { \
+ if ((a) != (b)) { \
+ EMSG("Assertion failed, numbers are not equal.\n"); \
+ HALT; \
+ }; \
+} while (0)
+
+#endif
diff --git a/ta/os_test/include/tb_macros.h b/ta/os_test/include/tb_macros.h
new file mode 100644
index 0000000..c729c32
--- /dev/null
+++ b/ta/os_test/include/tb_macros.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef TB_MACROS_H
+#define TB_MACROS_H
+
+#include <tee_internal_api_extensions.h>
+
+#define TB_HEADER(str) \
+ printf("\n*********** TESTBENCH ***********" \
+ "\n*** RUNNING: <<< %s >>>" \
+ "\n*********************************\n\n", str)
+
+#define TB_FOOTER(str) \
+ printf("\n*********** TESTBENCH ***********" \
+ "\n*** PASSED: <<< %s >>>" \
+ "\n*********************************\n\n", str)
+
+#define TB_INFO(str) printf("*** INFO : %s \n", (str))
+
+#define HALT \
+ { \
+ printf("\n*** FAILED ***" \
+ "\nTestbench halted at line %d in function %s\n", \
+ __LINE__, __func__); \
+ printf("\nWaiting for keypress to enable debugging.\n"); \
+ TEE_Panic(0); \
+ }
+
+#define STARTING \
+ printf("\n*********** TESTBENCH ***********" \
+ "\n*** For the GlobalPlatform Math API" \
+ "\n*********************************\n\n")
+
+#define ALL_PASSED \
+ printf("\n*********** TESTBENCH ***********" \
+ "\n*** ALL TESTS PASSED ***" \
+ "\n*********************************\n\n")
+
+/*
+ * DEF_BIGINT defines and initialize a BigInt with name and size.
+ */
+#define DEF_BIGINT(name, size) \
+ TEE_BigInt *name; \
+ size_t name##_size; \
+ name##_size = TEE_BigIntSizeInU32(size); \
+ name = (TEE_BigInt *)TEE_Malloc(name##_size * sizeof(TEE_BigInt), 0); \
+ TEE_BigIntInit(name, name##_size)
+
+/*
+ * DEL_BIGINT frees the BigInt.
+ */
+#define DEL_BIGINT(name) TEE_Free(name)
+
+/*
+ * TB_PRINT_BIGINT prints the mpanum in base 16.
+ */
+#define TB_PRINT_BIGINT(n) \
+do { \
+ char *str; \
+ str = TEE_BigIntConvertToString(NULL, TEE_STRING_MODE_HEX_UC, 0, (n)); \
+ printf("%s\n", str); \
+ TEE_Free(str); \
+} while (0)
+
+#endif
diff --git a/ta/os_test/include/testframework.h b/ta/os_test/include/testframework.h
new file mode 100644
index 0000000..5a237d5
--- /dev/null
+++ b/ta/os_test/include/testframework.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GUARD_testframework_H
+#define GUARD_testframework_H
+
+#include "tee_internal_api.h"
+
+#include "tee_arith_internal.h"
+
+#include "tb_macros.h"
+#include "tb_asserts.h"
+#include "mpa_debug.h"
+
+/* define the max size of generated numbers */
+/* this is number of hex chars in the number */
+#define MAX_RAND_DIGITS 256
+#define MAX_RAND_STRING_SIZE (MAX_RAND_DIGITS + 2)
+
+size_t my_strlen(const char *string);
+int my_strcmp(const char *s1, const char *s2);
+size_t my_strlcpy(char *dst, const char *src, size_t siz);
+
+void tb_set_random_value(TEE_BigInt *a, char *str, int allow_neg);
+void tb_get_random_str(char *str, int allow_neg);
+
+void tb_main(void);
+
+void tb_var(void);
+void tb_conv(void);
+void tb_cmp(void);
+void tb_addsub(void);
+void tb_mul(void);
+void tb_shift(void);
+void tb_div(void);
+void tb_gcd(void);
+void tb_modulus(void);
+void tb_fmm(void);
+void tb_prime(void);
+
+extern mpa_scratch_mem mempool;
+
+int TEE_BigIntConvertFromString(TEE_BigInt *dest, const char *src);
+char *TEE_BigIntConvertToString(char *dest, int mode, int groupsize,
+ const TEE_BigInt *src);
+
+#endif /* include guard */
diff --git a/ta/os_test/include/user_ta_header_defines.h b/ta/os_test/include/user_ta_header_defines.h
new file mode 100644
index 0000000..7d82db5
--- /dev/null
+++ b/ta/os_test/include/user_ta_header_defines.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include <stdint.h>
+#include <ta_os_test.h>
+#include <user_ta_header.h>
+
+#define TA_UUID TA_OS_TEST_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_UNSAFE_NW_PARAMS | \
+ TA_FLAG_MULTI_SESSION)
+#define TA_STACK_SIZE (2 * 1024)
+#define TA_DATA_SIZE (32 * 1024)
+
+#define TA_CURRENT_TA_EXT_PROPERTIES \
+ { "myprop.true", USER_TA_PROP_TYPE_BOOL, &(const bool){ true } }, \
+ { "myprop.42", USER_TA_PROP_TYPE_U32, &(const uint32_t){ 42 } }, \
+ { "myprop.123", USER_TA_PROP_TYPE_UUID, \
+ &(const TEE_UUID) {1, 2, 3 } }, \
+ { "myprop.1234", USER_TA_PROP_TYPE_IDENTITY, \
+ &(const TEE_Identity) { 1, { 2, 3, 4 } } }, \
+ { "myprop.hello", USER_TA_PROP_TYPE_STRING, "hello" }, \
+ { "myprop.binaryblock", USER_TA_PROP_TYPE_BINARY_BLOCK, \
+ "SGVsbG8gd29ybGQh" },
+#endif
diff --git a/ta/os_test/init.c b/ta/os_test/init.c
new file mode 100644
index 0000000..a3d6e11
--- /dev/null
+++ b/ta/os_test/init.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+#include <init.h>
+#include <tee_api.h>
+
+TEE_Result ta_entry_init(uint32_t param_types, TEE_Param params[4])
+{
+ TEE_Time date;
+ (void)param_types;
+ (void)params;
+
+ return TEE_GetTAPersistentTime(&date);
+}
diff --git a/ta/os_test/os_test.c b/ta/os_test/os_test.c
new file mode 100644
index 0000000..6fcbc7c
--- /dev/null
+++ b/ta/os_test/os_test.c
@@ -0,0 +1,670 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+
+#include <compiler.h>
+#include <ta_crypt.h>
+#include <ta_os_test.h>
+#include <tee_internal_api_extensions.h>
+
+#include "os_test.h"
+#include "testframework.h"
+
+enum p_type {
+ P_TYPE_BOOL,
+ P_TYPE_INT,
+ P_TYPE_UUID,
+ P_TYPE_IDENTITY,
+ P_TYPE_STRING,
+ P_TYPE_BINARY_BLOCK,
+};
+
+struct p_attr {
+ const char *str;
+ enum p_type type;
+ bool retrieved;
+};
+
+static TEE_Result print_properties(TEE_PropSetHandle h,
+ TEE_PropSetHandle prop_set,
+ struct p_attr *p_attrs, size_t num_p_attrs)
+{
+TEE_Result res;
+size_t n;
+
+TEE_StartPropertyEnumerator(h, prop_set);
+
+while (true) {
+ char nbuf[80];
+ char vbuf[80];
+ char vbuf2[80];
+ size_t nblen = sizeof(nbuf);
+ size_t vblen = sizeof(vbuf);
+ size_t vblen2 = sizeof(vbuf2);
+
+ res = TEE_GetPropertyName(h, nbuf, &nblen);
+ if (res != TEE_SUCCESS) {
+ EMSG("TEE_GetPropertyName returned 0x%x\n",
+ (unsigned int)res);
+ return res;
+ }
+
+ res = TEE_GetPropertyAsString(h, NULL, vbuf, &vblen);
+ if (res != TEE_SUCCESS) {
+ EMSG("1TEE_GetPropertyAsString(\"%s\") returned 0x%x\n",
+ nbuf, (unsigned int)res);
+ return res;
+ }
+ res = TEE_GetPropertyAsString(prop_set, nbuf, vbuf2, &vblen2);
+ if (res != TEE_SUCCESS) {
+ EMSG("2TEE_GetPropertyAsString(\"%s\") returned 0x%x\n",
+ nbuf, (unsigned int)res);
+ return res;
+ }
+ if (my_strcmp(vbuf, vbuf2) != 0) {
+ EMSG("String of \"%s\" differs\n", nbuf);
+ return TEE_ERROR_GENERIC;
+ }
+
+ DMSG("Found \"%s\" value \"%s\"\n", nbuf, vbuf);
+
+ for (n = 0; n < num_p_attrs; n++) {
+ if (my_strcmp(nbuf, p_attrs[n].str) != 0)
+ continue;
+
+ if (p_attrs[n].retrieved) {
+ EMSG("Value \"%s\" already retrieved\n",
+ p_attrs[n].str);
+ return TEE_ERROR_GENERIC;
+ }
+ p_attrs[n].retrieved = true;
+
+ switch (p_attrs[n].type) {
+ case P_TYPE_BOOL:
+ {
+ bool v;
+
+ res =
+ TEE_GetPropertyAsBool(h, NULL, &v);
+ if (res != TEE_SUCCESS) {
+ EMSG(
+ "TEE_GetPropertyAsBool(\"%s\") returned 0x%x\n",
+ nbuf, (unsigned int)res);
+ return res;
+ }
+ }
+ break;
+
+ case P_TYPE_INT:
+ {
+ uint32_t v;
+
+ res = TEE_GetPropertyAsU32(h, NULL, &v);
+ if (res != TEE_SUCCESS) {
+ EMSG(
+ "TEE_GetPropertyAsU32(\"%s\") returned 0x%x\n",
+ nbuf, (unsigned int)res);
+ return res;
+ }
+ }
+ break;
+
+ case P_TYPE_UUID:
+ {
+ TEE_UUID v;
+
+ res =
+ TEE_GetPropertyAsUUID(h, NULL, &v);
+ if (res != TEE_SUCCESS) {
+ EMSG(
+ "TEE_GetPropertyAsUUID(\"%s\") returned 0x%x\n",
+ nbuf, (unsigned int)res);
+ return res;
+ }
+ }
+ break;
+
+ case P_TYPE_IDENTITY:
+ {
+ TEE_Identity v;
+
+ res =
+ TEE_GetPropertyAsIdentity(h, NULL,
+ &v);
+ if (res != TEE_SUCCESS) {
+ EMSG(
+ "TEE_GetPropertyAsIdentity(\"%s\") returned 0x%x\n",
+ nbuf, (unsigned int)res);
+ return res;
+ }
+ }
+ break;
+
+ case P_TYPE_STRING:
+ /* Already read as string */
+ break;
+
+ case P_TYPE_BINARY_BLOCK:
+ {
+ char bbuf[80];
+ size_t bblen = sizeof(bbuf);
+
+ res =
+ TEE_GetPropertyAsBinaryBlock(h,
+ NULL,
+ bbuf,
+ &bblen);
+ if (res != TEE_SUCCESS) {
+ EMSG(
+ "TEE_GetPropertyAsBinaryBlock(\"%s\") returned 0x%x\n",
+ nbuf, (unsigned int)res);
+ return res;
+ }
+ if (my_strcmp
+ ("myprop.binaryblock", nbuf) == 0) {
+ const char exp_bin_value[] =
+ "Hello world!";
+
+ if (bblen !=
+ my_strlen(exp_bin_value)
+ ||
+ TEE_MemCompare
+ (exp_bin_value, bbuf,
+ bblen) != 0) {
+ EMSG(
+ "Binary buffer of \"%s\" differs from \"%s\"\n",
+ nbuf, exp_bin_value);
+ EMSG(
+ "Got \"%s\"\n",
+ bbuf);
+ return
+ TEE_ERROR_GENERIC;
+ }
+ }
+
+ }
+ break;
+
+ default:
+ EMSG("Unknown type (%d) for \"%s\"\n",
+ p_attrs[n].type, p_attrs[n].str);
+ return TEE_ERROR_GENERIC;
+ }
+ }
+
+ res = TEE_GetNextProperty(h);
+ if (res != TEE_SUCCESS) {
+ if (res == TEE_ERROR_ITEM_NOT_FOUND)
+ return TEE_SUCCESS;
+ return res;
+ }
+}
+}
+
+static TEE_Result test_malloc(void)
+{
+ void *p = TEE_Malloc(4, 0);
+
+ if (p == NULL) {
+ EMSG("TEE_Malloc failed\n");
+ return TEE_ERROR_OUT_OF_MEMORY;
+ }
+ TEE_Free(p);
+ TEE_Free(NULL);
+
+ return TEE_SUCCESS;
+}
+
+static TEE_Result test_properties(void)
+{
+ TEE_Result res = TEE_ERROR_GENERIC;
+ TEE_PropSetHandle h;
+ struct p_attr p_attrs[] = {
+ {"gpd.ta.appID", P_TYPE_UUID},
+ {"gpd.ta.singleInstance", P_TYPE_BOOL},
+ {"gpd.ta.multiSession", P_TYPE_BOOL},
+ {"gpd.ta.instanceKeepAlive", P_TYPE_BOOL},
+ {"gpd.ta.dataSize", P_TYPE_INT},
+ {"gpd.ta.stackSize", P_TYPE_INT},
+ {"gpd.ta.version", P_TYPE_STRING},
+ {"gpd.ta.description", P_TYPE_STRING},
+ {"gpd.client.identity", P_TYPE_IDENTITY},
+ {"gpd.tee.apiversion", P_TYPE_STRING},
+ {"gpd.tee.description", P_TYPE_STRING},
+ {"gpd.tee.deviceID", P_TYPE_UUID},
+ {"gpd.tee.systemTime.protectionLevel", P_TYPE_INT},
+ {"gpd.tee.TAPersistentTime.protectionLevel", P_TYPE_INT},
+ {"gpd.tee.arith.maxBigIntSize", P_TYPE_INT},
+ {"gpd.tee.cryptography.ecc", P_TYPE_BOOL},
+ {"gpd.tee.trustedStorage.antiRollback.protectionLevel", P_TYPE_INT},
+ {"gpd.tee.trustedos.implementation.version", P_TYPE_STRING},
+ {"gpd.tee.trustedos.implementation.binaryversion", P_TYPE_INT},
+ {"gpd.tee.trustedos.manufacturer", P_TYPE_STRING},
+ {"gpd.tee.firmware.implementation.version", P_TYPE_STRING},
+ {"gpd.tee.firmware.implementation.binaryversion", P_TYPE_INT},
+ {"gpd.tee.firmware.manufacturer", P_TYPE_STRING},
+ {"myprop.true", P_TYPE_BOOL},
+ {"myprop.42", P_TYPE_INT},
+ {"myprop.123", P_TYPE_UUID},
+ {"myprop.1234", P_TYPE_IDENTITY},
+ {"myprop.hello", P_TYPE_STRING},
+ {"myprop.binaryblock", P_TYPE_BINARY_BLOCK},
+ };
+ const size_t num_p_attrs = sizeof(p_attrs) / sizeof(p_attrs[0]);
+ size_t n;
+
+ res = TEE_AllocatePropertyEnumerator(&h);
+ if (res != TEE_SUCCESS) {
+ EMSG("TEE_AllocatePropertyEnumerator: returned 0x%x\n",
+ (unsigned int)res);
+ return TEE_ERROR_GENERIC;
+ }
+
+ printf("Getting properties for current TA\n");
+ res = print_properties(h, TEE_PROPSET_CURRENT_TA, p_attrs, num_p_attrs);
+ if (res != TEE_SUCCESS)
+ goto cleanup_return;
+
+ printf("Getting properties for current client\n");
+ res = print_properties(h, TEE_PROPSET_CURRENT_CLIENT, p_attrs,
+ num_p_attrs);
+ if (res != TEE_SUCCESS)
+ goto cleanup_return;
+
+ printf("Getting properties for implementation\n");
+ res = print_properties(h, TEE_PROPSET_TEE_IMPLEMENTATION, p_attrs,
+ num_p_attrs);
+ if (res != TEE_SUCCESS)
+ goto cleanup_return;
+
+ for (n = 0; n < num_p_attrs; n++) {
+ if (!p_attrs[n].retrieved) {
+ EMSG("\"%s\" not retrieved\n", p_attrs[n].str);
+ res = TEE_ERROR_GENERIC;
+ goto cleanup_return;
+ }
+ }
+
+cleanup_return:
+ TEE_FreePropertyEnumerator(h);
+ return res;
+}
+
+static TEE_Result test_mem_access_right(uint32_t param_types,
+ TEE_Param params[4])
+{
+ static const TEE_UUID test_uuid = TA_OS_TEST_UUID;
+ TEE_Result res;
+ uint32_t ret_orig;
+ uint32_t l_pts;
+ TEE_Param l_params[4] = { { {0} } };
+ uint8_t buf[32];
+ TEE_TASessionHandle sess = TEE_HANDLE_NULL;
+
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT, 0, 0, 0))
+ return TEE_ERROR_GENERIC;
+ res =
+ TEE_CheckMemoryAccessRights(TEE_MEMORY_ACCESS_READ |
+ TEE_MEMORY_ACCESS_ANY_OWNER,
+ params[0].memref.buffer,
+ params[0].memref.size);
+ if (res != TEE_SUCCESS)
+ return res;
+ res = TEE_CheckMemoryAccessRights(TEE_MEMORY_ACCESS_READ,
+ params[0].memref.buffer,
+ params[0].memref.size);
+ if (res != TEE_ERROR_ACCESS_DENIED)
+ return TEE_ERROR_GENERIC;
+
+ res = TEE_OpenTASession(&test_uuid, 0, 0, NULL, &sess, &ret_orig);
+ if (res != TEE_SUCCESS) {
+ EMSG("test_mem_access_right: TEE_OpenTASession failed\n");
+ goto cleanup_return;
+ }
+
+ l_pts = TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT, 0, 0, 0);
+ l_params[0].memref.buffer = buf;
+ l_params[0].memref.size = sizeof(buf);
+ res = TEE_InvokeTACommand(sess, 0, TA_OS_TEST_CMD_PRIVATE_PARAMS,
+ l_pts, l_params, &ret_orig);
+ if (res != TEE_SUCCESS) {
+ EMSG("test_mem_access_right: TEE_InvokeTACommand failed\n");
+ goto cleanup_return;
+ }
+
+cleanup_return:
+ TEE_CloseTASession(sess);
+ return res;
+}
+
+static TEE_Result test_time(void)
+{
+ TEE_Result res;
+ TEE_Time t;
+ TEE_Time sys_t;
+
+ static const TEE_Time null_time = { 0, 0 };
+ static const TEE_Time wrap_time = { UINT32_MAX, 999 };
+
+ TEE_GetSystemTime(&sys_t);
+ printf("system time %u.%03u\n", (unsigned int)sys_t.seconds,
+ (unsigned int)sys_t.millis);
+
+ TEE_GetREETime(&t);
+ printf("REE time %u.%03u\n", (unsigned int)t.seconds,
+ (unsigned int)t.millis);
+
+ res = TEE_GetTAPersistentTime(&t);
+ switch (res) {
+ case TEE_SUCCESS:
+ printf("Stored TA time %u.%03u\n", (unsigned int)t.seconds,
+ (unsigned int)t.millis);
+ break;
+ case TEE_ERROR_OVERFLOW:
+ EMSG("Stored TA time overflowed %u.%03u\n",
+ (unsigned int)t.seconds, (unsigned int)t.millis);
+ break;
+ case TEE_ERROR_TIME_NOT_SET:
+ EMSG("TA time not stored\n");
+ break;
+ case TEE_ERROR_TIME_NEEDS_RESET:
+ EMSG("TA time needs reset\n");
+ break;
+ default:
+ return res;
+ }
+
+ res = TEE_SetTAPersistentTime(&null_time);
+ if (res != TEE_SUCCESS) {
+ EMSG("TEE_SetTAPersistentTime: failed\n");
+ return res;
+ }
+
+ res = TEE_GetTAPersistentTime(&t);
+ if (res != TEE_SUCCESS) {
+ EMSG("TEE_GetTAPersistentTime null: failed\n");
+ return res;
+ }
+ printf("TA time %u.%03u\n", (unsigned int)t.seconds,
+ (unsigned int)t.millis);
+ /*
+ * The time between TEE_SetTAPersistentTime() and
+ * TEE_GetTAPersistentTime() should be much less than 1 second, in fact
+ * it's not even a millisecond.
+ */
+ if (t.seconds > 1 || t.millis >= 1000) {
+ EMSG("Unexpected stored TA time %u.%03u\n",
+ (unsigned int)t.seconds, (unsigned int)t.millis);
+ return TEE_ERROR_BAD_STATE;
+ }
+
+ res = TEE_SetTAPersistentTime(&wrap_time);
+ if (res != TEE_SUCCESS) {
+ EMSG("TEE_SetTAPersistentTime wrap: failed\n");
+ return res;
+ }
+
+ res = TEE_Wait(1000);
+ if (res != TEE_SUCCESS)
+ EMSG("TEE_Wait wrap: failed\n");
+
+ res = TEE_GetTAPersistentTime(&t);
+ if (res != TEE_ERROR_OVERFLOW) {
+ EMSG("TEE_GetTAPersistentTime: failed\n");
+ return TEE_ERROR_BAD_STATE;
+ }
+ printf("TA time %u.%03u\n", (unsigned int)t.seconds,
+ (unsigned int)t.millis);
+
+ if (t.seconds > sys_t.seconds) {
+ EMSG("Unexpected wrapped time %u.%03u (sys_t %u.%03u)\n",
+ (unsigned int)t.seconds, (unsigned int)t.millis,
+ (unsigned int)sys_t.seconds, (unsigned int)sys_t.millis);
+ return TEE_ERROR_BAD_STATE;
+ }
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_basic(uint32_t param_types, TEE_Param params[4])
+{
+ TEE_Result res = TEE_ERROR_GENERIC;
+
+ printf("ta_entry_basic: enter\n");
+
+ res = test_malloc();
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = test_properties();
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = test_mem_access_right(param_types, params);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = test_time();
+ if (res != TEE_SUCCESS)
+ return res;
+
+ /* mpa lib test bench, panics TA on failure */
+ tb_main();
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_panic(uint32_t param_types, TEE_Param params[4])
+{
+ volatile bool mytrue = true;
+ (void)param_types;
+ (void)params;
+
+ printf("ta_entry_panic: enter\n");
+ /*
+ * Somewhat clumsy way of avoiding compile errors if TEE_Panic() has
+ * the __noreturn attribute.
+ */
+ if (mytrue)
+ TEE_Panic(0xbeef);
+
+ /*
+ * Should not be reached, but if it is the testsuite can detect that
+ * TEE_Panic() returned instead of panicking the TA.
+ */
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_entry_client_with_timeout(uint32_t param_types,
+ TEE_Param params[4])
+{
+ static const TEE_UUID os_test_uuid = TA_OS_TEST_UUID;
+ TEE_Result res;
+ TEE_TASessionHandle sess;
+ uint32_t ret_orig;
+
+ if (param_types != TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE)) {
+ EMSG("ta_entry_client_with_timeout: bad parameters\n");
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+
+ res = TEE_OpenTASession(&os_test_uuid, 0, 0, NULL, &sess, &ret_orig);
+ if (res != TEE_SUCCESS) {
+ EMSG(
+ "ta_entry_client_with_timeout: TEE_OpenTASession failed\n");
+ return res;
+ }
+
+ res =
+ TEE_InvokeTACommand(sess, params[0].value.a / 2,
+ TA_OS_TEST_CMD_WAIT, param_types, params,
+ &ret_orig);
+
+ if (ret_orig != TEE_ORIGIN_TRUSTED_APP || res != TEE_ERROR_CANCEL) {
+ EMSG("ta_entry_client_with_timeout: TEE_InvokeTACommand: "
+ "res 0x%x ret_orig 0x%x\n", (unsigned int)res,
+ (unsigned int)ret_orig);
+ res = TEE_ERROR_GENERIC;
+ } else
+ res = TEE_SUCCESS;
+
+ TEE_CloseTASession(sess);
+ return res;
+
+}
+
+TEE_Result ta_entry_client(uint32_t param_types, TEE_Param params[4])
+{
+ static const TEE_UUID crypt_uuid = TA_CRYPT_UUID;
+ TEE_Result res;
+ uint32_t l_pts;
+ TEE_Param l_params[4] = { { {0} } };
+ TEE_TASessionHandle sess;
+ uint32_t ret_orig;
+ static const uint8_t sha256_in[] = { 'a', 'b', 'c' };
+ static const uint8_t sha256_out[] = {
+ 0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
+ 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
+ 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
+ 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad
+ };
+ uint8_t out[32] = { 0 };
+ void *in = NULL;
+
+ (void)param_types;
+ (void)params;
+
+ printf("ta_entry_client: enter\n");
+
+ in = TEE_Malloc(sizeof(sha256_in), 0);
+ if (in == NULL)
+ return TEE_ERROR_OUT_OF_MEMORY;
+ TEE_MemMove(in, sha256_in, sizeof(sha256_in));
+
+ res = TEE_OpenTASession(&crypt_uuid, 0, 0, NULL, &sess, &ret_orig);
+ if (res != TEE_SUCCESS) {
+ EMSG("ta_entry_client: TEE_OpenTASession failed\n");
+ goto cleanup_return;
+ }
+
+ l_pts = TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, 0, 0);
+ l_params[0].memref.buffer = in;
+ l_params[0].memref.size = sizeof(sha256_in);
+ l_params[1].memref.buffer = out;
+ l_params[1].memref.size = sizeof(out);
+
+ res = TEE_InvokeTACommand(sess, 0, TA_CRYPT_CMD_SHA256, l_pts, l_params,
+ &ret_orig);
+ if (res != TEE_SUCCESS) {
+ EMSG("ta_entry_client: TEE_InvokeTACommand failed\n");
+ goto cleanup_return;
+ }
+
+ if (TEE_MemCompare(sha256_out, out, sizeof(sha256_out)) != 0) {
+ EMSG("ta_entry_client: out parameter failed\n");
+ res = TEE_ERROR_GENERIC;
+ goto cleanup_return;
+ }
+
+cleanup_return:
+ TEE_Free(in);
+ TEE_CloseTASession(sess);
+ return res;
+}
+
+TEE_Result ta_entry_private_params(uint32_t param_types, TEE_Param params[4])
+{
+ TEE_Result res;
+
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT, 0, 0, 0))
+ return TEE_ERROR_GENERIC;
+ res =
+ TEE_CheckMemoryAccessRights(TEE_MEMORY_ACCESS_READ |
+ TEE_MEMORY_ACCESS_ANY_OWNER,
+ params[0].memref.buffer,
+ params[0].memref.size);
+ if (res != TEE_SUCCESS)
+ return res;
+
+ res = TEE_CheckMemoryAccessRights(TEE_MEMORY_ACCESS_READ,
+ params[0].memref.buffer,
+ params[0].memref.size);
+
+ return res;
+}
+
+TEE_Result ta_entry_wait(uint32_t param_types, TEE_Param params[4])
+{
+ TEE_Result res = TEE_SUCCESS;
+ (void)param_types;
+
+ printf("ta_entry_wait: waiting %d\n", (unsigned int)params[0].value.a);
+ /* Wait */
+ res = TEE_Wait(params[0].value.a);
+
+ return res;
+}
+
+TEE_Result ta_entry_bad_mem_access(uint32_t param_types, TEE_Param params[4])
+{
+ long stack;
+ long stack_addr = (long)&stack;
+
+ if (param_types != TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT, 0, 0, 0))
+ return TEE_ERROR_GENERIC;
+
+ switch (params[0].value.a) {
+ case 1:
+ *((uint32_t *) 0) = 0;
+ break;
+ case 2:
+ *((uint32_t *)(stack_addr + 0x40000000)) = 0;
+ break;
+ case 3:
+ ((void (*)(void))0) ();
+ break;
+ case 4:
+ ((void (*)(void))(stack_addr + 0x40000000)) ();
+ break;
+ case 5:
+ {
+ static const uint32_t my_undef = 0xffffffff;
+ ((void (*)(void))(uintptr_t) &my_undef) ();
+ }
+ break;
+ default:
+ break;
+ }
+
+ return TEE_SUCCESS;
+}
diff --git a/ta/os_test/sub.mk b/ta/os_test/sub.mk
new file mode 100644
index 0000000..4e50a2a
--- /dev/null
+++ b/ta/os_test/sub.mk
@@ -0,0 +1,29 @@
+global-incdirs-y += include
+global-incdirs-y += ../crypt/include
+srcs-y += init.c
+srcs-y += os_test.c
+srcs-y += ta_entry.c
+srcs-y += tb_addsub.c
+cflags-tb_addsub.c-y += -Wno-declaration-after-statement
+srcs-y += tb_cmp.c
+cflags-tb_cmp.c-y += -Wno-declaration-after-statement
+srcs-y += tb_conv.c
+cflags-tb_conv.c-y += -Wno-declaration-after-statement
+srcs-y += tb_div.c
+cflags-tb_div.c-y += -Wno-declaration-after-statement
+srcs-y += tb_fmm.c
+cflags-tb_fmm.c-y += -Wno-declaration-after-statement
+srcs-y += tb_gcd.c
+cflags-tb_gcd.c-y += -Wno-declaration-after-statement
+srcs-y += tb_io.c
+srcs-y += tb_modulus.c
+cflags-tb_modulus.c-y += -Wno-declaration-after-statement
+srcs-y += tb_mul.c
+cflags-tb_mul.c-y += -Wno-declaration-after-statement
+srcs-y += tb_prime.c
+cflags-tb_prime.c-y += -Wno-declaration-after-statement
+srcs-y += tb_shift.c
+cflags-tb_shift.c-y += -Wno-declaration-after-statement
+srcs-y += tb_var.c
+srcs-y += testframework.c
+
diff --git a/ta/os_test/ta_entry.c b/ta/os_test/ta_entry.c
new file mode 100644
index 0000000..fdae658
--- /dev/null
+++ b/ta/os_test/ta_entry.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+#include <init.h>
+#include <os_test.h>
+#include <ta_os_test.h>
+#include <tee_internal_api_extensions.h>
+#include <tee_ta_api.h>
+
+/*
+ * Trusted Application Entry Points
+ */
+
+/* Called each time a new instance is created */
+TEE_Result TA_CreateEntryPoint(void)
+{
+ DMSG("TA_CreateEntryPoint");
+ return TEE_SUCCESS;
+}
+
+/* Called each time an instance is destroyed */
+void TA_DestroyEntryPoint(void)
+{
+ DMSG("TA_DestroyEntryPoint");
+}
+
+/* Called each time a session is opened */
+TEE_Result TA_OpenSessionEntryPoint(uint32_t nParamTypes,
+ TEE_Param pParams[4],
+ void **ppSessionContext)
+{
+ (void)nParamTypes;
+ (void)pParams;
+ (void)ppSessionContext;
+ DMSG("TA_OpenSessionEntryPoint");
+ TEE_UnmaskCancellation();
+ return TEE_SUCCESS;
+}
+
+/* Called each time a session is closed */
+void TA_CloseSessionEntryPoint(void *pSessionContext)
+{
+ (void)pSessionContext;
+ DMSG("TA_CloseSessionEntryPoint");
+}
+
+/* Called when a command is invoked */
+TEE_Result TA_InvokeCommandEntryPoint(void *pSessionContext,
+ uint32_t nCommandID, uint32_t nParamTypes,
+ TEE_Param pParams[4])
+{
+ (void)pSessionContext;
+
+ switch (nCommandID) {
+ case TA_OS_TEST_CMD_INIT:
+ return ta_entry_init(nParamTypes, pParams);
+
+ case TA_OS_TEST_CMD_CLIENT_WITH_TIMEOUT:
+ return ta_entry_client_with_timeout(nParamTypes, pParams);
+
+ case TA_OS_TEST_CMD_BASIC:
+ return ta_entry_basic(nParamTypes, pParams);
+
+ case TA_OS_TEST_CMD_PANIC:
+ return ta_entry_panic(nParamTypes, pParams);
+
+ case TA_OS_TEST_CMD_CLIENT:
+ return ta_entry_client(nParamTypes, pParams);
+
+ case TA_OS_TEST_CMD_PRIVATE_PARAMS:
+ return ta_entry_private_params(nParamTypes, pParams);
+
+ case TA_OS_TEST_CMD_WAIT:
+ return ta_entry_wait(nParamTypes, pParams);
+
+ case TA_OS_TEST_CMD_BAD_MEM_ACCESS:
+ return ta_entry_bad_mem_access(nParamTypes, pParams);
+
+ default:
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+}
diff --git a/ta/os_test/tb_addsub.c b/ta/os_test/tb_addsub.c
new file mode 100644
index 0000000..e9edc1b
--- /dev/null
+++ b/ta/os_test/tb_addsub.c
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "testframework.h"
+
+#define ADD(s, t, r) \
+do { \
+ TEE_BigIntConvertFromString(a, (s)); \
+ TEE_BigIntConvertFromString(b, (t)); \
+ TEE_BigIntAdd(c, a, b); \
+ TB_ASSERT_HEX_PRINT_VALUE(c, (r), 0); \
+ TEE_BigIntAdd(a, a, b); \
+ TB_ASSERT_HEX_PRINT_VALUE(a, (r), 0); \
+ TEE_BigIntSub(a, a, b); \
+ TEE_BigIntAdd(b, a, b); \
+ TB_ASSERT_HEX_PRINT_VALUE(b, (r), 0); \
+} while (0)
+
+#define ADDWORD(s, t, r) \
+do { \
+ TEE_BigIntConvertFromString(a, (s)); \
+ mpa_add_word((mpanum)b, (mpanum)a, t, mempool); \
+ TB_ASSERT_HEX_PRINT_VALUE(b, (r), 0); \
+} while (0)
+
+#define SUB(r, t, s) \
+do { \
+ TEE_BigIntConvertFromString(a, (s)); \
+ TEE_BigIntConvertFromString(b, (t)); \
+ TEE_BigIntSub(c, a, b); \
+ TB_ASSERT_HEX_PRINT_VALUE(c, (r), 0); \
+ TEE_BigIntSub(a, a, b); \
+ TB_ASSERT_HEX_PRINT_VALUE(a, (r), 0); \
+ TEE_BigIntAdd(a, a, b); \
+ TEE_BigIntSub(b, a, b); \
+ TB_ASSERT_HEX_PRINT_VALUE(b, (r), 0); \
+} while (0)
+
+#define SUBWORD(r, t, s) \
+do { \
+ TEE_BigIntConvertFromString(a, (s)); \
+ mpa_sub_word((mpanum)b, (mpanum)a, t, mempool); \
+ TB_ASSERT_HEX_PRINT_VALUE(b, (r), 0); \
+} while (0)
+
+#define NEG(s, r) \
+do { \
+ TEE_BigIntConvertFromString(a, (s)); \
+ TEE_BigIntNeg(b, a); \
+ TB_ASSERT_HEX_PRINT_VALUE(b, (r), 0); \
+ TEE_BigIntConvertFromString(c, (r)); \
+ TEE_BigIntNeg(c, c); \
+ TB_ASSERT_HEX_PRINT_VALUE(c, (s), 0); \
+} while (0)
+
+void tb_addsub(void)
+{
+ const char *TEST_NAME = "Addition and Subtraction";
+
+ TB_HEADER(TEST_NAME);
+ DEF_BIGINT(a, 1024);
+ DEF_BIGINT(b, 1024);
+ DEF_BIGINT(c, 1024);
+
+ TB_INFO("Testing basic cases");
+ ADD("1", "1", "2");
+ SUB("1", "1", "2");
+ ADD("-1", "1", "0");
+ SUB("-1", "1", "0");
+ ADD("0", "0", "0");
+ SUB("0", "0", "0");
+ ADD("0", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
+ SUB("0", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
+
+ TB_INFO("Both ops positive");
+
+ /* single word, no carry */
+ ADD("FF", "FF", "1FE");
+ SUB("FF", "FF", "1FE");
+
+ /* single word, with carry */
+ ADD("FFFFFFFF", "FFFFFFFF", "1FFFFFFFE");
+ SUB("FFFFFFFF", "FFFFFFFF", "1FFFFFFFE");
+
+ /* mult word with partial carry */
+ ADD("FFFFFFFF", "100000000FFFFFFFFFFFFFFFF",
+ "10000000100000000FFFFFFFE");
+ SUB("FFFFFFFF", "100000000FFFFFFFFFFFFFFFF",
+ "10000000100000000FFFFFFFE");
+
+ /* mult word with carry all the way */
+ ADD("FFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFF", "1FFFFFFFFFFFFFFFE");
+ SUB("FFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFF", "1FFFFFFFFFFFFFFFE");
+
+ TB_INFO("Both ops negative");
+ /* single word, no carry */
+ ADD("-FF", "-FF", "-1FE");
+ SUB("-FF", "-FF", "-1FE");
+
+ /* single word, with carry */
+ ADD("-FFFFFFFF", "-FFFFFFFF", "-1FFFFFFFE");
+ SUB("-FFFFFFFF", "-FFFFFFFF", "-1FFFFFFFE");
+
+ /* mult word with partial carry */
+ ADD("-FFFFFFFF", "-100000000FFFFFFFFFFFFFFFF",
+ "-10000000100000000FFFFFFFE");
+ SUB("-FFFFFFFF", "-100000000FFFFFFFFFFFFFFFF",
+ "-10000000100000000FFFFFFFE");
+
+ /* mult word with carry */
+ ADD("-FFFFFFFFFFFFFFFF", "-FFFFFFFFFFFFFFFF", "-1FFFFFFFFFFFFFFFE");
+ SUB("-FFFFFFFFFFFFFFFF", "-FFFFFFFFFFFFFFFF", "-1FFFFFFFFFFFFFFFE");
+
+ TB_INFO("Op1 positive, op2 negative, |op1| > |op2|");
+ /* single word, no carry */
+ ADD("FFFF", "-FF", "FF00");
+ SUB("FFFF", "-FF", "FF00");
+
+ /* single word, with carry */
+ ADD("F00000000", "-00000FFFF", "EFFFF0001");
+ SUB("F00000000", "-00000FFFF", "EFFFF0001");
+
+ /* multi words with carry */
+ ADD("FFFFFFFF00000000", "-FFFFFFFF", "FFFFFFFE00000001");
+ SUB("FFFFFFFF00000000", "-FFFFFFFF", "FFFFFFFE00000001");
+ ADD("10000000FFFFFFFF00000000", "-FFFFFFFF",
+ "10000000FFFFFFFE00000001");
+ SUB("10000000FFFFFFFF00000000", "-FFFFFFFF",
+ "10000000FFFFFFFE00000001");
+ ADD("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+ "-FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE", "1");
+ SUB("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+ "-FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE", "1");
+
+ TB_INFO("Op1 positive, op2 negative, |op1| < |op2|");
+ ADD("FF", "-FFFF", "-FF00");
+ SUB("FF", "-FFFF", "-FF00");
+ ADD("FFFFFFFF", "-1FFFFFFFF", "-100000000");
+ SUB("FFFFFFFF", "-1FFFFFFFF", "-100000000");
+
+ TB_INFO("Op1 negative, op2 positive, |op1| > |op2|");
+ /* single word, no carry */
+ ADD("-FFFF", "FF", "-FF00");
+ SUB("-FFFF", "FF", "-FF00");
+
+ /* single word, with carry */
+ ADD("-F00000000", "00000FFFF", "-EFFFF0001");
+ SUB("-F00000000", "00000FFFF", "-EFFFF0001");
+
+ /* multi words with carry */
+ ADD("-FFFFFFFF00000000", "FFFFFFFF", "-FFFFFFFE00000001");
+ SUB("-FFFFFFFF00000000", "FFFFFFFF", "-FFFFFFFE00000001");
+ ADD("-10000000FFFFFFFF00000000", "FFFFFFFF",
+ "-10000000FFFFFFFE00000001");
+ SUB("-10000000FFFFFFFF00000000", "FFFFFFFF",
+ "-10000000FFFFFFFE00000001");
+ ADD("-FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE", "-1");
+ SUB("-FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE", "-1");
+
+ TB_INFO("Op1 negative, op2 positive, |op1| < |op2|");
+ ADD("-FF", "FFFF", "FF00");
+ SUB("-FF", "FFFF", "FF00");
+ ADD("-FFFFFFFF", "1FFFFFFFF", "100000000");
+ SUB("-FFFFFFFF", "1FFFFFFFF", "100000000");
+
+ TB_INFO("Testing AddWord and SubWord ");
+ ADDWORD("0", 0, "0");
+ SUBWORD("0", 0, "0");
+ ADDWORD("-1", 1, "0");
+ SUBWORD("-1", 1, "0");
+ ADDWORD("0", 0xffffffff, "FFFFFFFF");
+ SUBWORD("0", 0xffffffff, "FFFFFFFF");
+ ADDWORD("FFFFFFFFFFFFFFFF", 1, "10000000000000000");
+ SUBWORD("FFFFFFFFFFFFFFFF", 1, "10000000000000000");
+ ADDWORD("100000000FFFFFFFF", 1, "10000000100000000");
+ SUBWORD("100000000FFFFFFFF", 1, "10000000100000000");
+ ADDWORD("-FFFFFFFFFFFFFFFF", 1, "-FFFFFFFFFFFFFFFE");
+ SUBWORD("-FFFFFFFFFFFFFFFF", 1, "-FFFFFFFFFFFFFFFE");
+ ADDWORD("-100000000FFFFFFFF", 1, "-100000000FFFFFFFE");
+ SUBWORD("-100000000FFFFFFFF", 1, "-100000000FFFFFFFE");
+ ADDWORD("1", 0xffffffff, "100000000");
+ SUBWORD("1", 0xffffffff, "100000000");
+ ADDWORD("-1", 0xffffffff, "FFFFFFFE");
+ SUBWORD("-1", 0xffffffff, "FFFFFFFE");
+ ADDWORD("100", 0x10, "110");
+ SUBWORD("100", 0x10, "110");
+
+ TB_INFO("Testing Neg");
+ NEG("0", "0");
+ NEG("1", "-1");
+ NEG("123", "-123");
+ NEG("123456789123456789", "-123456789123456789");
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+ DEL_BIGINT(c);
+
+ TB_FOOTER(TEST_NAME);
+}
diff --git a/ta/os_test/tb_cmp.c b/ta/os_test/tb_cmp.c
new file mode 100644
index 0000000..d4f8145
--- /dev/null
+++ b/ta/os_test/tb_cmp.c
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "testframework.h"
+
+#include <trace.h>
+
+#define CMP_EQUAL ==
+#define CMP_LARGER >
+#define CMP_SMALLER <
+#define COMPARE(s, t, cmpf) \
+do {\
+ int __i__;\
+ TEE_BigIntConvertFromString(a, (s));\
+ TEE_BigIntConvertFromString(b, (t));\
+ __i__ = TEE_BigIntCmp(a, b);\
+ if (!(__i__ cmpf 0)) {\
+ EMSG("Assertion failed Str_Cmp == %d\n", __i__);\
+ HALT\
+ } \
+} while (0)
+
+#define NR_RAND_RUNS 1000
+
+static void test_compare(void)
+{
+ char str[MAX_RAND_STRING_SIZE];
+ char str2[MAX_RAND_STRING_SIZE];
+ int i;
+
+ TB_INFO("Testing TEE_BigIntCompare");
+
+ DEF_BIGINT(a, 2048);
+ DEF_BIGINT(b, 2048);
+
+ TB_INFO(" Testing various cases");
+ COMPARE("0", "1", CMP_SMALLER);
+ COMPARE("1", "0", CMP_LARGER);
+ COMPARE("1", "2", CMP_SMALLER);
+ COMPARE("2", "1", CMP_LARGER);
+ COMPARE("-1", "FFFFFFFFFF", CMP_SMALLER);
+ COMPARE("FFFFFFFFFF", "-1", CMP_LARGER);
+ COMPARE("1", "-FFFFFFFFFF", CMP_LARGER);
+ COMPARE("-FFFFFFFFFF", "1", CMP_SMALLER);
+ COMPARE("1", "100000000", CMP_SMALLER);
+
+ TB_INFO(" Testing equality");
+ COMPARE("0", "0", CMP_EQUAL);
+ COMPARE("1", "1", CMP_EQUAL);
+ COMPARE("-1", "-1", CMP_EQUAL);
+ for (i = 0; i < NR_RAND_RUNS; i++) {
+ tb_get_random_str(str, 1);
+ COMPARE(str, str, CMP_EQUAL);
+ }
+
+ TB_INFO(" Testing equal magnitude, but different signs");
+ for (i = 0; i < NR_RAND_RUNS; i++) {
+ tb_get_random_str(str, 0);
+ if (my_strlen(str) > 2) {
+ my_strlcpy(str2, str, MAX_RAND_STRING_SIZE);
+ str[0] = '0';
+ str2[0] = '-';
+ COMPARE(str, str2, CMP_LARGER);
+ COMPARE(str2, str, CMP_SMALLER);
+ }
+ }
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+}
+
+#define COMPARE_SHORT(s, t, cmpf) \
+do {\
+ int __i__;\
+ TEE_BigIntConvertFromString(a, (s));\
+ __i__ = TEE_BigIntCmpS32(a, t);\
+ if (!(__i__ cmpf 0)) {\
+ EMSG("Assertion failed Str_Cmp == %d\n", __i__);\
+ HALT\
+ } \
+} while (0)
+
+static void test_compare_short(void)
+{
+
+ TB_INFO("Testing TEE_BigIntCmpS32");
+
+ DEF_BIGINT(a, 2048);
+
+ TB_INFO(" Testing various cases");
+ COMPARE_SHORT("0", 0, CMP_EQUAL);
+ COMPARE_SHORT("0", 1, CMP_SMALLER);
+ COMPARE_SHORT("1", 0, CMP_LARGER);
+ COMPARE_SHORT("0", -1, CMP_LARGER);
+ COMPARE_SHORT("-1", 0, CMP_SMALLER);
+ COMPARE_SHORT("1", 1, CMP_EQUAL);
+ COMPARE_SHORT("-1", -1, CMP_EQUAL);
+ COMPARE_SHORT("-1", 1, CMP_SMALLER);
+ COMPARE_SHORT("1", -1, CMP_LARGER);
+ COMPARE_SHORT("123", 0x123, CMP_EQUAL);
+ COMPARE_SHORT("-123", -0x123, CMP_EQUAL);
+
+ /* testing corner case */
+ COMPARE_SHORT("7FFFFFFF", INT32_MAX, CMP_EQUAL);
+ COMPARE_SHORT("-7FFFFFFF", INT32_MIN, CMP_LARGER);
+ COMPARE_SHORT("7FFFFFFF", 0, CMP_LARGER);
+ COMPARE_SHORT("-7FFFFFFF", 0, CMP_SMALLER);
+ COMPARE_SHORT("-80000000", INT32_MIN, CMP_EQUAL);
+ COMPARE_SHORT("80000000", INT32_MAX, CMP_LARGER);
+ COMPARE_SHORT("-80000001", INT32_MIN, CMP_SMALLER);
+ COMPARE_SHORT("-7FFFFFFF", INT32_MIN, CMP_LARGER);
+
+ TB_INFO(" Testing large BigInt");
+ COMPARE_SHORT("1FFFFFFFF", 1, CMP_LARGER);
+ COMPARE_SHORT("-1FFFFFFFF", 1, CMP_SMALLER);
+
+ DEL_BIGINT(a);
+
+}
+
+void tb_cmp(void)
+{
+ const char *TEST_NAME = "Comparison functions";
+
+ TB_HEADER(TEST_NAME);
+
+ test_compare();
+ test_compare_short();
+
+ TB_FOOTER(TEST_NAME);
+}
diff --git a/ta/os_test/tb_conv.c b/ta/os_test/tb_conv.c
new file mode 100644
index 0000000..15e6c55
--- /dev/null
+++ b/ta/os_test/tb_conv.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+#include "testframework.h"
+
+#define getsettest(bigint, _short) \
+do { \
+ int32_t bi = 0; \
+ TEE_Result result; \
+ TEE_BigIntConvertFromS32((bigint), (_short)); \
+ TB_ASSERT_EQ_SHORT((bigint), (_short)); \
+ result = TEE_BigIntConvertToS32(&bi, (bigint)); \
+ TB_ASSERT_MSG(result == TEE_SUCCESS, "Failed getting short\n"); \
+ TB_ASSERT_INT_EQ(bi, (_short)); \
+} while (0)
+
+static void test_BigInt_getsetShort(void)
+{
+ int32_t b;
+ TEE_Result res;
+
+ TB_INFO("Testing GetShort and SetShort");
+
+ DEF_BIGINT(a, 512);
+
+ getsettest(a, 1);
+ getsettest(a, -1);
+ getsettest(a, 123);
+ getsettest(a, -123);
+ getsettest(a, 0x7FFFFFFF);
+ getsettest(a, (int)0x80000000);
+ getsettest(a, (int)0xFFFFFFFF);
+ getsettest(a, 0);
+
+ /* Testing too large BigInt */
+ TEE_BigIntConvertFromString(a, "0x1FFFFFFFFF");
+ res = TEE_BigIntConvertToS32(&b, a);
+ TB_ASSERT(res == TEE_ERROR_OVERFLOW);
+
+ mpa_wipe((mpanum) a);
+
+ TEE_BigIntConvertFromString(a, "-0x1FFFFFFFFF");
+ res = TEE_BigIntConvertToS32(&b, a);
+ TB_ASSERT(res == TEE_ERROR_OVERFLOW);
+
+ DEL_BIGINT(a);
+
+}
+
+static void test_BigInt_getsetOctetString(void)
+{
+ const uint8_t os1[] = { 1, 2, 3, 4 };
+ const uint8_t os2[] = { 1, 2, 3, 4, 5 };
+ const uint8_t os3[] = { 0, 1, 2, 3, 4 };
+ const uint8_t os4[] = { 0x11, 0x22, 0x44, 0x55, 0x66, 0x77, 0x88 };
+ uint8_t os_res[10];
+ TEE_Result res;
+ size_t os_len;
+
+ DEF_BIGINT(a, 512);
+ DEF_BIGINT(b, 512);
+
+ TB_INFO("Testing Convert to and from OctetString");
+
+ /* Test with 0x0102030405 */
+ TEE_BigIntConvertFromString(a, "0x0102030405");
+ os_len = sizeof(os_res);
+ res = TEE_BigIntConvertToOctetString(os_res, &os_len, a);
+ TB_ASSERT(res == TEE_SUCCESS);
+ TB_ASSERT(sizeof(os2) == os_len
+ && TEE_MemCompare(os2, os_res, sizeof(os2)) == 0);
+
+ res = TEE_BigIntConvertFromOctetString(b, os_res, os_len, 1);
+ TB_ASSERT(res == TEE_SUCCESS);
+ TB_ASSERT(TEE_BigIntCmp(a, b) == 0);
+
+ /* Test with 0x11224455667788 */
+ TEE_BigIntConvertFromString(a, "0x11224455667788");
+ os_len = sizeof(os_res);
+ res = TEE_BigIntConvertToOctetString(os_res, &os_len, a);
+ TB_ASSERT(res == TEE_SUCCESS);
+ TB_ASSERT(sizeof(os4) == os_len
+ && TEE_MemCompare(os4, os_res, sizeof(os4)) == 0);
+
+ res = TEE_BigIntConvertFromOctetString(b, os_res, os_len, 1);
+ TB_ASSERT(res == TEE_SUCCESS);
+ TB_ASSERT(TEE_BigIntCmp(a, b) == 0);
+
+ /* Test with static octet strings */
+ res = TEE_BigIntConvertFromOctetString(a, os1, sizeof(os1), 1);
+ TB_ASSERT(res == TEE_SUCCESS);
+
+ os_len = sizeof(os_res);
+ res = TEE_BigIntConvertToOctetString(os_res, &os_len, a);
+ TB_ASSERT(res == TEE_SUCCESS);
+ TB_ASSERT(sizeof(os1) == os_len
+ && TEE_MemCompare(os1, os_res, sizeof(os1)) == 0);
+
+ res = TEE_BigIntConvertFromOctetString(b, os3, sizeof(os3), 1);
+ TB_ASSERT(res == TEE_SUCCESS);
+ TB_ASSERT(TEE_BigIntCmp(a, b) == 0);
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+}
+
+void tb_conv(void)
+{
+ const char *TEST_NAME = "Conversion functions";
+
+ TB_HEADER(TEST_NAME);
+
+ test_BigInt_getsetShort();
+ test_BigInt_getsetOctetString();
+
+ TB_FOOTER(TEST_NAME);
+
+}
diff --git a/ta/os_test/tb_div.c b/ta/os_test/tb_div.c
new file mode 100644
index 0000000..2726fa1
--- /dev/null
+++ b/ta/os_test/tb_div.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "testframework.h"
+
+#define DIV(s, t, out) \
+do { \
+ TEE_BigIntConvertFromString(n, (s)); \
+ TEE_BigIntConvertFromString(d, (t)); \
+ TEE_BigIntDiv(q, r, n, d); \
+ TB_ASSERT_HEX_PRINT_VALUE(q, (out), 0); \
+ if (TEE_BigIntCmpS32(d, 0) > 0) \
+ TB_ASSERT_BIGINT_LESS(r, d); \
+} while (0)
+
+#define SELF_VERIFY_DIV(s, t) \
+do { \
+ TEE_BigIntConvertFromString(n, (s)); \
+ TEE_BigIntConvertFromString(d, (t)); \
+ TEE_BigIntDiv(q, r, n, d); \
+ if (TEE_BigIntCmpS32(d, 0) > 0) \
+ TB_ASSERT_BIGINT_LESS(r, d); \
+ TEE_BigIntMul(v, q, d); \
+ TEE_BigIntAdd(v, v, r); \
+ TB_ASSERT_BIGINT_EQ(n, v); \
+} while (0)
+
+static void test_div_basic(void)
+{
+ TB_INFO(" Testing basic cases");
+
+ DEF_BIGINT(n, 2048);
+ DEF_BIGINT(d, 2048);
+ DEF_BIGINT(q, 2048);
+ DEF_BIGINT(r, 2048);
+ DEF_BIGINT(v, 2048);
+
+ SELF_VERIFY_DIV("8111_1110_0000_0001_12345678", "8000000012345678");
+
+ DIV("0", "1", "0");
+ DIV("1", "1", "1");
+ DIV("b7fb", "5", "24CB");
+ DIV("124378912734891273894712890347102358129034789120374",
+ "1984086C15FA011154C86FA68", "B73D14EC7205D3311F6E78411D");
+ SELF_VERIFY_DIV("124378912734891273894712890347102358129034789120374",
+ "1984086C15FA011154C86FA68");
+ SELF_VERIFY_DIV("-124378912734891273894712890347102358129034789120374",
+ "1984086C15FA011154C86FA68");
+ SELF_VERIFY_DIV("124378912734891273894712890347102358129034789120374",
+ "-1984086C15FA011154C86FA68");
+ SELF_VERIFY_DIV("-124378912734891273894712890347102358129034789120374",
+ "-1984086C15FA011154C86FA68");
+ SELF_VERIFY_DIV("12345678", "10");
+ SELF_VERIFY_DIV("-12345678", "10");
+ SELF_VERIFY_DIV("12345678", "-10");
+ SELF_VERIFY_DIV("-12345678", "-10");
+ SELF_VERIFY_DIV("12345678901234567890123456789012345678901", "10");
+ SELF_VERIFY_DIV("1234567890123456789012345678901234567890", "10");
+ SELF_VERIFY_DIV("123456789012345678901234567890123456789", "10");
+
+ DEL_BIGINT(n);
+ DEL_BIGINT(d);
+ DEL_BIGINT(q);
+ DEL_BIGINT(r);
+ DEL_BIGINT(v);
+}
+
+static void test_div_random(void)
+{
+ int i;
+ char str[MAX_RAND_STRING_SIZE];
+
+ TB_INFO(" Testing random divisions");
+
+ DEF_BIGINT(n, 2048);
+ DEF_BIGINT(d, 2048);
+ DEF_BIGINT(q, 2048);
+ DEF_BIGINT(r, 2048);
+ DEF_BIGINT(v, 2048);
+
+ for (i = 0; i < 10000; i++) {
+ tb_set_random_value(n, str, 1);
+ /* don't divide by zero */
+ do {
+ tb_set_random_value(d, str, 1);
+ } while (TEE_BigIntCmpS32(d, 0) == 0);
+ TEE_BigIntDiv(q, r, n, d);
+ TEE_BigIntMul(v, q, d);
+ TEE_BigIntAdd(v, v, r);
+ TB_ASSERT_BIGINT_EQ(n, v);
+ if (TEE_BigIntCmpS32(d, 0) > 0)
+ TB_ASSERT_BIGINT_LESS(r, d);
+
+ }
+
+ DEL_BIGINT(n);
+ DEL_BIGINT(d);
+ DEL_BIGINT(q);
+ DEL_BIGINT(r);
+ DEL_BIGINT(v);
+}
+
+#define CMP_EQUAL ==
+#define CMP_LARGER >
+#define CMP_SMALLER <
+#define DIV_CHECK_SIGN(sn, sd, cmpq, cmpr) \
+do {\
+ SELF_VERIFY_DIV(sn, sd); \
+ TEE_BigIntConvertFromString(n, (sn)); \
+ TEE_BigIntConvertFromString(d, (sd)); \
+ TEE_BigIntDiv(q, r, n, d); \
+ TB_ASSERT_MSG(TEE_BigIntCmpS32(q, 0) cmpq 0, "q has wrong sign."); \
+ TB_ASSERT_MSG(TEE_BigIntCmpS32(r, 0) cmpr 0, "r has wrong sign."); \
+} while (0)
+
+static void test_div_signs(void)
+{
+ TB_INFO(" Testing signs of q and r");
+
+ DEF_BIGINT(n, 2048);
+ DEF_BIGINT(d, 2048);
+ DEF_BIGINT(q, 2048);
+ DEF_BIGINT(r, 2048);
+ DEF_BIGINT(v, 2048);
+
+ DIV_CHECK_SIGN("53", "7", CMP_LARGER, CMP_LARGER);
+ DIV_CHECK_SIGN("-53", "7", CMP_SMALLER, CMP_SMALLER);
+ DIV_CHECK_SIGN("53", "-7", CMP_SMALLER, CMP_LARGER);
+ DIV_CHECK_SIGN("-53", "-7", CMP_LARGER, CMP_SMALLER);
+
+ DIV_CHECK_SIGN("123456789abcdef123456789abcdef", "fedcba98765432100",
+ CMP_LARGER, CMP_LARGER);
+ DIV_CHECK_SIGN("-123456789abcdef123456789abcdef", "fedcba98765432100",
+ CMP_SMALLER, CMP_SMALLER);
+ DIV_CHECK_SIGN("123456789abcdef123456789abcdef", "-fedcba98765432100",
+ CMP_SMALLER, CMP_LARGER);
+ DIV_CHECK_SIGN("-123456789abcdef123456789abcdef", "-fedcba98765432100",
+ CMP_LARGER, CMP_SMALLER);
+
+ DEL_BIGINT(n);
+ DEL_BIGINT(d);
+ DEL_BIGINT(q);
+ DEL_BIGINT(r);
+ DEL_BIGINT(v);
+}
+
+void tb_div(void)
+{
+ const char *TEST_NAME = "Division";
+
+ TB_HEADER(TEST_NAME);
+
+ test_div_basic();
+ test_div_random();
+ test_div_signs();
+
+ TB_FOOTER(TEST_NAME);
+}
diff --git a/ta/os_test/tb_fmm.c b/ta/os_test/tb_fmm.c
new file mode 100644
index 0000000..c04a295
--- /dev/null
+++ b/ta/os_test/tb_fmm.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "testframework.h"
+
+#define MOD_EXP_TEST \
+do { \
+ TEE_BigIntConvertFromString(n, nstr); \
+ nLen = TEE_BigIntFMMContextSizeInU32(nbitsize); \
+ context = (TEE_BigIntFMMContext *) \
+ TEE_Malloc(nLen * sizeof(TEE_BigIntFMMContext), 0); \
+ TEE_BigIntInitFMMContext(context, nLen, n); \
+ TEE_BigIntConvertFromString(x, xstr); \
+ TEE_BigIntConvertFromString(e, estr); \
+ TB_ASSERT_HEX_PRINT_VALUE(dest, resstr, 0); \
+ TEE_Free(context); \
+} while (0)
+
+static void test_modexp(void)
+{
+ TEE_BigIntFMMContext *context;
+ size_t nLen;
+ const char *nstr;
+ const char *xstr;
+ const char *estr;
+ const char *resstr;
+ int nbitsize;
+
+ TB_INFO(" Testing modular exponentiation");
+
+ DEF_BIGINT(dest, 2048);
+ DEF_BIGINT(x, 2048);
+ DEF_BIGINT(e, 2048);
+ DEF_BIGINT(n, 2048);
+
+ nstr = "2C8D59AF47C81AB3725B472BE417E3BF"
+ "7AB85439AF726ED3DFDF66489D155DC0"
+ "B771C7A50EF7C5E58FB";
+ nbitsize = 330;
+ xstr = "18EE90FF6C373E0EE4E3F0AD2";
+ estr = "AB54A98CEB1F0AD2";
+
+ resstr = "23F455C413C2F037A8A1D06CCFD007BE"
+ "021ABEEE4CE522990A67C65CA94922BD"
+ "822218A79BE6A0AB00C";
+
+ MOD_EXP_TEST;
+
+ nstr = "FFF1FFF1";
+ nbitsize = 33;
+ xstr = "ABCDEF";
+ estr = "1234567";
+ resstr = "E9D974C2";
+ MOD_EXP_TEST;
+
+ nstr = "C7970CEEDCC3B0754490201A7AA613CD"
+ "73911081C790F5F1A8726F463550BB5B"
+ "7FF0DB8E1EA1189EC72F93D1650011BD"
+ "721AEEACC2ACDE32A04107F0648C2813"
+ "A31F5B0B7765FF8B44B4B6FFC93384B6"
+ "46EB09C7CF5E8592D40EA33C80039F35"
+ "B4F14A04B51F7BFD781BE4D1673164BA"
+ "8EB991C2C4D730BBBE35F592BDEF524A"
+ "F7E8DAEFD26C66FC02C479AF89D64D37"
+ "3F442709439DE66CEB955F3EA37D5159"
+ "F6135809F85334B5CB1813ADDC80CD05"
+ "609F10AC6A95AD65872C909525BDAD32"
+ "BC729592642920F24C61DC5B3C3B7923"
+ "E56B16A4D9D373D8721F24A3FC0F1B31"
+ "31F55615172866BCCC30F95054C824E7"
+ "33A5EB6817F7BC16399D48C6361CC7E5";
+ nbitsize = 2048;
+ xstr = "63CB86776E61D83AA248100D3D5309E6"
+ "B9C88840E3C87AF8D43937A31AA85DAD"
+ "BFF86DC70F508C4F6397C9E8B28008DE"
+ "B90D775661566F19502083F832461409"
+ "D18FAD85BBB2FFC5A25A5B7FE499C25B"
+ "237584E3E7AF42C96A07519E4001CF9A"
+ "DA78A5025A8FBDFEBC0DF268B398B25D"
+ "475CC8E1626B985DDF1AFAC95EF7A925"
+ "7BF46D77E936337E01623CD7C4EB269B"
+ "9FA21384A1CEF33675CAAF9F51BEA8AC"
+ "FB09AC04FC299A5AE58C09D6EE406682"
+ "B04F8856354AD6B2C396484A92DED699"
+ "5E394AC9321490792630EE2D9E1DBC91"
+ "F2B58B526CE9B9EC390F9251FE078D98"
+ "98FAAB0A8B94335E66187CA82A641273"
+ "99D2F5B40BFBDE0B1CCEA4631B0E63F3";
+
+ estr = "31E5C33BB730EC1D512408069EA984F3"
+ "5CE4442071E43D7C6A1C9BD18D542ED6"
+ "DFFC36E387A84627B1CBE4F45940046F"
+ "5C86BBAB30AB378CA81041FC19230A04"
+ "E8C7D6C2DDD97FE2D12D2DBFF24CE12D"
+ "91BAC271F3D7A164B503A8CF2000E7CD"
+ "6D3C52812D47DEFF5E06F93459CC592E"
+ "A3AE6470B135CC2EEF8D7D64AF7BD492"
+ "BDFA36BBF49B19BF00B11E6BE275934D"
+ "CFD109C250E7799B3AE557CFA8DF5456"
+ "7D84D6027E14CD2D72C604EB77203341"
+ "5827C42B1AA56B5961CB2425496F6B4C"
+ "AF1CA564990A483C93187716CF0EDE48"
+ "F95AC5A93674DCF61C87C928FF03C6CC"
+ "4C7D558545CA19AF330C3E5415320939"
+ "CCE97ADA05FDEF058E6752318D8731FA";
+
+ resstr = "4F7CAEC2D0663A719DC73CF51030906D"
+ "320E9B7AB19AAAF887EFA16E1A92C829"
+ "D7AC7F984E792C94955EFDE31E97E716"
+ "3D9193D3F4A4656EF94C3202DC84D499"
+ "5D25EC33C5284635285639E7B59EB92C"
+ "CA883348AE1F5B78098B0DE87C718CF0"
+ "AA7BE51623A57C1DD8BD1B72E9F0FD17"
+ "98085A5E100810C740C45DB79D391F48"
+ "8BC4ACB3F3C24D5948A994637FF4593B"
+ "7FA8D07F88649EFEED2840EAC47248B6"
+ "5BD3A09A923065A0BDA0EBEB6340AAE1"
+ "08701FEB85811D628467A8D2CCC2D888"
+ "5DE807D0CF65B254B3435E9F844AA86F"
+ "3795ACC2EF71DE64F55EBC638B88B964"
+ "E5C2D55F8F7E3F00B0FC86C19C6AF1EA"
+ "B5CC45E90D7464BA230298F660DDE812";
+ MOD_EXP_TEST;
+
+ nstr = "000000022770A7DC599BC90B2FF981CCB5CF05703344C8F3504189ED";
+ nbitsize = 2048;
+ xstr = "000000020BCFDDA4E89FE86AAC303CB3D767FE66627C797794403831";
+ estr = "89DC29F71666F242CBFE60732D73C15C0CD1323CD410627B";
+ resstr = "7202419F1301F56B6D0BF9F287D49061F6F378426A78533F";
+ MOD_EXP_TEST;
+
+ nstr = "00000002_2770A7DC_599BC90B_2FF981CC_B5CF0570_3344C8F3_50418AAD";
+ nbitsize = 2048;
+ xstr = "00000001_8D359BB6_4F9B75A9_357C8215_E1E4D5F1_764D016C_F0130738";
+ estr = "89DC29F7_1666F242_CBFE6073_2D73C15C_0CD1323C_D41062AB";
+ resstr = "1";
+ MOD_EXP_TEST;
+
+ DEL_BIGINT(dest);
+ DEL_BIGINT(x);
+ DEL_BIGINT(e);
+ DEL_BIGINT(n);
+}
+
+void tb_fmm(void)
+{
+ const char *TEST_NAME = "Fast Modular Multiplication";
+
+ TB_HEADER(TEST_NAME);
+ test_modexp();
+ TB_FOOTER(TEST_NAME);
+}
diff --git a/ta/os_test/tb_gcd.c b/ta/os_test/tb_gcd.c
new file mode 100644
index 0000000..83d8807
--- /dev/null
+++ b/ta/os_test/tb_gcd.c
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "testframework.h"
+
+/*
+ * Remove the #undef if you like debug print outs and assertions for this file.
+ */
+#undef DEBUG_ME
+#include "mpa_debug.h"
+#include "mpa_assert.h"
+
+#define TEST_GCD(stra, strb) \
+do { \
+ TEE_BigIntConvertFromString(x, stra); \
+ TEE_BigIntConvertFromString(y, strb); \
+} while (0)
+
+static void test_extended_gcd_basic(void)
+{
+ DEF_BIGINT(x, 2048);
+ DEF_BIGINT(y, 2048);
+ DEF_BIGINT(a, 2048);
+ DEF_BIGINT(b, 2048);
+ DEF_BIGINT(gcd, 2048);
+
+ TB_INFO(" Testing extended GCD");
+
+ TEST_GCD("0", "0");
+ TEST_GCD("0", "123");
+ TEST_GCD("1", "1");
+ TEST_GCD("1", "-1");
+ TEST_GCD("2", "2");
+ TEST_GCD("-2", "2");
+ TEST_GCD("2", "4");
+ TEST_GCD("-2", "-4");
+ TEST_GCD("0x400", "0x800");
+
+ TEST_GCD("0x261", "0x2B5");
+ TEST_GCD("F", "A");
+ TEST_GCD("C", "13");
+ TEST_GCD("0x165D662", "0x1664FEA");
+
+ TEST_GCD("0xAB59CDFD83CE2B24",
+ "0x4961BF04008953A7F9567AAFBA94D4AF55F473F14FD68AA022982F0FE");
+
+ /* two large primes */
+ TEST_GCD("0x5D0A380DC40EDE5E036FA051FC6D7F93",
+ "0x3277FD425328576569AFB2EAC6B1430578099CA8ADA4BC73");
+
+ /* two large powers of 2 */
+ TEST_GCD
+ ("0x2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "0x40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
+
+ DEL_BIGINT(x);
+ DEL_BIGINT(y);
+ DEL_BIGINT(b);
+ DEL_BIGINT(a);
+ DEL_BIGINT(gcd);
+}
+
+static void test_extended_gcd_special(void)
+{
+ DEF_BIGINT(x, 2048);
+ DEF_BIGINT(y, 2048);
+ DEF_BIGINT(a, 2048);
+ DEF_BIGINT(b, 2048);
+ DEF_BIGINT(gcd, 2048);
+ DEF_BIGINT(tmp1, 2048);
+ DEF_BIGINT(tmp2, 2048);
+
+ TB_INFO(" Testing special cases of extended GCD");
+
+ /* both a and b are zero */
+ TEE_BigIntConvertFromString(x, "0x7B");
+ TEE_BigIntConvertFromString(y, "0x57677928C");
+ TEE_BigIntComputeExtendedGcd(gcd, 0, 0, x, y);
+ TB_ASSERT_BIGINT_EQ(tmp1, gcd);
+
+ /* only a is zero */
+ TEE_BigIntConvertFromString(x, "0xAB05C2E2A7870B12");
+ TEE_BigIntConvertFromString(y, "0x943B1377291233F7928C");
+ TEE_BigIntComputeExtendedGcd(gcd, 0, b, x, y);
+ TB_ASSERT_BIGINT_EQ(tmp1, gcd);
+
+ /* only b is zero */
+ TEE_BigIntConvertFromString(x, "0x13EF245EE37410377D5432D96");
+ TEE_BigIntConvertFromString(y, "0xAB621806355B60955F1C89BC2CF365");
+ TEE_BigIntComputeExtendedGcd(gcd, a, 0, x, y);
+
+ TB_ASSERT_BIGINT_EQ(tmp1, gcd);
+
+ DEL_BIGINT(x);
+ DEL_BIGINT(y);
+ DEL_BIGINT(b);
+ DEL_BIGINT(a);
+ DEL_BIGINT(gcd);
+ DEL_BIGINT(tmp1);
+ DEL_BIGINT(tmp2);
+}
+
+static void test_relative_prime(void)
+{
+ bool res;
+
+ DEF_BIGINT(x, 2048);
+ DEF_BIGINT(y, 2048);
+
+ TB_INFO(" Testing relative prime function");
+
+ TEE_BigIntConvertFromString(x, "0x7B");
+ TEE_BigIntConvertFromString(y, "0x57677928C");
+ res = TEE_BigIntRelativePrime(x, y);
+ ASSERT(res == false, "Those numbers are not relatively prime");
+
+ TEE_BigIntConvertFromString(x, "0x157");
+ TEE_BigIntConvertFromString(y, "0x5F5E1");
+ res = TEE_BigIntRelativePrime(x, y);
+ ASSERT(res == true, "Those numbers are relatively prime");
+
+ TEE_BigIntConvertFromString(x, "0x2FD4ABD35311DC9884CFCBDC1");
+ TEE_BigIntConvertFromString(y, "0x12E0B94A7ED49AA36A982ADCBDE813");
+ res = TEE_BigIntRelativePrime(x, y);
+ ASSERT(res == true, "Those numbers are relatively prime");
+
+ DEL_BIGINT(x);
+ DEL_BIGINT(y);
+}
+
+void tb_gcd(void)
+{
+ const char *TEST_NAME = "GCD and Extended GCD";
+
+ TB_HEADER(TEST_NAME);
+
+ test_extended_gcd_basic();
+ test_extended_gcd_special();
+ test_relative_prime();
+
+ TB_FOOTER(TEST_NAME);
+}
diff --git a/ta/os_test/tb_io.c b/ta/os_test/tb_io.c
new file mode 100644
index 0000000..029ac47
--- /dev/null
+++ b/ta/os_test/tb_io.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "testframework.h"
+
+size_t my_strlen(const char *string)
+{
+ size_t len = 0;
+
+ while (*string++)
+ len++;
+ return len;
+}
+
+int my_strcmp(const char *s1, const char *s2)
+{
+ while (*s1 != '\0' && *s1 == *s2) {
+ s1++;
+ s2++;
+ }
+ return (*(unsigned char *)s1) - (*(unsigned char *)s2);
+}
+
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t my_strlcpy(char *dst, const char *src, size_t siz)
+{
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
+ register char tmp;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0 && --n != 0) {
+ do {
+ tmp = *d++ = *s++;
+ if (tmp == 0)
+ break;
+ } while (--n != 0);
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0) {
+ if (siz != 0)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
+ ;
+ }
+
+ return s - src - 1; /* count does not include NUL */
+}
diff --git a/ta/os_test/tb_modulus.c b/ta/os_test/tb_modulus.c
new file mode 100644
index 0000000..2a90a0d
--- /dev/null
+++ b/ta/os_test/tb_modulus.c
@@ -0,0 +1,477 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "testframework.h"
+
+#define MOD_RED(opstr, nstr, resstr) \
+do { \
+ TEE_BigIntConvertFromString(op, opstr); \
+ TEE_BigIntConvertFromString(n, nstr); \
+ TEE_BigIntMod(r, op, n); \
+ TB_ASSERT_HEX_PRINT_VALUE(r, resstr, 0); \
+} while (0)
+
+static void test_modular_reduction(void)
+{
+ TB_INFO(" Testing modular reduction");
+
+ DEF_BIGINT(op, 2048);
+ DEF_BIGINT(n, 2048);
+ DEF_BIGINT(r, 2048);
+
+ MOD_RED("10", "A", "6");
+ MOD_RED("10", "20", "10");
+ MOD_RED("-1", "123", "122");
+ MOD_RED("-122", "123", "1");
+ MOD_RED("-1", "1_0000_0000_0000_0000_0000", "FFFFFFFFFFFFFFFFFFFF");
+
+ MOD_RED("42176E7CD0386C94194C3C3DACFA7237"
+ "CCF4E0829E2EBEAB59DE12CAE3305C9E"
+ "576F837A42D9C13BB1D83E4DFD330B65"
+ "76FD516B2AE9FBDD152F0A820C5DD18E"
+ "D048D476EC791DC989D6D8C30B2B30FF"
+ "C2A4ABAC082C672B38E138610B74CE0C"
+ "30D1B378BE6FE0C44E09EC11586245CD"
+ "8F1216619392E6B2C857C71EA78DD4D8"
+ "61A482D9D1251C341D1D6205AFB2BFB5"
+ "3DD1F272B5624FA61B020936745387CD"
+ "F1F3EBC4435CBE6C6B323497098FDE9D"
+ "61AA0CC87416235E706A71F73EC3C291"
+ "D9ACA2EECD712DA40966DD251310AE94"
+ "9713F69B2A32E42732A7F6669547D88A"
+ "415B25C582FDBBF06C5EC5F5750053D4"
+ "9F7ED68DED168C92F9C531828A",
+ "A9A9C49F0015DBEF9EB0D927F379821AE2C59",
+ "3460EB99F07BC4617A7586E6522B98F66E5B2");
+
+ MOD_RED("42176E7CD0386C94194C3C3DACFA7237"
+ "CCF4E0829E2EBEAB59DE12CAE3305C9E"
+ "576F837A42D9C13BB1D83E4DFD330B65"
+ "76FD516B2AE9FBDD152F0A820C5DD18E"
+ "D048D476EC791DC989D6D8C30B2B30FF"
+ "C2A4ABAC082C672B38E138610B74CE0C"
+ "30D1B378BE6FE0C44E09EC11586245CD"
+ "8F1216619392E6B2C857C71EA78DD4D8"
+ "61A482D9D1251C341D1D6205AFB2BFB5"
+ "3DD1F272B5624FA61B020936745387CD"
+ "F1F3EBC4435CBE6C6B323497098FDE9D"
+ "61AA0CC87416235E706A71F73EC3C291"
+ "D9ACA2EECD712DA40966DD251310AE94"
+ "9713F69B2A32E42732A7F6669547D88A"
+ "415B25C582FDBBF06C5EC5F5750053D4"
+ "9F7ED68DED168C92F9C531828A",
+ "1234", "1082");
+
+ MOD_RED("FFFF6E7CD0386C94194C3C3DACFA7237"
+ "CCF4E0829E2EBEAB59DE12CAE3305C9E"
+ "576F837A42D9C13BB1D83E4DFD330B65"
+ "76FD516B2AE9FBDD152F0A820C5DD18E"
+ "D048D476EC791DC989D6D8C30B2B30FF"
+ "C2A4ABAC082C672B38E138610B74CE0C"
+ "30D1B378BE6FE0C44E09EC11586245CD"
+ "8F1216619392E6B2C857C71EA78DD4D8"
+ "61A482D9D1251C341D1D6205AFB2BFB5"
+ "3DD1F272B5624FA61B020936745387CD"
+ "F1F3EBC4435CBE6C6B323497098FDE9D"
+ "61AA0CC87416235E706A71F73EC3C291"
+ "D9ACA2EECD712DA40966DD251310AE94"
+ "9713F69B2A32E42732A7F6669547D88A"
+ "415B25C582FDBBF06C5EC5F5750053D4"
+ "9F7ED68DED168C92F9C531828A",
+ "2", "0");
+
+ MOD_RED("FFFF6E7CD0386C94194C3C3DACFA7237"
+ "CCF4E0829E2EBEAB59DE12CAE3305C9E"
+ "576F837A42D9C13BB1D83E4DFD330B65"
+ "76FD516B2AE9FBDD152F0A820C5DD18E"
+ "D048D476EC791DC989D6D8C30B2B30FF"
+ "C2A4ABAC082C672B38E138610B74CE0C"
+ "30D1B378BE6FE0C44E09EC11586245CD"
+ "8F1216619392E6B2C857C71EA78DD4D8"
+ "61A482D9D1251C341D1D6205AFB2BFB5"
+ "3DD1F272B5624FA61B020936745387CD"
+ "F1F3EBC4435CBE6C6B323497098FDE9D"
+ "61AA0CC87416235E706A71F73EC3C291"
+ "D9ACA2EECD712DA40966DD251310AE94"
+ "9713F69B2A32E42732A7F6669547D88A"
+ "415B25C582FDBBF06C5EC5F5750053D4"
+ "9F7ED68DED168C92F9C531828A",
+ "FFFF6E7CD0386C94194C3C3DACFA7237"
+ "CCF4E0829E2EBEAB59DE12CAE3305C9E"
+ "576F837A42D9C13BB1D83E4DFD330B65"
+ "76FD516B2AE9FBDD152F0A820C5DD18E"
+ "D048D476EC791DC989D6D8C30B2B30FF"
+ "C2A4ABAC082C672B38E138610B74CE0C"
+ "30D1B378BE6FE0C44E09EC11586245CD"
+ "8F1216619392E6B2C857C71EA78DD4D8"
+ "61A482D9D1251C341D1D6205AFB2BFB5"
+ "3DD1F272B5624FA61B020936745387CD"
+ "F1F3EBC4435CBE6C6B323497098FDE9D"
+ "61AA0CC87416235E706A71F73EC3C291"
+ "D9ACA2EECD712DA40966DD251310AE94"
+ "9713F69B2A32E42732A7F6669547D88A"
+ "415B25C582FDBBF06C5EC5F5750053D4"
+ "9F7ED68DED168C92F9C531828A",
+ "0");
+
+ MOD_RED("FFFF6E7CD0386C94194C3C3DACFA7237"
+ "CCF4E0829E2EBEAB59DE12CAE3305C9E"
+ "576F837A42D9C13BB1D83E4DFD330B65"
+ "76FD516B2AE9FBDD152F0A820C5DD18E"
+ "D048D476EC791DC989D6D8C30B2B30FF"
+ "C2A4ABAC082C672B38E138610B74CE0C"
+ "30D1B378BE6FE0C44E09EC11586245CD"
+ "8F1216619392E6B2C857C71EA78DD4D8"
+ "61A482D9D1251C341D1D6205AFB2BFB5"
+ "3DD1F272B5624FA61B020936745387CD"
+ "F1F3EBC4435CBE6C6B323497098FDE9D"
+ "61AA0CC87416235E706A71F73EC3C291"
+ "D9ACA2EECD712DA40966DD251310AE94"
+ "9713F69B2A32E42732A7F6669547D88A"
+ "415B25C582FDBBF06C5EC5F5750053D4"
+ "9F7ED68DED168C92F9C531828A",
+ "FFFF6E7CD0386C94194C3C3DACFA7237"
+ "CCF4E0829E2EBEAB59DE12CAE3305C9E"
+ "576F837A42D9C13BB1D83E4DFD330B65"
+ "76FD516B2AE9FBDD152F0A820C5DD18E"
+ "D048D476EC791DC989D6D8C30B2B30FF"
+ "C2A4ABAC082C672B38E138610B74CE0C"
+ "30D1B378BE6FE0C44E09EC11586245CD"
+ "8F1216619392E6B2C857C71EA78DD4D8"
+ "61A482D9D1251C341D1D6205AFB2BFB5"
+ "3DD1F272B5624FA61B020936745387CD"
+ "F1F3EBC4435CBE6C6B323497098FDE9D"
+ "61AA0CC87416235E706A71F73EC3C291"
+ "D9ACA2EECD712DA40966DD251310AE94"
+ "9713F69B2A32E42732A7F6669547D88A"
+ "415B25C582FDBBF06C5EC5F5750053D4"
+ "9F7ED68DED168C92F9C531828B",
+ "FFFF6E7CD0386C94194C3C3DACFA7237"
+ "CCF4E0829E2EBEAB59DE12CAE3305C9E"
+ "576F837A42D9C13BB1D83E4DFD330B65"
+ "76FD516B2AE9FBDD152F0A820C5DD18E"
+ "D048D476EC791DC989D6D8C30B2B30FF"
+ "C2A4ABAC082C672B38E138610B74CE0C"
+ "30D1B378BE6FE0C44E09EC11586245CD"
+ "8F1216619392E6B2C857C71EA78DD4D8"
+ "61A482D9D1251C341D1D6205AFB2BFB5"
+ "3DD1F272B5624FA61B020936745387CD"
+ "F1F3EBC4435CBE6C6B323497098FDE9D"
+ "61AA0CC87416235E706A71F73EC3C291"
+ "D9ACA2EECD712DA40966DD251310AE94"
+ "9713F69B2A32E42732A7F6669547D88A"
+ "415B25C582FDBBF06C5EC5F5750053D4"
+ "9F7ED68DED168C92F9C531828A");
+
+ DEL_BIGINT(op);
+ DEL_BIGINT(n);
+ DEL_BIGINT(r);
+}
+
+#define MOD_ADDSUB(op1str, op2str, nstr, result) \
+ do { \
+ TEE_BigIntConvertFromString(op1, op1str); \
+ TEE_BigIntConvertFromString(op2, op2str); \
+ TEE_BigIntConvertFromString(n, nstr); \
+ TEE_BigIntAddMod(r, op1, op2, n); \
+ TB_ASSERT_HEX_PRINT_VALUE(r, result, 0); \
+ TEE_BigIntSubMod(tmp1, r, op2, n); \
+ TB_ASSERT_BIGINT_EQ(tmp1, op1); \
+ } while (0)
+
+static void test_modular_addsub(void)
+{
+ const char *N2048str = "F9000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "000000000000000000000000000005C5";
+
+ TB_INFO(" Testing modular addition and subtraction");
+
+ DEF_BIGINT(op1, 2048);
+ DEF_BIGINT(op2, 2048);
+ DEF_BIGINT(n, 2048);
+ DEF_BIGINT(r, 2048);
+ DEF_BIGINT(tmp1, 2048);
+
+ MOD_ADDSUB("1", "1", "2", "0");
+ MOD_ADDSUB("123", "123", "200", "46");
+ MOD_ADDSUB("0", "123", "200", "123");
+ MOD_ADDSUB("123", "0", "200", "123");
+
+ /* Testing some 2048 bit numbers */
+ MOD_ADDSUB("F9000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ ,
+ "F9000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000001",
+ N2048str,
+ "F8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFA3C");
+
+ MOD_ADDSUB("F9000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000",
+ "5C5", N2048str, "0");
+
+ DEL_BIGINT(op1);
+ DEL_BIGINT(op2);
+ DEL_BIGINT(n);
+ DEL_BIGINT(r);
+ DEL_BIGINT(tmp1);
+
+}
+
+#define MOD_MUL(op1str, op2str, nstr, result) \
+do { \
+ TEE_BigIntConvertFromString(op1, op1str); \
+ TEE_BigIntConvertFromString(op2, op2str); \
+ TEE_BigIntConvertFromString(n, nstr); \
+ TEE_BigIntMulMod(r, op1, op2, n); \
+ TB_ASSERT_HEX_PRINT_VALUE(r, result, 0); \
+} while (0)
+
+static void test_modular_mul(void)
+{
+ const char *N2048str = "F9000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "000000000000000000000000000005C5";
+
+ TB_INFO(" Testing modular multiplication");
+
+ DEF_BIGINT(op1, 2048);
+ DEF_BIGINT(op2, 2048);
+ DEF_BIGINT(n, 2048);
+ DEF_BIGINT(r, 2048);
+ DEF_BIGINT(tmp1, 2048);
+
+ MOD_MUL("0", "0", "2", "0");
+ MOD_MUL("1", "1", "2", "1");
+ MOD_MUL("123", "123", "200", "C9");
+
+ MOD_MUL("F9000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ ,
+ "F9000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000001",
+ N2048str, "2143D4");
+
+ DEL_BIGINT(op1);
+ DEL_BIGINT(op2);
+ DEL_BIGINT(n);
+ DEL_BIGINT(r);
+ DEL_BIGINT(tmp1);
+}
+
+#define MOD_INV(op1str, nstr, result) \
+do { \
+ TEE_BigIntConvertFromString(op1, op1str); \
+ TEE_BigIntConvertFromString(n, nstr); \
+ TEE_BigIntInvMod(r, op1, n); \
+ TB_ASSERT_HEX_PRINT_VALUE(r, result, 0); \
+ TEE_BigIntMulMod(tmp1, r, op1, n); \
+ TB_ASSERT_HEX_PRINT_VALUE(tmp1, "1", 0); \
+ TEE_BigIntInvMod(tmp1, r, n); \
+ TB_ASSERT_HEX_PRINT_VALUE(tmp1, op1str, 0); \
+} while (0)
+
+static void test_modular_inv(void)
+{
+ const char *N2048str =
+ "F9000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "00000000000000000000000000000000"
+ "000000000000000000000000000005C5";
+
+ TB_INFO(" Testing modular inversion");
+
+ DEF_BIGINT(op1, 2048);
+ DEF_BIGINT(op2, 2048);
+ DEF_BIGINT(n, 2048);
+ DEF_BIGINT(r, 2048);
+ DEF_BIGINT(tmp1, 2048);
+
+ MOD_INV("2", "3", "2");
+ MOD_INV("3", "7", "5");
+ MOD_INV("5", "7", "3");
+ MOD_INV("7B", "FA1", "8E5");
+ MOD_INV("462D578CF0F88", "AB54A98CEB1F0AD3", "5ABBF22B54DBD000");
+ MOD_INV("7", N2048str,
+ "B1DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6"
+ "DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB"
+ "6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6D"
+ "B6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6"
+ "DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB"
+ "6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6D"
+ "B6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6"
+ "DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB"
+ "6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6D"
+ "B6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6"
+ "DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB"
+ "6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6D"
+ "B6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6"
+ "DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB"
+ "6DB6DB6DB6DB6DB6DB6DB6DB6DB6DB6D"
+ "B6DB6DB6DB6DB6DB6DB6DB6DB6DB71D6");
+
+ DEL_BIGINT(op1);
+ DEL_BIGINT(op2);
+ DEL_BIGINT(n);
+ DEL_BIGINT(r);
+ DEL_BIGINT(tmp1);
+}
+
+void tb_modulus(void)
+{
+ const char *TEST_NAME = "Modulare arithmetics";
+
+ TB_HEADER(TEST_NAME);
+ test_modular_reduction();
+ test_modular_addsub();
+ test_modular_mul();
+ test_modular_inv();
+ TB_FOOTER(TEST_NAME);
+}
diff --git a/ta/os_test/tb_mul.c b/ta/os_test/tb_mul.c
new file mode 100644
index 0000000..1edfbf4
--- /dev/null
+++ b/ta/os_test/tb_mul.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "testframework.h"
+
+#define MUL(s, t, r) \
+do { \
+ TEE_BigIntConvertFromString(a, (s)); \
+ TEE_BigIntConvertFromString(b, (t)); \
+ TEE_BigIntMul(c, a, b); \
+ TB_ASSERT_HEX_PRINT_VALUE(c, (r), 0); \
+ TEE_BigIntMul(a, a, b); \
+ TB_ASSERT_HEX_PRINT_VALUE(a, (r), 0); \
+} while (0)
+
+#define MULWORD(s, t, r) \
+do { \
+ TEE_BigIntConvertFromString(a, (s)); \
+ mpa_mul_word((mpanum)b, (mpanum)a, t, mempool); \
+ TB_ASSERT_HEX_PRINT_VALUE(b, (r), 0); \
+ mpa_mul_word((mpanum)a, (mpanum)a, t, mempool); \
+ TB_ASSERT_HEX_PRINT_VALUE(a, (r), 0); \
+} while (0)
+
+void tb_mul(void)
+{
+ const char *TEST_NAME = "Multiplication";
+
+ TB_HEADER(TEST_NAME);
+
+ DEF_BIGINT(a, 1024);
+ DEF_BIGINT(b, 1024);
+ DEF_BIGINT(c, 2048);
+
+ TB_INFO("Testing basic cases");
+ MUL("0", "0", "0");
+ MULWORD("0", 0, "0");
+ MUL("0", "FFFFFFFF", "0");
+ MULWORD("0", 0xffffffff, "0");
+ MUL("1", "1", "1");
+ MULWORD("1", 1, "1");
+ MUL("-1", "1", "-1");
+ MULWORD("-1", 1, "-1");
+ MUL("-1", "-1", "1");
+ MUL("FF", "1", "FF");
+ MULWORD("1", 0xff, "FF");
+ MULWORD("FF", 1, "FF");
+ MUL("2", "2", "4");
+ MUL("3", "3", "9");
+ MUL("100", "100", "10000");
+ MUL("FFFFFFFF", "FFFFFFFF", "FFFFFFFE00000001");
+ MULWORD("FFFFFFFF", 0xffffffff, "FFFFFFFE00000001");
+ MUL("4F239BBAE89A447149CDB0B50A103C69591DD9E0C91A57955A6C266C7ED42A5ED5F4",
+ "44FF5A67036657E041D55AE42AE25517A1",
+ "155465C8221717FFC135C87ABF6D34184DF5E6906D2EBA7C364879AA0BE840FD06F1E0A7036BC3B7B1844FF95F07A39CE17A74");
+ MUL("4F239BBAE89A447149CDB0B50A103C69591DD9E0C91A57955A6C266C7ED42A5ED5F4",
+ "-44FF5A67036657E041D55AE42AE25517A1",
+ "-155465C8221717FFC135C87ABF6D34184DF5E6906D2EBA7C364879AA0BE840FD06F1E0A7036BC3B7B1844FF95F07A39CE17A74");
+ MUL("-4F239BBAE89A447149CDB0B50A103C69591DD9E0C91A57955A6C266C7ED42A5ED5F4",
+ "-44FF5A67036657E041D55AE42AE25517A1",
+ "155465C8221717FFC135C87ABF6D34184DF5E6906D2EBA7C364879AA0BE840FD06F1E0A7036BC3B7B1844FF95F07A39CE17A74");
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+ DEL_BIGINT(c);
+
+ TB_FOOTER(TEST_NAME);
+}
diff --git a/ta/os_test/tb_prime.c b/ta/os_test/tb_prime.c
new file mode 100644
index 0000000..6eb343c
--- /dev/null
+++ b/ta/os_test/tb_prime.c
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "testframework.h"
+
+/*
+ * Remove the #undef if you like debug print outs and assertions
+ * for this file.
+ */
+#undef DEBUG_ME
+#include "mpa_debug.h"
+#include "mpa_assert.h"
+
+#define COMPOSITE 0
+#define PRIME 1
+#define PROB_PRIME -1
+
+#define IS_COMPOSITE(str) \
+do { \
+ TEE_BigIntConvertFromString(x, str); \
+ int tmp = TEE_BigIntIsProbablePrime(x, 80); \
+ TB_ASSERT(tmp == COMPOSITE); \
+} while (0)
+
+#define IS_PRIME(str) \
+do { \
+ TEE_BigIntConvertFromString(x, str); \
+ int tmp = TEE_BigIntIsProbablePrime(x, 80); \
+ TB_ASSERT(((tmp == PRIME) || (tmp == PROB_PRIME))); \
+} while (0)
+
+static void simple(void)
+{
+
+ TB_INFO("Simple cases");
+
+ DEF_BIGINT(x, 2048);
+
+ IS_COMPOSITE("0");
+ IS_COMPOSITE("1");
+ IS_PRIME("2");
+ IS_PRIME("3");
+ IS_PRIME("17");
+ IS_PRIME("FA1");
+ IS_COMPOSITE("FA0");
+
+ DEL_BIGINT(x);
+
+}
+
+static void large_composites(void)
+{
+ TB_INFO("Large Composites");
+
+ DEF_BIGINT(x, 2048);
+
+ IS_COMPOSITE("136233FDE5569");
+ IS_COMPOSITE("177B96388FD94D5D7EC9AE513");
+ IS_COMPOSITE("22770A7DC599BC90B2FF981CCB5CF05703344C8F3504189ED");
+
+ IS_COMPOSITE("0002ECD5_3B215054_2D1494A4_24D50322_EBABBBD5_DB89392A_368D7759");
+
+ IS_COMPOSITE("00000004_C8971C2B_6F7A8503_AB80749E_2BBA5BB6_B6031BD4_3564DCA8_003F0E3E_54E677A0_A4B1B615_3662B313_0C11C273_C0F94084_45B2ABB4_7D64153B_EB48C154_659FDFDE_DC496C8E_A81AA7B7_CE2B2CB1_AA7C8B40_7DE8C86F_122607B2_A226385D_9432F6CB_30B5E4DE_033E3363_D48A1865_D9BC95DC_7883D9DC_9331691A_17964979");
+
+ IS_COMPOSITE("00038AFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFEA_5C6D11ED_D2905192_C5429E6A_6D796E89_250BF563_DA53D393_25129B70_435894B5_6E337D58_66F0BEF6_63D6C26D_A889B69D_4B1508ED_63A17AFD_8BC0C5BE_09AC18B6_4B2B7D87_279D32EB_4F3375C1_0D58DF1F_7CA2147A_61CFA557_235244D4_A4700AB5_953C4C6E_D428EB5F_09F07DAE_D46A995B_8FFE48EF_B93390C9_60685A31_987879F8_18CCE9B9_816E13DE_E4BEA5CC_38C56A5D_1983425D_DD909C88_463B447F");
+
+ DEL_BIGINT(x);
+}
+
+static void large_primes(void)
+{
+ TB_INFO("Large Primes");
+
+ DEF_BIGINT(x, 2048);
+
+ IS_PRIME("000136A3_52B2C7A5");
+ IS_PRIME("00000002_2770A7DC_599BC90B_2FF981CC_B5CF0570_3344C8F3_50418AAD");
+
+ IS_PRIME("000067E0_4F440C5F_ECCA2694_B1A4AB4F_CEC2D2B2_D286FC93_DD259D2B_36A3A00D_F3726A4D_4DFA9919_5998D92F_43DD7370_B8C079E2_3072036F_0C13F3F6_ABA1D6DF");
+
+ IS_PRIME("000BC9F7_E42CE741_32EC6933_DE1B8357_CD2AEB9E_4B8A5F26_BD233D1E_6F295555_4D2CFA97_60F3F69C_CC52E8E4_28F68C37_AD5BC70C_DB12F4DC_EF23CB10_1C36A2A7");
+
+ IS_PRIME("00000005_233FE157_B5B44102_598513AE_BB8876B0_D1791769_C8A1B0F3_6875D06F_E26951C7_372192C7_B21CAB67_ADF0D6FE_1A718FB3_FC4A5145_4DE87CD3_F852005B_AAEC35D5");
+
+ IS_PRIME("0000001A_655954FB_C4408E09_FE97EB82_5E0F0964_26B42317_A36E53FF_9608DD3F_A6610402_45906334_496987EF_B14BEA5F_7C050444_C9B22A09_EC76AF4E_BDC609D8_A90C05E9_E5AF0682_9C542DFC_F7E6B9DC_0B065659_C1816309_CD6012C3_7F8CE649_8DECF850_F33943F0_F8308140_6846D306_22E0BCE6_97E612FC_1F7A5D90_2280D6E0_3009E585");
+
+ DEL_BIGINT(x);
+}
+
+void tb_prime(void)
+{
+ TB_HEADER("Primality Algorithms");
+ simple();
+ large_composites();
+ large_primes();
+ TB_FOOTER("Primality Algorithms");
+}
diff --git a/ta/os_test/tb_shift.c b/ta/os_test/tb_shift.c
new file mode 100644
index 0000000..ece786f
--- /dev/null
+++ b/ta/os_test/tb_shift.c
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "testframework.h"
+
+#define MAX_RAND_RUNS 10000
+
+#define SHIFT_LEFT(in, s, out) \
+{ \
+ { \
+ TEE_BigIntConvertFromString(a, (in)); \
+ TB_ASSERT_HEX_PRINT_VALUE(b, (out), 0); \
+ } while (0); \
+}
+
+static void tb_shift_left_simple(void)
+{
+
+ DEF_BIGINT(a, 64);
+ DEF_BIGINT(b, 64);
+
+ TB_INFO(" Simple shift left");
+ SHIFT_LEFT("0", 1, "0");
+ SHIFT_LEFT("-1", 1, "-2");
+ SHIFT_LEFT("1", 0, "1");
+ SHIFT_LEFT("1", 1, "2");
+ SHIFT_LEFT("1", 2, "4");
+ SHIFT_LEFT("1", 3, "8");
+ SHIFT_LEFT("1", 4, "10");
+ SHIFT_LEFT("1", 5, "20");
+ SHIFT_LEFT("1", 6, "40");
+ SHIFT_LEFT("1", 7, "80");
+ SHIFT_LEFT("1", 8, "100");
+ SHIFT_LEFT("1", 9, "200");
+ SHIFT_LEFT("1", 10, "400");
+ SHIFT_LEFT("1", 11, "800");
+ SHIFT_LEFT("1", 12, "1000");
+ SHIFT_LEFT("1", 13, "2000");
+ SHIFT_LEFT("1", 14, "4000");
+ SHIFT_LEFT("1", 15, "8000");
+ SHIFT_LEFT("1", 16, "10000");
+ SHIFT_LEFT("1", 17, "20000");
+ SHIFT_LEFT("1", 18, "40000");
+ SHIFT_LEFT("1", 19, "80000");
+ SHIFT_LEFT("1", 20, "100000");
+ SHIFT_LEFT("1", 21, "200000");
+ SHIFT_LEFT("1", 22, "400000");
+ SHIFT_LEFT("1", 23, "800000");
+ SHIFT_LEFT("1", 24, "1000000");
+ SHIFT_LEFT("1", 25, "2000000");
+ SHIFT_LEFT("1", 26, "4000000");
+ SHIFT_LEFT("1", 27, "8000000");
+ SHIFT_LEFT("1", 28, "10000000");
+ SHIFT_LEFT("1", 29, "20000000");
+ SHIFT_LEFT("1", 30, "40000000");
+ SHIFT_LEFT("1", 31, "80000000");
+ TB_ASSERT_INT_EQ(((mpanum) b)->size, 1);
+
+ /* patterns */
+ TB_INFO("Simple shift left of patterns");
+ SHIFT_LEFT("05A5A5A5", 4, "5A5A5A50");
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+}
+
+static void tb_shift_left_words(void)
+{
+ DEF_BIGINT(a, 256);
+ DEF_BIGINT(b, 256);
+
+ TB_INFO(" Shift left by multiples of word size");
+ SHIFT_LEFT("1", 32, "100000000");
+ SHIFT_LEFT("1", 64, "10000000000000000");
+ SHIFT_LEFT("FFFFFFFF", 64, "FFFFFFFF0000000000000000");
+ SHIFT_LEFT("123456789ABCDEF0", 32, "123456789ABCDEF000000000");
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+}
+
+static void tb_shift_left_complex(void)
+{
+ DEF_BIGINT(a, 256);
+ DEF_BIGINT(b, 256);
+
+ TB_INFO(" Shift left by any value");
+ SHIFT_LEFT("1", 33, "200000000");
+ SHIFT_LEFT("1", 65, "20000000000000000");
+ SHIFT_LEFT("FFFFFFFF", 65, "1FFFFFFFE0000000000000000");
+
+ /* patterns */
+ SHIFT_LEFT("6E740D74D7F0DB4BF23376E", 73,
+ "DCE81AE9AFE1B697E466EDC000000000000000000");
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+}
+
+static void tb_shift_left(void)
+{
+ tb_shift_left_simple();
+ tb_shift_left_words();
+ tb_shift_left_complex();
+}
+
+#define SHIFT_RIGHT(out, s, in) \
+{ \
+ { \
+ TEE_BigIntConvertFromString(a, (in)); \
+ TEE_BigIntShiftRight(b, a, (s)); \
+ TB_ASSERT_HEX_PRINT_VALUE(b, (out), 0); \
+ } while (0); \
+}
+
+static void tb_shift_right_simple(void)
+{
+ DEF_BIGINT(a, 64);
+ DEF_BIGINT(b, 64);
+
+ TB_INFO(" Simple shift right");
+ SHIFT_RIGHT("0", 31, "7FFFFFFF");
+ SHIFT_RIGHT("0", 65, "7FFFFFFF");
+ SHIFT_RIGHT("0", 1, "0");
+ SHIFT_RIGHT("-1", 1, "-2");
+ SHIFT_RIGHT("1", 0, "1");
+ SHIFT_RIGHT("1", 1, "2");
+ SHIFT_RIGHT("1", 2, "4");
+ SHIFT_RIGHT("1", 3, "8");
+ SHIFT_RIGHT("1", 4, "10");
+ SHIFT_RIGHT("1", 5, "20");
+ SHIFT_RIGHT("1", 6, "40");
+ SHIFT_RIGHT("1", 7, "80");
+ SHIFT_RIGHT("1", 8, "100");
+ SHIFT_RIGHT("1", 9, "200");
+ SHIFT_RIGHT("1", 10, "400");
+ SHIFT_RIGHT("1", 11, "800");
+ SHIFT_RIGHT("1", 12, "1000");
+ SHIFT_RIGHT("1", 13, "2000");
+ SHIFT_RIGHT("1", 14, "4000");
+ SHIFT_RIGHT("1", 15, "8000");
+ SHIFT_RIGHT("1", 16, "10000");
+ SHIFT_RIGHT("1", 17, "20000");
+ SHIFT_RIGHT("1", 18, "40000");
+ SHIFT_RIGHT("1", 19, "80000");
+ SHIFT_RIGHT("1", 20, "100000");
+ SHIFT_RIGHT("1", 21, "200000");
+ SHIFT_RIGHT("1", 22, "400000");
+ SHIFT_RIGHT("1", 23, "800000");
+ SHIFT_RIGHT("1", 24, "1000000");
+ SHIFT_RIGHT("1", 25, "2000000");
+ SHIFT_RIGHT("1", 26, "4000000");
+ SHIFT_RIGHT("1", 27, "8000000");
+ SHIFT_RIGHT("1", 28, "10000000");
+ SHIFT_RIGHT("1", 29, "20000000");
+ SHIFT_RIGHT("1", 30, "40000000");
+ SHIFT_RIGHT("1", 31, "80000000");
+
+ /* patterns */
+ TB_INFO("Simple shift right of patterns");
+ SHIFT_RIGHT("5A5A5A5", 4, "5A5A5A50");
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+}
+
+static void tb_shift_right_words(void)
+{
+ DEF_BIGINT(a, 256);
+ DEF_BIGINT(b, 256);
+
+ TB_INFO(" Shift right by multiples of word size");
+ SHIFT_RIGHT("1", 32, "100000000");
+ SHIFT_RIGHT("1", 64, "10000000000000000");
+ SHIFT_RIGHT("FFFFFFFF", 64, "FFFFFFFF0000000000000000");
+ SHIFT_RIGHT("1111FFFF0000", 64, "1111FFFF00000000000000000000");
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+}
+
+static void tb_shift_right_complex(void)
+{
+ DEF_BIGINT(a, 256);
+ DEF_BIGINT(b, 256);
+
+ TB_INFO(" Shift right by any value");
+ SHIFT_RIGHT("1", 33, "200000000");
+ SHIFT_RIGHT("1", 65, "20000000000000000");
+ SHIFT_RIGHT("FFFFFFFF", 65, "1FFFFFFFE0000000000000000");
+
+ /* patterns */
+ SHIFT_RIGHT("24B0D975EC8FCC8E1D54CA4BF7ACFC4534F04", 81,
+ "4961B2EBD91F991C3AA99497EF59F88A69E08AD5C340167793C3CC32F");
+
+ DEL_BIGINT(a);
+ DEL_BIGINT(b);
+}
+
+static void tb_shift_right(void)
+{
+
+ tb_shift_right_simple();
+ tb_shift_right_words();
+ tb_shift_right_complex();
+}
+
+void tb_shift(void)
+{
+ const char *TEST_NAME = "Left and Right shift";
+
+ TB_HEADER(TEST_NAME);
+
+ TB_INFO("Testing shift left");
+ tb_shift_left();
+
+ TB_INFO("Testing shift right");
+ tb_shift_right();
+
+ TB_FOOTER(TEST_NAME);
+}
diff --git a/ta/os_test/tb_var.c b/ta/os_test/tb_var.c
new file mode 100644
index 0000000..5464afc
--- /dev/null
+++ b/ta/os_test/tb_var.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "testframework.h"
+
+/*------------------------------------------------------------
+ *
+ * test_BigIntInit
+ *
+ */
+static void test_BigIntInit(void)
+{
+
+ TEE_BigInt *a;
+ size_t aLen;
+
+ TB_INFO("Testing BigIntInit");
+
+ /* Testing normal allocation and initialization */
+ aLen = TEE_BigIntSizeInU32(512);
+ a = (TEE_BigInt *) TEE_Malloc(aLen * sizeof(TEE_BigInt), 0);
+ TEE_BigIntInit(a, aLen);
+ TEE_Free(a);
+
+ /* Testing zero allocation */
+ aLen = TEE_BigIntSizeInU32(0);
+ a = (TEE_BigInt *) TEE_Malloc(aLen * sizeof(TEE_BigInt), 0);
+ TEE_BigIntInit(a, aLen);
+ TEE_Free(a);
+
+ /* Testing too large */
+ aLen = TEE_BigIntSizeInU32(4096);
+ a = (TEE_BigInt *) TEE_Malloc(aLen * sizeof(TEE_BigInt), 0);
+ TEE_BigIntInit(a, aLen);
+ TEE_Free(a);
+
+ /* Testing boundaries */
+ aLen = TEE_BigIntSizeInU32(2048);
+ a = (TEE_BigInt *) TEE_Malloc(aLen * sizeof(TEE_BigInt), 0);
+ TEE_BigIntInit(a, aLen);
+ TEE_Free(a);
+
+ aLen = TEE_BigIntSizeInU32(2049);
+ a = (TEE_BigInt *) TEE_Malloc(aLen * sizeof(TEE_BigInt), 0);
+ TEE_BigIntInit(a, aLen);
+ TEE_Free(a);
+
+}
+
+/*------------------------------------------------------------
+ *
+ * tb_var
+ *
+ */
+void tb_var(void)
+{
+ const char *TEST_NAME = "Variables";
+
+ TB_HEADER(TEST_NAME);
+
+ test_BigIntInit();
+
+ TB_FOOTER(TEST_NAME);
+
+}
diff --git a/ta/os_test/testframework.c b/ta/os_test/testframework.c
new file mode 100644
index 0000000..823a72a
--- /dev/null
+++ b/ta/os_test/testframework.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "tee_internal_api.h"
+#include "testframework.h"
+
+/*
+ * TEE_BigIntConvertFromString
+ *
+ * !! Not part of the spec !!
+ *
+ * Assigns dest the value of the src, where src is a zero-terminated character
+ * string. If the src starts with a valid number, the valid part will be
+ * converted and the rest of the src will not be parsed further. src is assumed
+ * to be in base 16. Returns -1 if the src was malformed, and the number of base
+ * digits converted (not including leading zeros) if the conversion was OK. If
+ * the src is a null-ptr we return -1. If the src is empty, we don't touch dest
+ * and just returns 0. If the src only consists of white spaces, we set dest to
+ * zero returns 0.
+ */
+int TEE_BigIntConvertFromString(TEE_BigInt *dest, const char *src)
+{
+ mpanum mpa_dest = (mpa_num_base *) dest;
+
+ return mpa_set_str(mpa_dest, src);
+}
+
+/*
+ * TEE_BigIntConvertToString
+ *
+ * !! Not part of the spec !!
+ *
+ * Prints a zero-terminated string representation of src into dest. The need
+ * length of dest is the space needed to print src plus additional chars for the
+ * minus sign and the terminating '\0' char. If grouping is used (!= 0), we pad
+ * the number string with zeros to the left, up to the current group size. A
+ * pointer to str is returned. If something went wrong, we return 0.
+ *
+ * mode is one of the following:
+ * TEE_MATHAPI_PRINT_MODE_HEX_LC : output in lower case hex
+ * TEE_MATHAPI_PRINT_MODE_DEC : output in decimal
+ */
+char *TEE_BigIntConvertToString(char *dest, int mode, int groupsize,
+ const TEE_BigInt *src)
+{
+ mpanum mpa_src = (mpa_num_base *) src;
+
+ if (dest == 0) {
+ dest = TEE_Malloc(mpa_get_str_size(), 0);
+ if (dest == 0)
+ return 0;
+ }
+ return mpa_get_str(dest, mode, groupsize, mpa_src);
+}
+
+static uint8_t myrand(void)
+{
+ static uint32_t lcg_state = 17;
+ static const uint32_t a = 1664525;
+ static const uint32_t c = 1013904223;
+
+ lcg_state = (a * lcg_state + c);
+ return (uint8_t) (lcg_state >> 24);
+}
+
+static int getrand(int min, int max)
+{
+ return (myrand() % (max - min)) + min;
+}
+
+static char nibble_to_char(int c)
+{
+ if (c < 10)
+ return '0' + (char)c;
+ c -= 10;
+ return 'A' + (char)c;
+}
+
+static char getrandchar(int base)
+{
+ return nibble_to_char(getrand(0, base == 16 ? 15 : 9));
+}
+
+/*
+ * Function: tb_get_random_str
+ *
+ * Sets str to a random number in base 16 of max length
+ * MAX_RAND_DIGITS. str must point to a memory arear which is
+ * at least MAX_RAND_STR_SIZE big.
+ * if allow_neg is 1 we can generate negative numbers
+ */
+void tb_get_random_str(char *str, int allow_neg)
+{
+ char *ptr;
+ int r;
+ int neg = 0;
+ int j;
+ char c;
+
+ ptr = str;
+ if (allow_neg) {
+ neg = getrand(0, 1);
+ if (neg)
+ *ptr++ = '-';
+ }
+ r = getrand(0, MAX_RAND_DIGITS);
+ if (r == 0 && neg) {
+ *str++ = '0';
+ *str = '\0';
+ return;
+ }
+
+ for (j = 0; j < r; j++) {
+ c = getrandchar(16);
+
+ /* avoid leading zeros since that is difficult to test later */
+ if (j == 0 && c == '0') {
+ while ((c = getrandchar(16)) == '0')
+ ;
+ }
+ *ptr++ = c;
+ }
+ *ptr++ = '\0';
+}
+
+/*
+ * Function: tb_set_random_value
+ *
+ * Sets a to a random value and returns the representation in str (in base
+ * "base")
+ */
+void tb_set_random_value(TEE_BigInt *a, char *str, int allow_neg)
+{
+ do {
+ tb_get_random_str(str, allow_neg);
+ } while (*str == '\0');
+
+ TEE_BigIntConvertFromString(a, str);
+}
+
+static uint32_t mempool_u32[mpa_scratch_mem_size_in_U32(10, 2048)];
+mpa_scratch_mem mempool = (void *)&mempool_u32;
+
+void tb_main(void)
+{
+ mpa_init_scratch_mem(mempool, 10, 2048);
+
+ tb_var();
+ tb_conv();
+ tb_cmp();
+ tb_addsub();
+ tb_mul();
+ tb_div();
+ tb_modulus();
+ tb_prime();
+
+ ALL_PASSED;
+}
diff --git a/ta/prebuilt/faked_armv7_uta_signed_header.bin b/ta/prebuilt/faked_armv7_uta_signed_header.bin
new file mode 100644
index 0000000..7d5d2ad
--- /dev/null
+++ b/ta/prebuilt/faked_armv7_uta_signed_header.bin
Binary files differ
diff --git a/ta/rpc_test/Makefile b/ta/rpc_test/Makefile
new file mode 100644
index 0000000..3d461a6
--- /dev/null
+++ b/ta/rpc_test/Makefile
@@ -0,0 +1,2 @@
+BINARY = d17f73a0-36ef-11e1-984a0002a5d5c51b
+include ../ta_common.mk
diff --git a/ta/rpc_test/include/ta_rpc.h b/ta/rpc_test/include/ta_rpc.h
new file mode 100644
index 0000000..58b74ff
--- /dev/null
+++ b/ta/rpc_test/include/ta_rpc.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TA_RPC_H
+#define TA_RPC_H
+
+#include <ta_rpc_test.h>
+#include <tee_api.h>
+
+TEE_Result rpc_sha224(uint32_t nParamTypes, TEE_Param pParams[4]);
+TEE_Result rpc_sha256(uint32_t nParamTypes, TEE_Param pParams[4]);
+TEE_Result rpc_aes256ecb_encrypt(uint32_t nParamTypes, TEE_Param pParams[4]);
+TEE_Result rpc_aes256ecb_decrypt(uint32_t nParamTypes, TEE_Param pParams[4]);
+TEE_Result rpc_open(void *session_context, uint32_t param_types,
+ TEE_Param params[4]);
+
+#endif
diff --git a/ta/rpc_test/include/ta_rpc_test.h b/ta/rpc_test/include/ta_rpc_test.h
new file mode 100644
index 0000000..44541fb
--- /dev/null
+++ b/ta/rpc_test/include/ta_rpc_test.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TA_RPC_TEST_H
+#define TA_RPC_TEST_H
+
+/* This UUID is generated with the ITU-T UUID generator at
+ http://www.itu.int/ITU-T/asn1/uuid.html */
+#define TA_RPC_TEST_UUID { 0xd17f73a0, 0x36ef, 0x11e1, \
+ { 0x98, 0x4a, 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }
+
+#define TA_RPC_CMD_CRYPT_SHA224 1
+#define TA_RPC_CMD_CRYPT_SHA256 2
+#define TA_RPC_CMD_CRYPT_AES256ECB_ENC 3
+#define TA_RPC_CMD_CRYPT_AES256ECB_DEC 4
+#define TA_RPC_CMD_OPEN 5
+
+#endif
diff --git a/ta/rpc_test/include/user_ta_header_defines.h b/ta/rpc_test/include/user_ta_header_defines.h
new file mode 100644
index 0000000..1a2f1d7
--- /dev/null
+++ b/ta/rpc_test/include/user_ta_header_defines.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include <ta_rpc.h>
+
+#define TA_UUID TA_RPC_TEST_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE | \
+ TA_FLAG_MULTI_SESSION)
+#define TA_STACK_SIZE (1 * 1024)
+#define TA_DATA_SIZE (32 * 1024)
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/ta/rpc_test/sub.mk b/ta/rpc_test/sub.mk
new file mode 100644
index 0000000..468d8ec
--- /dev/null
+++ b/ta/rpc_test/sub.mk
@@ -0,0 +1,5 @@
+global-incdirs-y += include
+global-incdirs-y += ../crypt/include
+global-incdirs-y += ../sims/include
+srcs-y += ta_entry.c
+srcs-y += ta_rpc.c
diff --git a/ta/rpc_test/ta_entry.c b/ta/rpc_test/ta_entry.c
new file mode 100644
index 0000000..82d5f55
--- /dev/null
+++ b/ta/rpc_test/ta_entry.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <tee_ta_api.h>
+#include <user_ta_header_defines.h>
+#include <ta_rpc.h>
+
+/*
+ * Trusted Application Entry Points
+ */
+
+/* Called each time a new instance is created */
+TEE_Result TA_CreateEntryPoint(void)
+{
+ return TEE_SUCCESS;
+}
+
+/* Called each time an instance is destroyed */
+void TA_DestroyEntryPoint(void)
+{
+}
+
+/* Called each time a session is opened */
+TEE_Result TA_OpenSessionEntryPoint(uint32_t nParamTypes, TEE_Param pParams[4],
+ void **ppSessionContext)
+{
+ (void)nParamTypes;
+ (void)pParams;
+ (void)ppSessionContext;
+ return TEE_SUCCESS;
+}
+
+/* Called each time a session is closed */
+void TA_CloseSessionEntryPoint(void *pSessionContext)
+{
+ (void)pSessionContext;
+}
+
+/* Called when a command is invoked */
+TEE_Result TA_InvokeCommandEntryPoint(void *pSessionContext,
+ uint32_t nCommandID, uint32_t nParamTypes,
+ TEE_Param pParams[4])
+{
+ (void)pSessionContext;
+
+ switch (nCommandID) {
+ case TA_RPC_CMD_CRYPT_SHA224:
+ return rpc_sha224(nParamTypes, pParams);
+
+ case TA_RPC_CMD_CRYPT_SHA256:
+ return rpc_sha256(nParamTypes, pParams);
+
+ case TA_RPC_CMD_CRYPT_AES256ECB_ENC:
+ return rpc_aes256ecb_encrypt(nParamTypes, pParams);
+
+ case TA_RPC_CMD_CRYPT_AES256ECB_DEC:
+ return rpc_aes256ecb_decrypt(nParamTypes, pParams);
+
+ case TA_RPC_CMD_OPEN:
+ return rpc_open(pSessionContext, nParamTypes, pParams);
+
+ default:
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+}
diff --git a/ta/rpc_test/ta_rpc.c b/ta/rpc_test/ta_rpc.c
new file mode 100644
index 0000000..2bab4e9
--- /dev/null
+++ b/ta/rpc_test/ta_rpc.c
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+
+#include <ta_rpc.h>
+#include <tee_api.h>
+#include <trace.h>
+#include <ta_crypt.h>
+#include <ta_sims_test.h>
+
+static TEE_UUID cryp_uuid = TA_CRYPT_UUID;
+
+static TEE_Result rpc_call_cryp(uint32_t nParamTypes, TEE_Param pParams[4],
+ uint32_t cmd)
+{
+ TEE_TASessionHandle cryp_session;
+ TEE_Result res;
+ uint32_t origin;
+ TEE_Param params[4];
+
+ uint32_t types =
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE);
+
+ TEE_MemFill(params, 0, sizeof(TEE_Param) * 4);
+
+ res = TEE_OpenTASession(&cryp_uuid, 0, types, params, &cryp_session,
+ &origin);
+
+ if (res != TEE_SUCCESS) {
+ EMSG("rpc_sha256 - TEE_OpenTASession returned 0x%x\n",
+ (unsigned int)res);
+ return res;
+ }
+
+ res = TEE_InvokeTACommand(cryp_session, 0, cmd, nParamTypes,
+ pParams, &origin);
+
+ if (res != TEE_SUCCESS) {
+ EMSG("rpc_sha256 - TEE_InvokeTACommand returned 0x%x\n",
+ (unsigned int)res);
+ }
+
+ TEE_CloseTASession(cryp_session);
+
+ return res;
+}
+
+TEE_Result rpc_sha224(uint32_t nParamTypes, TEE_Param pParams[4])
+{
+ return rpc_call_cryp(nParamTypes, pParams, TA_CRYPT_CMD_SHA224);
+}
+
+TEE_Result rpc_sha256(uint32_t nParamTypes, TEE_Param pParams[4])
+{
+ return rpc_call_cryp(nParamTypes, pParams, TA_CRYPT_CMD_SHA256);
+}
+
+TEE_Result rpc_aes256ecb_encrypt(uint32_t nParamTypes, TEE_Param pParams[4])
+{
+ return rpc_call_cryp(nParamTypes, pParams, TA_CRYPT_CMD_AES256ECB_ENC);
+}
+
+TEE_Result rpc_aes256ecb_decrypt(uint32_t nParamTypes, TEE_Param pParams[4])
+{
+ return rpc_call_cryp(nParamTypes, pParams, TA_CRYPT_CMD_AES256ECB_DEC);
+}
+
+TEE_Result rpc_open(void *session_context, uint32_t param_types,
+ TEE_Param params[4])
+{
+ TEE_TASessionHandle session;
+ uint32_t orig;
+ TEE_Result res;
+ TEE_UUID uuid = TA_SIMS_TEST_UUID;
+ uint32_t types =
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE);
+ TEE_Param par[4];
+
+ (void)session_context;
+ (void)param_types;
+
+ res = TEE_OpenTASession(&uuid, 0, 0, NULL, &session, &orig);
+
+ if (res != TEE_SUCCESS)
+ return res;
+
+ TEE_MemFill(params, 0, sizeof(TEE_Param) * 4);
+ res =
+ TEE_InvokeTACommand(session, 0, TA_SIMS_CMD_GET_COUNTER, types, par,
+ &orig);
+
+ if (res != TEE_SUCCESS)
+ goto exit;
+
+exit:
+ TEE_CloseTASession(session);
+
+ return res;
+}
diff --git a/ta/sims/Makefile b/ta/sims/Makefile
new file mode 100644
index 0000000..4979452
--- /dev/null
+++ b/ta/sims/Makefile
@@ -0,0 +1,2 @@
+BINARY = e6a33ed4-562b-463a-bb7eff5e15a493c8
+include ../ta_common.mk
diff --git a/ta/sims/include/ta_sims.h b/ta/sims/include/ta_sims.h
new file mode 100644
index 0000000..11223b0
--- /dev/null
+++ b/ta/sims/include/ta_sims.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TA_SIMS_H
+#define TA_SIMS_H
+
+#include <ta_sims_test.h>
+#include <tee_api.h>
+
+TEE_Result sims_open_session(void **ctx);
+void sims_close_session(void *ctx);
+TEE_Result sims_read(uint32_t nParamTypes, TEE_Param pParams[4]);
+TEE_Result sims_write(uint32_t nParamTypes, TEE_Param pParams[4]);
+TEE_Result sims_get_counter(void *sesion_context, uint32_t param_types,
+ TEE_Param params[4]);
+
+#endif
diff --git a/ta/sims/include/ta_sims_test.h b/ta/sims/include/ta_sims_test.h
new file mode 100644
index 0000000..ec51ea6
--- /dev/null
+++ b/ta/sims/include/ta_sims_test.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TA_SIMS_TEST_H
+#define TA_SIMS_TEST_H
+
+/* This UUID is generated with uuidgen */
+#define TA_SIMS_TEST_UUID { 0xe6a33ed4, 0x562b, 0x463a, \
+ { 0xbb, 0x7e, 0xff, 0x5e, 0x15, 0xa4, 0x93, 0xc8 } }
+
+#define TA_SIMS_CMD_READ 1
+#define TA_SIMS_CMD_WRITE 2
+#define TA_SIMS_CMD_GET_COUNTER 3
+
+#endif
diff --git a/ta/sims/include/user_ta_header_defines.h b/ta/sims/include/user_ta_header_defines.h
new file mode 100644
index 0000000..e5c8963
--- /dev/null
+++ b/ta/sims/include/user_ta_header_defines.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include <ta_sims.h>
+
+#define TA_UUID TA_SIMS_TEST_UUID
+
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE | \
+ TA_FLAG_MULTI_SESSION)
+#define TA_STACK_SIZE (1 * 1024)
+#define TA_DATA_SIZE (64 * 1024)
+
+#endif /* USER_TA_HEADER_DEFINES_H */
diff --git a/ta/sims/sub.mk b/ta/sims/sub.mk
new file mode 100644
index 0000000..b48e957
--- /dev/null
+++ b/ta/sims/sub.mk
@@ -0,0 +1,3 @@
+global-incdirs-y += include
+srcs-y += ta_entry.c
+srcs-y += ta_sims.c
diff --git a/ta/sims/ta_entry.c b/ta/sims/ta_entry.c
new file mode 100644
index 0000000..92aaa8d
--- /dev/null
+++ b/ta/sims/ta_entry.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <tee_ta_api.h>
+#include <user_ta_header_defines.h>
+#include <ta_sims.h>
+
+/*
+ * Trusted Application Entry Points
+ */
+
+/* Called each time a new instance is created */
+TEE_Result TA_CreateEntryPoint(void)
+{
+ return TEE_SUCCESS;
+}
+
+/* Called each time an instance is destroyed */
+void TA_DestroyEntryPoint(void)
+{
+}
+
+/* Called each time a session is opened */
+TEE_Result TA_OpenSessionEntryPoint(uint32_t nParamTypes, TEE_Param pParams[4],
+ void **ppSessionContext)
+{
+ (void)nParamTypes;
+ (void)pParams;
+ return sims_open_session(ppSessionContext);
+}
+
+/* Called each time a session is closed */
+void TA_CloseSessionEntryPoint(void *pSessionContext)
+{
+ sims_close_session(pSessionContext);
+}
+
+/* Called when a command is invoked */
+TEE_Result TA_InvokeCommandEntryPoint(void *pSessionContext,
+ uint32_t nCommandID, uint32_t nParamTypes,
+ TEE_Param pParams[4])
+{
+ switch (nCommandID) {
+ case TA_SIMS_CMD_READ:
+ return sims_read(nParamTypes, pParams);
+
+ case TA_SIMS_CMD_WRITE:
+ return sims_write(nParamTypes, pParams);
+
+ case TA_SIMS_CMD_GET_COUNTER:
+ return sims_get_counter(pSessionContext, nParamTypes, pParams);
+
+ default:
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+}
diff --git a/ta/sims/ta_sims.c b/ta/sims/ta_sims.c
new file mode 100644
index 0000000..375342c
--- /dev/null
+++ b/ta/sims/ta_sims.c
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <ta_sims.h>
+#include <tee_api.h>
+
+#define TA_SIMS_MAX_STORAGE 4
+
+struct sims_bucket {
+ uint32_t size;
+ void *data;
+};
+
+struct sims_session {
+ uint32_t counter;
+ uint32_t array[2048];
+};
+
+static struct sims_bucket storage[TA_SIMS_MAX_STORAGE] = { {0} };
+
+static uint32_t counter;
+
+TEE_Result sims_open_session(void **ctx)
+{
+ struct sims_session *context =
+ TEE_Malloc(sizeof(struct sims_session), 0);
+ if (context == NULL)
+ return TEE_ERROR_OUT_OF_MEMORY;
+
+ context->counter = counter;
+ *ctx = context;
+
+ counter++;
+
+ return TEE_SUCCESS;
+}
+
+void sims_close_session(void *ctx)
+{
+ TEE_Free(ctx);
+}
+
+TEE_Result sims_read(uint32_t param_types, TEE_Param params[4])
+{
+ uint32_t index;
+ void *p;
+
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, 0, 0))
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ index = params[0].value.a;
+ if (index >= TA_SIMS_MAX_STORAGE)
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ if (storage[index].size > params[1].memref.size)
+ return TEE_ERROR_OVERFLOW;
+
+ p = TEE_Malloc(16000, 0);
+ if (p == NULL)
+ return TEE_ERROR_OUT_OF_MEMORY;
+
+ TEE_MemMove(params[1].memref.buffer, storage[index].data,
+ params[1].memref.size);
+
+ TEE_Free(p);
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result sims_write(uint32_t param_types, TEE_Param params[4])
+{
+ uint32_t index;
+
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, 0, 0))
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ index = params[0].value.a;
+ if (index >= TA_SIMS_MAX_STORAGE)
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ if (storage[index].data != NULL)
+ TEE_Free(storage[index].data);
+
+ storage[index].data = TEE_Malloc(params[1].memref.size, 0);
+ if (storage[index].data == NULL) {
+ storage[index].size = 0;
+ return TEE_ERROR_OUT_OF_MEMORY;
+ }
+ storage[index].size = params[1].memref.size;
+
+ TEE_MemMove(storage[index].data, params[1].memref.buffer,
+ params[1].memref.size);
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result sims_get_counter(void *session_context, uint32_t param_types,
+ TEE_Param params[4])
+{
+ struct sims_session *ctx = (struct sims_session *)session_context;
+
+ if (param_types !=
+ TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_OUTPUT, 0, 0, 0))
+ return TEE_ERROR_BAD_PARAMETERS;
+
+ params[0].value.a = ctx->counter;
+
+ return TEE_SUCCESS;
+}
diff --git a/ta/storage/Makefile b/ta/storage/Makefile
new file mode 100644
index 0000000..773c6f2
--- /dev/null
+++ b/ta/storage/Makefile
@@ -0,0 +1,2 @@
+BINARY = b689f2a7-8adf-477a-9f9932e90c0ad0a2
+include ../ta_common.mk
diff --git a/ta/storage/include/storage.h b/ta/storage/include/storage.h
new file mode 100644
index 0000000..3767666
--- /dev/null
+++ b/ta/storage/include/storage.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef STORAGE_H
+#define STORAGE_H
+
+#include <tee_api.h>
+
+TEE_Result ta_storage_cmd_open(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_create(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_close(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_read(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_write(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_seek(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_unlink(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_rename(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_trunc(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_alloc_enum(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_free_enum(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_reset_enum(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_start_enum(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_next_enum(uint32_t param_types, TEE_Param params[4]);
+
+#endif /*STORAGE_H */
diff --git a/ta/storage/include/ta_storage.h b/ta/storage/include/ta_storage.h
new file mode 100644
index 0000000..c4f3e31
--- /dev/null
+++ b/ta/storage/include/ta_storage.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TA_STORAGE_H
+#define TA_STORAGE_H
+
+#define TA_STORAGE_UUID { 0xb689f2a7, 0x8adf, 0x477a, \
+ { 0x9f, 0x99, 0x32, 0xe9, 0x0c, 0x0a, 0xd0, 0xa2 } }
+
+#define TA_STORAGE_CMD_OPEN 0
+#define TA_STORAGE_CMD_CLOSE 1
+#define TA_STORAGE_CMD_READ 2
+#define TA_STORAGE_CMD_WRITE 3
+#define TA_STORAGE_CMD_CREATE 4
+#define TA_STORAGE_CMD_SEEK 5
+#define TA_STORAGE_CMD_UNLINK 6
+#define TA_STORAGE_CMD_RENAME 7
+#define TA_STORAGE_CMD_TRUNC 8
+#define TA_STORAGE_CMD_ALLOC_ENUM 9
+#define TA_STORAGE_CMD_FREE_ENUM 10
+#define TA_STORAGE_CMD_RESET_ENUM 11
+#define TA_STORAGE_CMD_START_ENUM 12
+#define TA_STORAGE_CMD_NEXT_ENUM 13
+
+#endif /*TA_SKELETON_H */
diff --git a/ta/storage/include/user_ta_header_defines.h b/ta/storage/include/user_ta_header_defines.h
new file mode 100644
index 0000000..2271ffa
--- /dev/null
+++ b/ta/storage/include/user_ta_header_defines.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef USER_TA_HEADER_DEFINES_H
+#define USER_TA_HEADER_DEFINES_H
+
+#include <ta_storage.h>
+
+#define TA_UUID TA_STORAGE_UUID
+
+/*
+ * This is important to have TA_FLAG_SINGLE_INSTANCE && !TA_FLAG_MULTI_SESSION
+ * as it is used by the ytest
+ */
+#define TA_FLAGS (TA_FLAG_USER_MODE | TA_FLAG_EXEC_DDR | \
+ TA_FLAG_SINGLE_INSTANCE)
+#define TA_STACK_SIZE (2 * 1024)
+#define TA_DATA_SIZE (32 * 1024)
+
+#endif
diff --git a/ta/storage/storage.c b/ta/storage/storage.c
new file mode 100644
index 0000000..3a2e37f
--- /dev/null
+++ b/ta/storage/storage.c
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "storage.h"
+
+#include <tee_api.h>
+
+#define ASSERT_PARAM_TYPE(pt) \
+do { \
+ if ((pt) != param_types) \
+ return TEE_ERROR_BAD_PARAMETERS; \
+} while (0)
+
+TEE_Result ta_storage_cmd_open(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_VALUE_INOUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ return TEE_OpenPersistentObject(TEE_STORAGE_PRIVATE,
+ params[0].memref.buffer,
+ params[0].memref.size,
+ params[1].value.a,
+ (void *)¶ms[1].value.b);
+}
+
+TEE_Result ta_storage_cmd_create(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_VALUE_INOUT,
+ TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT));
+
+ return TEE_CreatePersistentObject(TEE_STORAGE_PRIVATE,
+ params[0].memref.buffer,
+ params[0].memref.size,
+ params[1].value.a,
+ (TEE_ObjectHandle) params[2].value.a,
+ params[3].memref.buffer,
+ params[3].memref.size,
+ (void *)¶ms[1].value.b);
+}
+
+TEE_Result ta_storage_cmd_close(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_CloseObject((TEE_ObjectHandle) params[0].value.a);
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_storage_cmd_read(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_MEMREF_OUTPUT,
+ TEE_PARAM_TYPE_VALUE_INOUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ return TEE_ReadObjectData((TEE_ObjectHandle) params[1].value.a,
+ params[0].memref.buffer,
+ params[0].memref.size, ¶ms[1].value.b);
+}
+
+TEE_Result ta_storage_cmd_write(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_MEMREF_INPUT,
+ TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ return TEE_WriteObjectData((TEE_ObjectHandle) params[1].value.a,
+ params[0].memref.buffer,
+ params[0].memref.size);
+}
+
+TEE_Result ta_storage_cmd_seek(uint32_t param_types, TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_ObjectInfo info;
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_VALUE_INOUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ res = TEE_SeekObjectData((TEE_ObjectHandle) params[0].value.a,
+ params[0].value.b, params[1].value.a);
+
+ res = TEE_GetObjectInfo1((TEE_ObjectHandle) params[0].value.a, &info);
+
+ params[1].value.b = info.dataPosition;
+
+ return res;
+}
+
+TEE_Result ta_storage_cmd_unlink(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_CloseAndDeletePersistentObject1((TEE_ObjectHandle) params[0].value.
+ a);
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_storage_cmd_rename(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ return TEE_RenamePersistentObject((TEE_ObjectHandle) params[0].value.a,
+ params[1].memref.buffer,
+ params[1].memref.size);
+}
+
+TEE_Result ta_storage_cmd_trunc(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ return TEE_TruncateObjectData((TEE_ObjectHandle) params[0].value.a,
+ params[0].value.b);
+}
+
+TEE_Result ta_storage_cmd_alloc_enum(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ return TEE_AllocatePersistentObjectEnumerator((void *)¶ms[0].
+ value.a);
+}
+
+TEE_Result ta_storage_cmd_free_enum(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_FreePersistentObjectEnumerator((TEE_ObjectEnumHandle) params[0].
+ value.a);
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_storage_cmd_reset_enum(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ TEE_ResetPersistentObjectEnumerator((TEE_ObjectEnumHandle) params[0].
+ value.a);
+
+ return TEE_SUCCESS;
+}
+
+TEE_Result ta_storage_cmd_start_enum(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
+
+ return TEE_StartPersistentObjectEnumerator((TEE_ObjectEnumHandle)
+ params[0].value.a,
+ TEE_STORAGE_PRIVATE);
+}
+
+TEE_Result ta_storage_cmd_next_enum(uint32_t param_types, TEE_Param params[4])
+{
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE));
+
+ if (params[1].memref.size < sizeof(TEE_ObjectInfo))
+ return TEE_ERROR_SHORT_BUFFER;
+
+ if (params[2].memref.size < TEE_OBJECT_ID_MAX_LEN)
+ return TEE_ERROR_SHORT_BUFFER;
+
+ params[1].memref.size = sizeof(TEE_ObjectInfo);
+
+ return TEE_GetNextPersistentObject((TEE_ObjectEnumHandle) params[0].
+ value.a,
+ (TEE_ObjectInfo *) params[1].memref.
+ buffer, params[2].memref.buffer,
+ ¶ms[2].memref.size);
+}
diff --git a/ta/storage/sub.mk b/ta/storage/sub.mk
new file mode 100644
index 0000000..c5a00cb
--- /dev/null
+++ b/ta/storage/sub.mk
@@ -0,0 +1,3 @@
+global-incdirs-y += include
+srcs-y += storage.c
+srcs-y += ta_entry.c
diff --git a/ta/storage/ta_entry.c b/ta/storage/ta_entry.c
new file mode 100644
index 0000000..1ba800e
--- /dev/null
+++ b/ta/storage/ta_entry.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <tee_ta_api.h>
+#include <ta_storage.h>
+
+#include "storage.h"
+
+/*
+ * Trusted Application Entry Points
+ */
+
+/* Called each time a new instance is created */
+TEE_Result TA_CreateEntryPoint(void)
+{
+ return TEE_SUCCESS;
+}
+
+/* Called each time an instance is destroyed */
+void TA_DestroyEntryPoint(void)
+{
+}
+
+/* Called each time a session is opened */
+TEE_Result TA_OpenSessionEntryPoint(uint32_t nParamTypes,
+ TEE_Param pParams[4],
+ void **ppSessionContext)
+{
+ (void)nParamTypes;
+ (void)pParams;
+ (void)ppSessionContext;
+ return TEE_SUCCESS;
+}
+
+/* Called each time a session is closed */
+void TA_CloseSessionEntryPoint(void *pSessionContext)
+{
+ (void)pSessionContext;
+}
+
+/* Called when a command is invoked */
+TEE_Result TA_InvokeCommandEntryPoint(void *pSessionContext,
+ uint32_t nCommandID, uint32_t nParamTypes,
+ TEE_Param pParams[4])
+{
+ (void)pSessionContext;
+
+ switch (nCommandID) {
+ case TA_STORAGE_CMD_OPEN:
+ return ta_storage_cmd_open(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_CLOSE:
+ return ta_storage_cmd_close(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_READ:
+ return ta_storage_cmd_read(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_WRITE:
+ return ta_storage_cmd_write(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_CREATE:
+ return ta_storage_cmd_create(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_SEEK:
+ return ta_storage_cmd_seek(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_UNLINK:
+ return ta_storage_cmd_unlink(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_RENAME:
+ return ta_storage_cmd_rename(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_TRUNC:
+ return ta_storage_cmd_trunc(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_ALLOC_ENUM:
+ return ta_storage_cmd_alloc_enum(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_FREE_ENUM:
+ return ta_storage_cmd_free_enum(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_RESET_ENUM:
+ return ta_storage_cmd_reset_enum(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_START_ENUM:
+ return ta_storage_cmd_start_enum(nParamTypes, pParams);
+
+ case TA_STORAGE_CMD_NEXT_ENUM:
+ return ta_storage_cmd_next_enum(nParamTypes, pParams);
+
+ default:
+ return TEE_ERROR_BAD_PARAMETERS;
+ }
+}
diff --git a/ta/ta_common.mk b/ta/ta_common.mk
new file mode 100644
index 0000000..bc0607b
--- /dev/null
+++ b/ta/ta_common.mk
@@ -0,0 +1,12 @@
+# Note that it is important that that $(BINARY) is set before we include
+# ta_dev_kit.mk. In the optee_test this is done in the individual TA Makefiles.
+include $(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk
+
+.PHONY: all
+all: $(O)/$(BINARY).ta
+
+$(O)/$(BINARY).ta: $(O)/$(BINARY).bin
+ @echo ' INSTALL $@'
+ @mkdir -p $(O)
+ @rm -f $@
+ @cat ../prebuilt/faked_armv7_uta_signed_header.bin $< > $@