Crypto - سلسلة محادثات

تتضمن هذه الوحدة وظائف التشفير.

ملخّص

أنواع المحددات

otCryptoSha256Hash typedef

الدوال

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
يجري حساب CCM AES.
otCryptoHmacSha256(const otCryptoKey *aKey, const uint8_t *aBuf, uint16_t aBufLength, otCryptoSha256Hash *aHash)
void
يجري حساب HMAC.

هياكل

otCryptoSha256Hash

يمثل تجزئة SHA-256.

أنواع المحددات

otCryptoSha256Hash

otPlatCryptoSha256Hash otCryptoSha256Hash

الدوال

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
)

يجري حساب CCM AES.

التفاصيل
المَعلمات
[in] aKey
مؤشر للمفتاح
[in] aTagLength
طول العلامة بالبايت.
[in] aNonce
يشير إلى النص الخاص بالمستخدم.
[in] aNonceLength
طول النص "بدون وحدة" بالبايت.
[in] aHeader
يشير إلى عنوان الصفحة.
[in] aHeaderLength
طول الرأس بالبايت.
[in,out] aPlainText
يشير إلى النص العادي.
[in,out] aCipherText
مؤشر إلى النص المشفّر
[in] aLength
طول النص العادي بالبايت.
[in] aEncrypt
true على التشفير وfalse على فك التشفير.
[out] aTag
مؤشر للعلامة.

otCryptoHmacSha256

void otCryptoHmacSha256(
  const otCryptoKey *aKey,
  const uint8_t *aBuf,
  uint16_t aBufLength,
  otCryptoSha256Hash *aHash
)

يجري حساب HMAC.

التفاصيل
المَعلمات
[in] aKey
مؤشر للمفتاح
[in] aBuf
مؤشر إلى المخزن المؤقت للإدخال
[in] aBufLength
طول aBuf بالبايت.
[out] aHash
مؤشر إلى بنية otCryptoSha256Hash لإخراج قيمة التجزئة.

الموارد

تبدأ مواضيع مراجع واجهة برمجة تطبيقات OpenThread من رمز المصدر، وهو متاح على GitHub. للحصول على مزيد من المعلومات أو للمساهمة في المستندات، يمكنك الاطّلاع على المراجع.