在好例子网,分享、交流、成长!
您当前所在位置:首页C/C++ 开发实例C/C++语言基础 → TEE相关文档 (GlobalPaltform组织)

TEE相关文档 (GlobalPaltform组织)

C/C++语言基础

下载此实例
  • 开发语言:C/C++
  • 实例大小:2.82M
  • 下载次数:6
  • 浏览次数:463
  • 发布时间:2020-08-08
  • 实例类别:C/C++语言基础
  • 发 布 人:devilxie
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: GP GlobalPlatform TEE specification

实例介绍

【实例简介】

是GlobalPlatform组织的包括TEE规范的一些文档,由于GlobalPlatform官网访问不流畅,所以下载到此给需要的同学。是研究TrustZone、OP-TEE等技术非常值得参考的文档


【实例截图】

【核心代码】

Contents
1 Introduction .......................................................................................................................... 11
1.1 Audience .............................................................................................................................................11
1.2 IPR Disclaimer.....................................................................................................................................11
1.3 Normative References ........................................................................................................................12
1.4 Terminology and Definitions................................................................................................................12
1.5 Abbreviations and Notations ...............................................................................................................16
1.6 Revision History ..................................................................................................................................17
2 Overview of the TEE Internal Core API ............................................................................... 18
2.1 Trusted Applications............................................................................................................................18
2.1.1 TA Interface..................................................................................................................................19
2.1.2 Instances, Sessions, Tasks, and Commands ..............................................................................20
2.1.3 Sequential Execution of Entry Points...........................................................................................20
2.1.4 Cancellations................................................................................................................................20
2.1.5 Unexpected Client Termination....................................................................................................21
2.1.6 Instance Types .............................................................................................................................21
2.1.7 Configuration, Development, and Management ..........................................................................21
2.2 Error Handling .....................................................................................................................................22
2.2.1 Normal Errors...............................................................................................................................22
2.2.2 Programmer Errors ......................................................................................................................22
2.2.3 Panics...........................................................................................................................................23
2.3 Opaque Handles ................................................................................................................................. 24
2.4 Properties ............................................................................................................................................25
2.5 Trusted Storage API for Data and Keys..............................................................................................26
2.6 Cryptographic Operations API ............................................................................................................26
2.7 Time API..............................................................................................................................................27
2.8 Arithmetical API...................................................................................................................................27
3 Common Definitions ............................................................................................................ 28
3.1 Header File..........................................................................................................................................28
3.2 Data Types ..........................................................................................................................................28
3.2.1 Basic Types..................................................................................................................................28
3.2.2 Bit Numbering...............................................................................................................................28
3.2.3 TEE_Result, TEEC_Result ..........................................................................................................28
3.2.4 TEE_UUID, TEEC_UUID .............................................................................................................29
3.3 Constants ............................................................................................................................................30
3.3.1 Return Code Ranges and Format................................................................................................30
3.3.2 Return Codes ...............................................................................................................................31
3.4 Parameter Annotations .......................................................................................................................32
3.4.1 [in], [out], and [inout].....................................................................................................................32
3.4.2 [outopt] .........................................................................................................................................32
3.4.3 [inbuf]............................................................................................................................................32
3.4.4 [outbuf] .........................................................................................................................................33
3.4.5 [outbufopt] ....................................................................................................................................33
3.4.6 [instring] and [instringopt] .............................................................................................................34
3.4.7 [outstring] and [outstringopt].........................................................................................................34
3.4.8 [ctx]...............................................................................................................................................34
4 Trusted Core Framework API .............................................................................................. 35
4.1 Data Types ..........................................................................................................................................36
4.1.1 TEE_Identity................................................................................................................................. 36
4/239 TEE Internal Core API Specification – Public Release v1.1
Copyright  2011-2014 GlobalPlatform, Inc. All Rights Reserved.
The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. Use of this information is
governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited.
4.1.2 TEE_Param..................................................................................................................................36
4.1.3 TEE_TASessionHandle ...............................................................................................................36
4.1.4 TEE_PropSetHandle....................................................................................................................36
4.2 Constants ............................................................................................................................................37
4.2.1 Parameter Types..........................................................................................................................37
4.2.2 Login Types..................................................................................................................................37
4.2.3 Origin Codes ................................................................................................................................37
4.2.4 Property Set Pseudo-Handles......................................................................................................38
4.2.5 Memory Access Rights ................................................................................................................38
4.3 TA Interface .........................................................................................................................................39
4.3.1 TA_CreateEntryPoint ...................................................................................................................43
4.3.2 TA_DestroyEntryPoint..................................................................................................................43
4.3.3 TA_OpenSessionEntryPoint ........................................................................................................44
4.3.4 TA_CloseSessionEntryPoint........................................................................................................46
4.3.5 TA_InvokeCommandEntryPoint...................................................................................................47
4.3.6 Operation Parameters in the TA Interface ...................................................................................48
4.4 Property Access Functions .................................................................................................................52
4.4.1 TEE_GetPropertyAsString ...........................................................................................................54
4.4.2 TEE_GetPropertyAsBool .............................................................................................................55
4.4.3 TEE_GetPropertyAsU32 ..............................................................................................................56
4.4.4 TEE_GetPropertyAsBinaryBlock..................................................................................................57
4.4.5 TEE_GetPropertyAsUUID............................................................................................................58
4.4.6 TEE_GetPropertyAsIdentity .........................................................................................................59
4.4.7 TEE_AllocatePropertyEnumerator...............................................................................................60
4.4.8 TEE_FreePropertyEnumerator ....................................................................................................60
4.4.9 TEE_StartPropertyEnumerator ....................................................................................................61
4.4.10 TEE_ResetPropertyEnumerator ..................................................................................................61
4.4.11 TEE_GetPropertyName ...............................................................................................................62
4.4.12 TEE_GetNextProperty .................................................................................................................63
4.5 Trusted Application Configuration Properties .....................................................................................64
4.6 Client Properties..................................................................................................................................66
4.7 Implementation Properties ..................................................................................................................68
4.8 Panics..................................................................................................................................................71
4.8.1 TEE_Panic ...................................................................................................................................71
4.9 Internal Client API ...............................................................................................................................72
4.9.1 TEE_OpenTASession ..................................................................................................................72
4.9.2 TEE_CloseTASession..................................................................................................................73
4.9.3 TEE_InvokeTACommand ............................................................................................................74
4.9.4 Operation Parameters in the Internal Client API..........................................................................76
4.10 Cancellation Functions........................................................................................................................77
4.10.1 TEE_GetCancellationFlag............................................................................................................77
4.10.2 TEE_UnmaskCancellation ...........................................................................................................78
4.10.3 TEE_MaskCancellation................................................................................................................78
4.11 Memory Management Functions.........................................................................................................79
4.11.1 TEE_CheckMemoryAccessRights ...............................................................................................79
4.11.2 TEE_SetInstanceData..................................................................................................................82
4.11.3 TEE_GetInstanceData .................................................................................................................82
4.11.4 TEE_Malloc ..................................................................................................................................83
4.11.5 TEE_Realloc ................................................................................................................................85
4.11.6 TEE_Free.....................................................................................................................................86
4.11.7 TEE_MemMove............................................................................................................................86
4.11.8 TEE_MemCompare .....................................................................................................................87
TEE Internal Core API Specification – Public Release v1.1 5/239
Copyright  2011-2014 GlobalPlatform, Inc. All Rights Reserved.
The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. Use of this information is
governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited.
4.11.9 TEE_MemFill................................................................................................................................88
5 Trusted Storage API for Data and Keys .............................................................................. 89
5.1 Summary of Features and Design ......................................................................................................89
5.2 Trusted Storage and Rollback Detection ............................................................................................91
5.3 Data Types ..........................................................................................................................................92
5.3.1 TEE_Attribute...............................................................................................................................92
5.3.2 TEE_ObjectInfo............................................................................................................................92
5.3.3 TEE_Whence ...............................................................................................................................93
5.3.4 TEE_ObjectHandle ......................................................................................................................93
5.3.5 TEE_ObjectEnumHandle .............................................................................................................93
5.4 Constants ............................................................................................................................................94
5.5 Generic Object Functions....................................................................................................................96
5.5.1 TEE_GetObjectInfo1 ....................................................................................................................96
5.5.2 TEE_RestrictObjectUsage1 .........................................................................................................98
5.5.3 TEE_GetObjectBufferAttribute.....................................................................................................99
5.5.4 TEE_GetObjectValueAttribute ...................................................................................................100
5.5.5 TEE_CloseObject.......................................................................................................................101
5.6 Transient Object Functions ...............................................................................................................102
5.6.1 TEE_AllocateTransientObject....................................................................................................102
5.6.2 TEE_FreeTransientObject .........................................................................................................105
5.6.3 TEE_ResetTransientObject .......................................................................................................106
5.6.4 TEE_PopulateTransientObject...................................................................................................107
5.6.5 TEE_InitRefAttribute, TEE_InitValueAttribute............................................................................111
5.6.6 TEE_CopyObjectAttributes1 ......................................................................................................112
5.6.7 TEE_GenerateKey .....................................................................................................................114
5.7 Persistent Object Functions ..............................................................................................................117
5.7.1 TEE_OpenPersistentObject.......................................................................................................117
5.7.2 TEE_CreatePersistentObject.....................................................................................................119
5.7.3 Persistent Object Sharing Rules ................................................................................................122
5.7.4 TEE_CloseAndDeletePersistentObject1....................................................................................124
5.7.5 TEE_RenamePersistentObject ..................................................................................................125
5.8 Persistent Object Enumeration Functions.........................................................................................126
5.8.1 TEE_AllocatePersistentObjectEnumerator................................................................................126
5.8.2 TEE_FreePersistentObjectEnumerator .....................................................................................127
5.8.3 TEE_ResetPersistentObjectEnumerator ...................................................................................128
5.8.4 TEE_StartPersistentObjectEnumerator .....................................................................................129
5.8.5 TEE_GetNextPersistentObject...................................................................................................130
5.9 Data Stream Access Functions.........................................................................................................131
5.9.1 TEE_ReadObjectData................................................................................................................131
5.9.2 TEE_WriteObjectData................................................................................................................133
5.9.3 TEE_TruncateObjectData ..........................................................................................................134
5.9.4 TEE_SeekObjectData ................................................................................................................135
6 Cryptographic Operations API .......................................................................................... 136
6.1 Data Types ........................................................................................................................................138
6.1.1 TEE_OperationMode .................................................................................................................138
6.1.2 TEE_OperationInfo ....................................................................................................................138
6.1.3 TEE_OperationInfoMultiple........................................................................................................139
6.1.4 TEE_OperationHandle ...............................................................................................................139
6.2 Generic Operation Functions ............................................................................................................140
6.2.1 TEE_AllocateOperation..............................................................................................................140
6.2.2 TEE_FreeOperation ...................................................................................................................144
6/239 TEE Internal Core API Specification – Public Release v1.1
Copyright  2011-2014 GlobalPlatform, Inc. All Rights Reserved.
The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. Use of this information is
governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited.
6.2.3 TEE_GetOperationInfo...............................................................................................................145
6.2.4 TEE_GetOperationInfoMultiple ..................................................................................................146
6.2.5 TEE_ResetOperation .................................................................................................................148
6.2.6 TEE_SetOperationKey...............................................................................................................149
6.2.7 TEE_SetOperationKey2.............................................................................................................151
6.2.8 TEE_CopyOperation ..................................................................................................................152
6.3 Message Digest Functions................................................................................................................153
6.3.1 TEE_DigestUpdate ....................................................................................................................153
6.3.2 TEE_DigestDoFinal....................................................................................................................154
6.4 Symmetric Cipher Functions .............................................................................................................155
6.4.1 TEE_CipherInit...........................................................................................................................155
6.4.2 TEE_CipherUpdate ....................................................................................................................156
6.4.3 TEE_CipherDoFinal ...................................................................................................................157
6.5 MAC Functions..................................................................................................................................158
6.5.1 TEE_MACInit..............................................................................................................................158
6.5.2 TEE_MACUpdate.......................................................................................................................159
6.5.3 TEE_MACComputeFinal............................................................................................................160
6.5.4 TEE_MACCompareFinal............................................................................................................161
6.6 Authenticated Encryption Functions ................................................................................................. 162
6.6.1 TEE_AEInit................................................................................................................................. 162
6.6.2 TEE_AEUpdateAAD ..................................................................................................................163
6.6.3 TEE_AEUpdate..........................................................................................................................164
6.6.4 TEE_AEEncryptFinal .................................................................................................................165
6.6.5 TEE_AEDecryptFinal .................................................................................................................166
6.7 Asymmetric Functions.......................................................................................................................167
6.7.1 TEE_AsymmetricEncrypt, TEE_AsymmetricDecrypt................................................................. 167
6.7.2 TEE_AsymmetricSignDigest......................................................................................................169
6.7.3 TEE_AsymmetricVerifyDigest....................................................................................................171
6.8 Key Derivation Functions ..................................................................................................................173
6.8.1 TEE_DeriveKey..........................................................................................................................173
6.9 Random Data Generation Function ..................................................................................................174
6.9.1 TEE_GenerateRandom..............................................................................................................174
6.10 Cryptographic Algorithms Specification ............................................................................................175
6.10.1 List of Algorithm Identifiers.........................................................................................................175
6.10.2 Object Types ..............................................................................................................................179
6.10.3 Elliptic Curve Types ...................................................................................................................180
6.11 Object or Operation Attributes...........................................................................................................181
7 Time API.............................................................................................................................. 183
7.1 Data Types ........................................................................................................................................183
7.1.1 TEE_Time ..................................................................................................................................183
7.2 Time Functions..................................................................................................................................184
7.2.1 TEE_GetSystemTime ................................................................................................................184
7.2.2 TEE_Wait ...................................................................................................................................185
7.2.3 TEE_GetTAPersistentTime........................................................................................................186
7.2.4 TEE_SetTAPersistentTime ........................................................................................................188
7.2.5 TEE_GetREETime .....................................................................................................................189
8 TEE Arithmetical API.......................................................................................................... 190
8.1 Introduction........................................................................................................................................190
8.2 Error Handling and Parameter Checking ..........................................................................................190
8.3 Data Types ........................................................................................................................................ 191
8.3.1 TEE_BigInt ................................................................................................................................. 191
TEE Internal Core API Specification – Public Release v1.1 7/239
Copyright  2011-2014 GlobalPlatform, Inc. All Rights Reserved.
The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. Use of this information is
governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited.
8.3.2 TEE_BigIntFMMContext ............................................................................................................192
8.3.3 TEE_BigIntFMM.........................................................................................................................192
8.4 Memory Allocation and Size of Objects ............................................................................................193
8.4.1 TEE_BigIntSizeInU32 ................................................................................................................193
8.4.2 TEE_BigIntFMMContextSizeInU32............................................................................................194
8.4.3 TEE_BigIntFMMSizeInU32 ........................................................................................................194
8.5 Initialization Functions.......................................................................................................................195
8.5.1 TEE_BigIntInit ............................................................................................................................195
8.5.2 TEE_BigIntInitFMMContext........................................................................................................196
8.5.3 TEE_BigIntInitFMM ....................................................................................................................197
8.6 Converter Functions..........................................................................................................................198
8.6.1 TEE_BigIntConvertFromOctetString..........................................................................................198
8.6.2 TEE_BigIntConvertToOctetString ..............................................................................................199
8.6.3 TEE_BigIntConvertFromS32......................................................................................................200
8.6.4 TEE_BigIntConvertToS32..........................................................................................................200
8.7 Logical Operations ............................................................................................................................201
8.7.1 TEE_BigIntCmp..........................................................................................................................201
8.7.2 TEE_BigIntCmpS32 ...................................................................................................................201
8.7.3 TEE_BigIntShiftRight .................................................................................................................202
8.7.4 TEE_BigIntGetBit .......................................................................................................................202
8.7.5 TEE_BigIntGetBitCount .............................................................................................................203
8.8 Basic Arithmetic Operations..............................................................................................................204
8.8.1 TEE_BigIntAdd...........................................................................................................................204
8.8.2 TEE_BigIntSub...........................................................................................................................205
8.8.3 TEE_BigIntNeg...........................................................................................................................206
8.8.4 TEE_BigIntMul ...........................................................................................................................207
8.8.5 TEE_BigIntSquare .....................................................................................................................208
8.8.6 TEE_BigIntDiv............................................................................................................................209
8.9 Modular Arithmetic Operations..........................................................................................................210
8.9.1 TEE_BigIntMod ..........................................................................................................................210
8.9.2 TEE_BigIntAddMod....................................................................................................................211
8.9.3 TEE_BigIntSubMod....................................................................................................................212
8.9.4 TEE_BigIntMulMod ....................................................................................................................213
8.9.5 TEE_BigIntSquareMod ..............................................................................................................214
8.9.6 TEE_BigIntInvMod .....................................................................................................................215
8.10 Other Arithmetic Operations..............................................................................................................216
8.10.1 TEE_BigIntRelativePrime...........................................................................................................216
8.10.2 TEE_BigIntComputeExtendedGcd ............................................................................................217
8.10.3 TEE_BigIntIsProbablePrime ......................................................................................................218
8.11 Fast Modular Multiplication Operations.............................................................................................219
8.11.1 TEE_BigIntConvertToFMM ........................................................................................................219
8.11.2 TEE_BigIntConvertFromFMM....................................................................................................220
8.11.3 TEE_BigIntComputeFMM ..........................................................................................................221
Annex A Panicked Function Identification.......................................................................... 222
Annex B Deprecated Functions ........................................................................................... 227
B.1.1 TEE_GetObjectInfo – Deprecated .............................................................................................227
B.1.2 TEE_RestrictObjectUsage – Deprecated ..................................................................................229
B.1.3 TEE_CopyObjectAttributes – Deprecated .................................................................................230
B.1.4 TEE_CloseAndDeletePersistentObject - Deprecated................................................................231
Annex C Normative References for Algorithms.................................................................. 232
8/239 TEE Internal Core API Specification – Public Release v1.1
Copyright  2011-2014 GlobalPlatform, Inc. All Rights Reserved.
The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. Use of this information is
governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited.
Functions................................................................................................................................... 236
Functions by Category ............................................................................................................. 238

实例下载地址

TEE相关文档 (GlobalPaltform组织)

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警