Tiền mã hóa – Ngăn xếp chuỗi
Mô-đun này bao gồm các hàm mã hóa.
Tóm tắt
Loại |
|
---|---|
otCryptoSha256Hash
|
typedefstruct otCryptoSha256Hash
Cấu trúc này đại diện cho hàm băm SHA-256. |
Biến |
|
---|---|
OT_TOOL_PACKED_END
|
Hàm |
|
---|---|
otCryptoAesCcm(const otCryptoKey *aKey, uint8_t aTagLength, const void *aNonce, uint8_t aNonceLength, const void *aHeader, uint32_t aHeaderLength, void *aPlainText, void *aCipherText, uint32_t aLength, bool aEncrypt, void *aTag)
|
void
Phương thức này thực hiện việc tính toán AES CCM.
|
otCryptoEcdsaSign(uint8_t *aOutput, uint16_t *aOutputLength, const uint8_t *aInputHash, uint16_t aInputHashLength, const uint8_t *aPrivateKey, uint16_t aPrivateKeyLength)
|
Phương thức này tạo ra ký hiệu ECDSA.
|
otCryptoHmacSha256(const otCryptoKey *aKey, const uint8_t *aBuf, uint16_t aBufLength, otCryptoSha256Hash *aHash)
|
void
Hàm này thực hiện việc tính toán HMAC.
|
Cấu trúc |
|
---|---|
otCryptoSha256Hash |
Cấu trúc này đại diện cho hàm băm SHA-256. |
Loại
otCryptoSha256Băm
struct otCryptoSha256Hash otCryptoSha256Hash
Cấu trúc này đại diện cho hàm băm SHA-256.
Biến
OT_DESCRIPTION_PACKED_END
OT_TOOL_PACKED_BEGIN struct otCryptoSha256Hash OT_TOOL_PACKED_END
Hàm
otCryptoAesCcm
void otCryptoAesCcm( const otCryptoKey *aKey, uint8_t aTagLength, const void *aNonce, uint8_t aNonceLength, const void *aHeader, uint32_t aHeaderLength, void *aPlainText, void *aCipherText, uint32_t aLength, bool aEncrypt, void *aTag )
Phương thức này thực hiện việc tính toán AES CCM.
Thông tin chi tiết | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Thông số |
|
otCryptoEcdsaSign
otError otCryptoEcdsaSign( uint8_t *aOutput, uint16_t *aOutputLength, const uint8_t *aInputHash, uint16_t aInputHashLength, const uint8_t *aPrivateKey, uint16_t aPrivateKeyLength )
Phương thức này tạo ra ký hiệu ECDSA.
Thông tin chi tiết | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Thông số |
|
||||||||||||
Giá trị trả về |
|
otCryptoHmacSha256
void otCryptoHmacSha256( const otCryptoKey *aKey, const uint8_t *aBuf, uint16_t aBufLength, otCryptoSha256Hash *aHash )
Hàm này thực hiện việc tính toán HMAC.
Thông tin chi tiết | |||||||||
---|---|---|---|---|---|---|---|---|---|
Thông số |
|
Macro
OT_CRYPTO_SHA256_Debug_SIZE
OT_CRYPTO_SHA256_HASH_SIZE 32
Độ dài của hàm băm SHA256 (tính bằng byte).
Nguồn lực
Các chủ đề trong API tham chiếu Openthread có nguồn gốc từ mã nguồn, có trên GitHub. Để biết thêm thông tin hoặc để đóng góp cho tài liệu của chúng tôi, hãy tham khảo phần Tài nguyên.