Globalplatform TEE api介绍

文章目录

        • 1、TEE API介绍
        • 2、Client API : CA与TA通信的API介绍
        • 3、TEE API : TA系统调用TEE OS的API
          • (1)、Asymmetric
          • (2)、Authenticated Encryption
          • (3)、Basic Arithmetic
          • (4)、Cancellation
          • (5)、Converter
          • (6)、Data Stream Access
          • (7)、Deprecated
          • (8)、Events
          • (9)、Fast Modular Multiplication
          • (10)、Generic Object
          • (11)、Generic Operation
          • (12)、Initialization
          • (13)、Internal Client API
          • (14)、Key Derivation
          • (15)、Logical Operation
          • (16)、MAC
          • (17)、Memory Allocation and Size of Objects
          • (18)、Memory Management
          • (19)、Message Digest
          • (20)、Modular Arithmetic
          • (21)、Other Arithmetic
          • (22)、Panic Function
          • (23)、Peripherals
          • (24)、Persistent Object
          • (25)、Persistent Object Enumeration
          • (26)、Property Access
          • (27)、Random Data Generation
          • (28)、Symmetric Cipher
          • (29)、TA Interface
          • (30)、Time
          • (31)、Transient Object


★★★ 友情链接 : 个人博客导读首页—点击此处 ★★★

1、TEE API介绍

TEE API分两种:

  • 一类是CA与TA通信的API,实现方式就是应用程序调用libteec.so库,libteec.so库是由optee_client编译出的,libteec.so中调用了dev/tee_priv节点陷入kernel
    mode,在kernel mode中调用smc同步异常指令陷入到ATF,ATF再跳出到TEE OS, TEE
    OS再将消息发送给相应的TA。
    该API在globalplatform中的TEE_Client_API_Specification-V1.0_c.pdf文档中有所规定,api的具体实现是在optee_client/libteec
  • 一类是TA系统调用TEE OS的API,这是的实现方式其实就是系统调用,调用SVC同步异常指令,进入kernel mode。
    该API在globalplatform中的GPD_TEE_Internal_Core_API_Specification_v1.1.pdf文档中有所规定,api的具体实现是在optee_os\lib\libutee

2、Client API : CA与TA通信的API介绍

这类api不到10个(一共9个)

TEEC_InitializeContext
TEEC_FinalizeContext
TEEC_RegisterSharedMemory
TEEC_AllocateSharedMemory
TEEC_ReleaseSharedMemory
TEEC_OpenSession 
TEEC_CloseSession
TEEC_InvokeCommand
TEEC_RequestCancellation

3、TEE API : TA系统调用TEE OS的API

这类api就有很多了,也分好几类:

(1)、Asymmetric
TEE_AsymmetricDecrypt
TEE_AsymmetricEncrypt
TEE_AsymmetricSignDigest
TEE_AsymmetricVerifyDigest
(2)、Authenticated Encryption
TEE_AEDecryptFinal
TEE_AEEncryptFinal
TEE_AEInit
TEE_AEUpdate
TEE_AEUpdateAAD
(3)、Basic Arithmetic
TEE_BigIntAdd
TEE_BigIntDiv
TEE_BigIntMul
TEE_BigIntNeg
TEE_BigIntSquare
TEE_BigIntSub
(4)、Cancellation
TEE_GetCancellationFlag
TEE_MaskCancellation
TEE_UnmaskCancellation
(5)、Converter
TEE_BigIntConvertFromOctetString
TEE_BigIntConvertFromS32
TEE_BigIntConvertToOctetString
TEE_BigIntConvertToS32
(6)、Data Stream Access
TEE_ReadObjectData
TEE_SeekObjectData
TEE_TruncateObjectData
TEE_WriteObjectData
(7)、Deprecated
TEE_BigIntInitFMMContext
TEE_CloseAndDeletePersistentObject
TEE_CopyObjectAttributes
TEE_GetObjectInfo
TEE_RestrictObjectUsage
(8)、Events
TEE_Event_AddSources
TEE_Event_CancelSources
TEE_Event_CloseQueue
TEE_Event_DropSources
TEE_Event_ListSources
TEE_Event_OpenQueue
TEE_Event_TimerCreate
TEE_Event_Wait
(9)、Fast Modular Multiplication
TEE_BigIntComputeFMM
TEE_BigIntConvertFromFMM
TEE_BigIntConvertToFMM
(10)、Generic Object
TEE_CloseObject
TEE_GetObjectBufferAttribute
TEE_GetObjectInfo (deprecated)
TEE_GetObjectInfo1
TEE_GetObjectValueAttribute
TEE_RestrictObjectUsage (deprecated)
TEE_RestrictObjectUsage1
(11)、Generic Operation
TEE_AllocateOperation
TEE_CopyOperation
TEE_FreeOperation
TEE_GetOperationInfo
TEE_GetOperationInfoMultiple
TEE_IsAlgorithmSupported
TEE_ResetOperation
TEE_SetOperationKey
TEE_SetOperationKey2
(12)、Initialization
TEE_BigIntInit
TEE_BigIntInitFMM
TEE_BigIntInitFMMContext (deprecated)
TEE_BigIntInitFMMContext1
(13)、Internal Client API
TEE_CloseTASession
TEE_InvokeTACommand
TEE_OpenTASession
(14)、Key Derivation
TEE_DeriveKey
(15)、Logical Operation
TEE_BigIntAbs
TEE_BigIntAssign
TEE_BigIntCmp
TEE_BigIntCmpS32
TEE_BigIntGetBit
TEE_BigIntGetBitCount
TEE_BigIntSetBit
TEE_BigIntShiftRight
(16)、MAC
TEE_MACCompareFinal
TEE_MACComputeFinal
TEE_MACInit
TEE_MACUpdate
(17)、Memory Allocation and Size of Objects
TEE_BigIntFMMContextSizeInU32
TEE_BigIntFMMSizeInU32
TEE_BigIntSizeInU32 (macro)
(18)、Memory Management
TEE_CheckMemoryAccessRights
TEE_Free
TEE_GetInstanceData
TEE_Malloc
TEE_MemCompare
TEE_MemFill
TEE_MemMove
TEE_Realloc
TEE_SetInstanceData
(19)、Message Digest
TEE_DigestDoFinal
TEE_DigestExtract
TEE_DigestUpdate
(20)、Modular Arithmetic
TEE_BigIntAddMod
TEE_BigIntExpMod
TEE_BigIntInvMod
TEE_BigIntMod
TEE_BigIntMulMod
TEE_BigIntSquareMod
TEE_BigIntSubMod
(21)、Other Arithmetic
TEE_BigIntComputeExtendedGcd
TEE_BigIntIsProbablePrime
TEE_BigIntRelativePrime
(22)、Panic Function
TEE_Panic
(23)、Peripherals
TEE_Peripheral_Close
TEE_Peripheral_CloseMultiple
TEE_Peripheral_GetPeripherals
TEE_Peripheral_GetState
TEE_Peripheral_GetStateTable
TEE_Peripheral_Open
TEE_Peripheral_OpenMultiple
TEE_Peripheral_Read
TEE_Peripheral_SetState
TEE_Peripheral_Write
(24)、Persistent Object
TEE_CloseAndDeletePersistentObject (deprecated)
TEE_CloseAndDeletePersistentObject1
TEE_CreatePersistentObject
TEE_OpenPersistentObject
TEE_RenamePersistentObject
(25)、Persistent Object Enumeration
TEE_AllocatePersistentObjectEnumerator
TEE_FreePersistentObjectEnumerator
TEE_GetNextPersistentObject
TEE_ResetPersistentObjectEnumerator
TEE_StartPersistentObjectEnumerator
(26)、Property Access
TEE_AllocatePropertyEnumerator
TEE_FreePropertyEnumerator
TEE_GetNextProperty
TEE_GetPropertyAsBinaryBlock
TEE_GetPropertyAsBool
TEE_GetPropertyAsIdentity
TEE_GetPropertyAsString
TEE_GetPropertyAsU32
TEE_GetPropertyAsU64
TEE_GetPropertyAsUUID
TEE_GetPropertyName
TEE_ResetPropertyEnumerator
TEE_StartPropertyEnumerator
(27)、Random Data Generation
TEE_GenerateRandom
(28)、Symmetric Cipher
TEE_CipherDoFinal
TEE_CipherInit
TEE_CipherUpdate
(29)、TA Interface
TA_CloseSessionEntryPoint
TA_CreateEntryPoint
TA_DestroyEntryPoint
TA_InvokeCommandEntryPoint
TA_OpenSessionEntryPoint
(30)、Time
TEE_GetREETime
TEE_GetSystemTime
TEE_GetTAPersistentTime
TEE_SetTAPersistentTime
TEE_Wait
(31)、Transient Object
TEE_AllocateTransientObject
TEE_CopyObjectAttributes (deprecated)
TEE_CopyObjectAttributes1
TEE_FreeTransientObject
TEE_GenerateKey
TEE_InitRefAttribute
TEE_InitValueAttribute
TEE_PopulateTransientObject
TEE_ResetTransientObject

你可能感兴趣的:(optee,optee)