Home
last modified time | relevance | path

Searched refs:Buffer (Results 1 – 25 of 94) sorted by relevance

1234

/drivers/peripheral/pin_auth/hdi_service/adaptor/inc/
Dadaptor_algorithm.h39 Buffer *pubKey;
40 Buffer *priKey;
46 int32_t Ed25519Sign(const KeyPair *keyPair, const Buffer *data, Buffer **sign);
47 int32_t Ed25519Verify(const Buffer *pubKey, const Buffer *data, const Buffer *sign);
49 Buffer *Aes256GcmEncryptNoPadding(const Buffer *plaintext, const Buffer *key);
50 Buffer *Aes256GcmDecryptNoPadding(const Buffer *cipherInfo, const Buffer *key);
51 Buffer *DeriveDeviceKey(const Buffer *pinData, const Buffer *secret);
52 Buffer *Hkdf(const Buffer *salt, const Buffer *rootKey);
53 Buffer *Sha256Adaptor(const Buffer *data);
55 int32_t HmacSha256(const Buffer *hmacKey, const Buffer *data, Buffer **hmac);
[all …]
/drivers/peripheral/user_auth/hdi_service/adaptor/inc/
Dadaptor_algorithm.h33 Buffer *pubKey;
34 Buffer *priKey;
38 Buffer *key;
39 Buffer *iv;
40 Buffer *aad;
46 int32_t Ed25519Sign(const KeyPair *keyPair, const Buffer *data, Buffer **sign);
47 int32_t Ed25519Verify(const Buffer *pubKey, const Buffer *data, const Buffer *sign);
49 int32_t HmacSha256(const Buffer *hmacKey, const Buffer *data, Buffer **hmac);
52 int32_t AesGcmEncrypt(const Buffer *plaintext, const AesGcmParam *aesGcmParam, Buffer **ciphertext,…
53 int32_t AesGcmDecrypt(const Buffer *ciphertext, const AesGcmParam *aesGcmParam, const Buffer *tag,
/drivers/peripheral/pin_auth/hdi_service/common/inc/
Dbuffer.h33 } Buffer; typedef
35 bool IsBufferValid(const Buffer *buffer);
36 Buffer *CreateBufferBySize(const uint32_t size);
37 ResultCode InitBuffer(Buffer *buffer, const uint8_t *buf, const uint32_t bufSize);
38 void DestoryBuffer(Buffer *buffer);
39 Buffer *CopyBuffer(const Buffer *buffer);
40 bool CompareBuffer(const Buffer *buffer1, const Buffer *buffer2);
41 Buffer *CreateBufferByData(const uint8_t *data, const uint32_t dataSize);
42 ResultCode GetBufferData(const Buffer *buffer, uint8_t *data, uint32_t *dataSize);
43 bool CheckBufferWithSize(const Buffer *buffer, const uint32_t size);
/drivers/peripheral/user_auth/hdi_service/common/inc/
Dbuffer.h31 } Buffer; typedef
33 bool IsBufferValid(const Buffer *buffer);
34 Buffer GetTmpBuffer(uint8_t *buf, uint32_t contentSize, uint32_t maxSize);
35 Buffer *CreateBufferBySize(const uint32_t size);
36 void DestoryBuffer(Buffer *buffer);
37 Buffer *CopyBuffer(const Buffer *buffer);
38 bool CompareBuffer(const Buffer *buffer1, const Buffer *buffer2);
39 Buffer *CreateBufferByData(const uint8_t *data, const uint32_t dataSize);
40 ResultCode GetBufferData(const Buffer *buffer, uint8_t *data, uint32_t *dataSize);
41 bool CheckBufferWithSize(const Buffer *buffer, const uint32_t size);
/drivers/peripheral/user_auth/hdi_service/common/src/
Dbuffer.c25 bool IsBufferValid(const Buffer *buffer) in IsBufferValid()
36 Buffer GetTmpBuffer(uint8_t *buf, uint32_t contentSize, uint32_t maxSize) in GetTmpBuffer()
38 Buffer ret = { in GetTmpBuffer()
46 bool CheckBufferWithSize(const Buffer *buffer, const uint32_t size) in CheckBufferWithSize()
55 Buffer *CreateBufferBySize(const uint32_t size) in CreateBufferBySize()
62 Buffer *buffer = (Buffer *)Malloc(sizeof(Buffer)); in CreateBufferBySize()
86 Buffer *CreateBufferByData(const uint8_t *data, const uint32_t dataSize) in CreateBufferByData()
93 Buffer *buffer = (Buffer *)Malloc(sizeof(Buffer)); in CreateBufferByData()
117 void DestoryBuffer(Buffer *buffer) in DestoryBuffer()
133 Buffer *CopyBuffer(const Buffer *buffer) in CopyBuffer()
[all …]
/drivers/peripheral/pin_auth/hdi_service/common/src/
Dbuffer.c23 bool IsBufferValid(const Buffer *buffer) in IsBufferValid()
34 bool CheckBufferWithSize(const Buffer *buffer, const uint32_t size) in CheckBufferWithSize()
43 Buffer *CreateBufferBySize(const uint32_t size) in CreateBufferBySize()
50 Buffer *buffer = (Buffer *)Malloc(sizeof(Buffer)); in CreateBufferBySize()
74 Buffer *CreateBufferByData(const uint8_t *data, const uint32_t dataSize) in CreateBufferByData()
81 Buffer *buffer = (Buffer *)Malloc(sizeof(Buffer)); in CreateBufferByData()
105 ResultCode InitBuffer(Buffer *buffer, const uint8_t *buf, const uint32_t bufSize) in InitBuffer()
121 void DestoryBuffer(Buffer *buffer) in DestoryBuffer()
137 Buffer *CopyBuffer(const Buffer *buffer) in CopyBuffer()
144 Buffer *copyBuffer = CreateBufferBySize(buffer->maxSize); in CopyBuffer()
[all …]
/drivers/peripheral/pin_auth/hdi_service/adaptor/src/
Dadaptor_algorithm.c138 int32_t Ed25519Sign(const KeyPair *keyPair, const Buffer *data, Buffer **sign) in Ed25519Sign()
182 int32_t Ed25519Verify(const Buffer *pubKey, const Buffer *data, const Buffer *sign) in Ed25519Verify()
218 const Buffer *hmacKey, const Buffer *data, Buffer *hmac) in IamHmac()
236 int32_t HmacSha256(const Buffer *hmacKey, const Buffer *data, Buffer **hmac) in HmacSha256()
257 int32_t HmacSha512(const Buffer *hmacKey, const Buffer *data, Buffer **hmac) in HmacSha512()
291 static int32_t SetAesEncryptVi(EVP_CIPHER_CTX *ctx, const Buffer *vi) in SetAesEncryptVi()
304 static Buffer *CreateCiphertext(EVP_CIPHER_CTX *ctx, const Buffer *plaintext) in CreateCiphertext()
306 Buffer *ciphertext = CreateBufferBySize(plaintext->contentSize); in CreateCiphertext()
342 static int32_t SpliceOutput(const Buffer *vi, const Buffer *tag, const Buffer *ciphertext, Buffer *… in SpliceOutput()
373 static int32_t DoAes256GcmEncryptNoPadding(const Buffer *plaintext, const Buffer *key, Buffer *ciph… in DoAes256GcmEncryptNoPadding()
[all …]
/drivers/peripheral/user_auth/test/unittest/base_test/src/
Dbuffer_test.cpp54 Buffer *buffer1 = CreateBufferBySize(0);
59 Buffer *buffer2 = CreateBufferBySize(MAX_BUFFER_SIZE);
64 Buffer *buffer3 = CreateBufferBySize(5);
73 Buffer buffer1 = GetTmpBuffer(nullptr, 0, 0);
74 Buffer buffer2 = {
79 EXPECT_EQ(memcmp(&buffer1, &buffer2, sizeof(Buffer)), 0);
90 Buffer *buffer1 = CreateBufferByData(nullptr, 0);
95 Buffer *buffer2 = CreateBufferByData(nullptr, MAX_BUFFER_SIZE);
100 Buffer *data = CreateBufferBySize(5);
105 Buffer *buffer3 = CreateBufferByData(data->buf, 0);
[all …]
Dadaptor_algorithm_test.cpp53 Buffer *data = CreateBufferByData(&dataTest[0], 32);
89 Buffer *data = CreateBufferByData(&dataTest[0], keyLen);
91 Buffer *signContent = nullptr;
122 Buffer *data = CreateBufferByData(&dataTest[0], constLen);
125 Buffer *signContent = nullptr;
152 Buffer *hmacKey = nullptr;
153 Buffer *data = nullptr;
154 Buffer **hmac = nullptr;
156 Buffer *temp = nullptr;
172 Buffer *plaintext = nullptr;
[all …]
/drivers/peripheral/pin_auth/test/uinttest/pin_auth/common/src/
Dbuffer_test.cpp56 Buffer *buffer1 = CreateBufferBySize(0);
61 Buffer *buffer2 = CreateBufferBySize(MAX_BUFFER_SIZE);
66 Buffer *buffer3 = CreateBufferBySize(5);
81 Buffer *buffer1 = CreateBufferByData(nullptr, 0);
86 Buffer *buffer2 = CreateBufferByData(nullptr, MAX_BUFFER_SIZE);
91 Buffer *data = CreateBufferBySize(5);
96 Buffer *buffer3 = CreateBufferByData(data->buf, 0);
101 Buffer *buffer4 = CreateBufferByData(data->buf, MAX_BUFFER_SIZE);
106 Buffer *buffer5 = CreateBufferByData(data->buf, data->contentSize);
123 Buffer *buffer1 = CreateBufferByData(nullptr, 0);
[all …]
/drivers/peripheral/user_auth/test/unittest/database/
Didm_file_manager_test.cpp23 extern ResultCode CapacityExpansion(Buffer *object, uint32_t targetCapacity);
24 extern ResultCode StreamWrite(Buffer *parcel, void *from, uint32_t size);
25 extern ResultCode StreamWriteEnrolledInfo(Buffer *parcel, LinkedList *enrolledList);
26 extern ResultCode StreamWriteCredentialList(Buffer *parcel, LinkedList *credentialList);
27 extern ResultCode StreamWriteUserInfo(Buffer *parcel, UserInfo *userInfo);
28 extern ResultCode StreamRead(Buffer *parcel, uint32_t *index, void *to, uint32_t size);
29 …extern ResultCode StreamReadCredentialList(Buffer *parcel, uint32_t *index, LinkedList *credential…
30 …extern ResultCode StreamReadEnrolledList(Buffer *parcel, uint32_t *index, LinkedList *enrolledList…
59 Buffer *object = CreateBufferBySize(bufferSize);
67 Buffer *object = CreateBufferBySize(bufferSize);
[all …]
/drivers/peripheral/user_auth/hdi_service/key_mgr/inc/
Ded25519_key.h28 Buffer *ExecutorMsgSign(const Buffer *data);
29 const Buffer *GetPriKey(void);
30 const Buffer *GetPubKey(void);
/drivers/peripheral/pin_auth/test/uinttest/pin_auth/adaptor/src/
Dadaptor_algorithm_test.cpp55 Buffer *data = CreateBufferByData(&dataTest[0], 32);
91 Buffer *data = CreateBufferByData(&dataTest[0], keyLen);
93 Buffer *signContent = nullptr;
124 Buffer *data = CreateBufferByData(&dataTest[0], constLen);
127 Buffer *signContent = nullptr;
160 Buffer *cipherInfo = Aes256GcmEncryptNoPadding(nullptr, nullptr);
173 Buffer *plaintext = CreateBufferBySize(20);
175 Buffer *key = CreateBufferBySize(10);
177 Buffer *cipherInfo = Aes256GcmEncryptNoPadding(plaintext, key);
192 Buffer *plaintext1 = CreateBufferBySize(64);
[all …]
/drivers/peripheral/user_auth/hdi_service/key_mgr/src/
Ded25519_key.c38 const Buffer *GetPriKey(void) in GetPriKey()
47 const Buffer *GetPubKey(void) in GetPubKey()
62 Buffer *ExecutorMsgSign(const Buffer *data) in ExecutorMsgSign()
67 Buffer *signatrue = NULL; in ExecutorMsgSign()
/drivers/peripheral/display/buffer/test/unittest/
Ddisplay_buffer_ut.h28 using OHOS::HDI::Display::Buffer::V1_0::IAllocator;
29 using OHOS::HDI::Display::Buffer::V1_0::IMapper;
30 using OHOS::HDI::Display::Buffer::V1_0::AllocInfo;
31 using OHOS::HDI::Display::Buffer::V1_0::IDisplayBuffer;
Ddeath_test.h29 using OHOS::HDI::Display::Buffer::V1_0::IAllocator;
30 using OHOS::HDI::Display::Buffer::V1_0::IMapper;
31 using OHOS::HDI::Display::Buffer::V1_0::AllocInfo;
32 using OHOS::HDI::Display::Buffer::V1_0::IDisplayBuffer;
/drivers/peripheral/user_auth/hdi_service/idm/inc/
Duser_idm_funcs.h42 …sultCode AddCredentialFunc(int32_t userId, const Buffer *scheduleResult, uint64_t *credentialId, B…
47 ResultCode UpdateCredentialFunc(int32_t userId, const Buffer *scheduleResult, uint64_t *credentialI…
48 CredentialInfoHal *deletedCredential, Buffer **rootSecret);
/drivers/peripheral/user_auth/hdi_service/user_auth/src/
Duser_sign_centre.c51 Buffer *sign = NULL; in UserAuthTokenSign()
53 …const Buffer data = GetTmpBuffer((uint8_t *)userAuthToken, AUTH_TOKEN_DATA_LEN, AUTH_TOKEN_DATA_LE… in UserAuthTokenSign()
54 …const Buffer key = GetTmpBuffer(tokenKey->macKey, sizeof(tokenKey->macKey), sizeof(tokenKey->macKe… in UserAuthTokenSign()
92 Buffer *plaintext = NULL; in DecryptTokenCipher()
98 const Buffer tag = GetTmpBuffer((uint8_t *)userAuthToken->tag, sizeof(userAuthToken->tag), in DecryptTokenCipher()
100 const Buffer ciphertext = GetTmpBuffer((uint8_t *)userAuthToken->tokenDataCipher, in DecryptTokenCipher()
127 Buffer *rightSign = NULL; in CheckUserAuthTokenHmac()
128 …const Buffer data = GetTmpBuffer((uint8_t *)userAuthToken, AUTH_TOKEN_DATA_LEN, AUTH_TOKEN_DATA_LE… in CheckUserAuthTokenHmac()
129 …const Buffer key = GetTmpBuffer(tokenKey->macKey, sizeof(tokenKey->macKey), sizeof(tokenKey->macKe… in CheckUserAuthTokenHmac()
135 …const Buffer sign = GetTmpBuffer((uint8_t *)userAuthToken->sign, SHA256_DIGEST_SIZE, SHA256_DIGEST… in CheckUserAuthTokenHmac()
[all …]
/drivers/peripheral/user_auth/hdi_service/coauth/inc/
Dexecutor_message.h38 Buffer *rootSecret;
43 Buffer *msg;
46 ExecutorResultInfo *CreateExecutorResultInfo(const Buffer *tlv);
/drivers/peripheral/user_auth/hdi_service/adaptor/src/
Dadaptor_algorithm.c145 int32_t Ed25519Sign(const KeyPair *keyPair, const Buffer *data, Buffer **sign) in Ed25519Sign()
189 int32_t Ed25519Verify(const Buffer *pubKey, const Buffer *data, const Buffer *sign) in Ed25519Verify()
224 IAM_STATIC int32_t IamHmac(const EVP_MD *alg, const Buffer *hmacKey, const Buffer *data, Buffer *hm… in IamHmac()
242 int32_t HmacSha256(const Buffer *hmacKey, const Buffer *data, Buffer **hmac) in HmacSha256()
338 int32_t AesGcmEncrypt(const Buffer *plaintext, const AesGcmParam *aesGcmParam, Buffer **ciphertext,… in AesGcmEncrypt()
420 int32_t AesGcmDecrypt(const Buffer *ciphertext, const AesGcmParam *aesGcmParam, const Buffer *tag, in AesGcmDecrypt()
/drivers/peripheral/user_auth/hdi_service/database/src/
Didm_file_manager.c38 IAM_STATIC uint32_t GetRemainSpace(const Buffer *object) in GetRemainSpace()
43 IAM_STATIC uint8_t *GetStreamAddress(const Buffer *object) in GetStreamAddress()
48 IAM_STATIC ResultCode CapacityExpansion(Buffer *object, uint32_t targetCapacity) in CapacityExpansion()
78 IAM_STATIC ResultCode StreamWrite(Buffer *parcel, void *from, uint32_t size) in StreamWrite()
99 IAM_STATIC ResultCode StreamWriteEnrolledInfo(Buffer *parcel, LinkedList *enrolledList) in StreamWriteEnrolledInfo()
126 IAM_STATIC ResultCode StreamWriteCredentialList(Buffer *parcel, LinkedList *credentialList) in StreamWriteCredentialList()
153 IAM_STATIC ResultCode StreamWriteUserInfo(Buffer *parcel, UserInfo *userInfo) in StreamWriteUserInfo()
183 IAM_STATIC ResultCode WriteUserInfo(LinkedList *userInfoList, Buffer *parcel) in WriteUserInfo()
208 Buffer *parcel = CreateBufferBySize(PRE_APPLY_LEN); in UpdateFileInfo()
251 IAM_STATIC ResultCode StreamRead(Buffer *parcel, uint32_t *index, void *to, uint32_t size) in StreamRead()
[all …]
/drivers/peripheral/pin_auth/hdi_service/main/src/
Dpin_func.c23 ResultCode DoEnrollPin(PinEnrollParam *pinEnrollParam, Buffer *retTlv) in DoEnrollPin()
30 Buffer *rootSecret = CreateBufferBySize(ROOT_SECRET_LEN); in DoEnrollPin()
73 ResultCode DoAuthPin(PinAuthParam *pinAuthParam, Buffer *retTlv, ResultCode *compareRet) in DoAuthPin()
90 Buffer *rootSecret = CreateBufferBySize(ROOT_SECRET_LEN); in DoAuthPin()
191 static ResultCode WriteTlvHead(const AuthAttributeType type, const uint32_t length, Buffer *buf) in WriteTlvHead()
207 …de WriteTlv(const AuthAttributeType type, const uint32_t length, const uint8_t *value, Buffer *buf) in WriteTlv()
221 static Buffer *GetDataTlvContent(uint32_t result, uint64_t scheduleId, uint64_t templateId, const B… in GetDataTlvContent()
223 Buffer *ret = CreateBufferBySize(RESULT_TLV_LEN); in GetDataTlvContent()
254 ResultCode GenerateRetTlv(uint32_t result, uint64_t scheduleId, uint64_t templatedId, Buffer *retTl… in GenerateRetTlv()
255 Buffer *rootSecret) in GenerateRetTlv()
[all …]
/drivers/peripheral/pin_auth/hdi_service/main/inc/
Dpin_func.h110 ResultCode DoEnrollPin(PinEnrollParam *pinEnrollParam, Buffer *retTlv);
111 ResultCode DoAuthPin(PinAuthParam *pinAuthParam, Buffer *retTlv, ResultCode *compareRet);
114 ResultCode GenerateRetTlv(uint32_t result, uint64_t scheduleId, uint64_t templatedId, Buffer *retTl…
115 Buffer *rootSecret);
/drivers/peripheral/user_auth/test/unittest/service_test/src/
Dsignature_operation.cpp103 static ResultCode WriteTlvHead(const AuthAttributeType type, const uint32_t length, Buffer *buf) in WriteTlvHead()
119 …de WriteTlv(const AuthAttributeType type, const uint32_t length, const uint8_t *value, Buffer *buf) in WriteTlv()
134 static Buffer *GetDataTlvContent(uint32_t result, uint64_t scheduleId, uint64_t subType, uint64_t t… in GetDataTlvContent()
137 Buffer *ret = CreateBufferBySize(500); in GetDataTlvContent()
163 static ResultCode GenerateRetTlv(const TlvRequiredPara &para, Buffer *retTlv) in GenerateRetTlv()
175Buffer *dataContent = GetDataTlvContent(para.result, para.scheduleId, para.subType, para.templateI… in GenerateRetTlv()
182 Buffer *signContent = nullptr; in GenerateRetTlv()
205 Buffer *retTlv = CreateBufferBySize(RESULT_TLV_LEN); in GetExecutorResultTlv()
235 Buffer *pubKey = g_keyPair->pubKey; in GetExecutorPublicKey()
/drivers/peripheral/pin_auth/hdi_service/database/src/
Dpin_db.c663 static ResultCode WriteAddPinInfo(const Buffer *secret, const Buffer *pinCredentialData, uint8_t *s… in WriteAddPinInfo()
695 static Buffer *GenerateExpandData(char *str, const uint8_t *data, const uint32_t dataLen) in GenerateExpandData()
702 Buffer *outBuff = CreateBufferBySize(CONST_EXPAND_DATA_LEN); in GenerateExpandData()
726 static ResultCode GenerateRootSecret(const Buffer *deviceKey, const Buffer *pinData, Buffer *outRoo… in GenerateRootSecret()
728 Buffer *expandData = GenerateExpandData(SALT_PREFIX, pinData->buf, pinData->contentSize); in GenerateRootSecret()
734 Buffer *hkdfSalt = Sha256Adaptor(expandData); in GenerateRootSecret()
740 Buffer *rootSecret = Hkdf(hkdfSalt, deviceKey); in GenerateRootSecret()
758 static Buffer *GenerateEncryptionKey(const Buffer *deviceKey) in GenerateEncryptionKey()
760 Buffer *keyStrBuffer = CreateBufferBySize(CONST_CREDENTIAL_PREFIX_LEN); in GenerateEncryptionKey()
773 Buffer *encryptionKey = Hkdf(keyStrBuffer, deviceKey); in GenerateEncryptionKey()
[all …]

1234