Krypto – Plattform
Dieses Modul enthält die Plattformabstraktion für Krypto.
Zusammenfassung
| Aufzählungen | |
|---|---|
| anonymous enum{ | enum Definiert die Schlüsselnutzungs-Flags.  | 
| otCryptoKeyAlgorithm{ | enum Definiert die Schlüsselalgorithmen.  | 
| otCryptoKeyStorage{ | enum Definiert die Schlüsselspeichertypen.  | 
| otCryptoKeyType{ | enum Definiert die Schlüsseltypen.  | 
| Typedefs | |
|---|---|
| otCryptoContext | typedef struct otCryptoContext | 
| otCryptoKey | typedef struct otCryptoKey | 
| otCryptoKeyRef | typedef uint32_tDieser Datentyp stellt den Schlüsselbezug dar.  | 
| otPlatCryptoEcdsaKeyPair | typedef struct otPlatCryptoEcdsaKeyPair | 
| otPlatCryptoEcdsaPublicKey | typedef struct otPlatCryptoEcdsaPublicKey | 
| otPlatCryptoEcdsaSignature | typedef struct otPlatCryptoEcdsaSignature | 
| otPlatCryptoSha256Hash | typedef struct otPlatCryptoSha256HashStellt einen SHA-256-Hash dar.  | 
| Variablen | |
|---|---|
| OT_TOOL_PACKED_END | |
| Funktionen | |
|---|---|
| otPlatCryptoAesEncrypt(otCryptoContext *aContext, const uint8_t *aInput, uint8_t *aOutput) | Verschlüsseln Sie die angegebenen Daten.  | 
| otPlatCryptoAesFree(otCryptoContext *aContext) | Geben Sie den AES-Kontext kostenlos.  | 
| otPlatCryptoAesInit(otCryptoContext *aContext) | Initialisieren Sie den AES-Vorgang.  | 
| otPlatCryptoAesSetKey(otCryptoContext *aContext, const otCryptoKey *aKey) | Legen Sie den Schlüssel für den AES-Vorgang fest.  | 
| otPlatCryptoDestroyKey(otCryptoKeyRef aKeyRef) | Einen in der PSA ITS gespeicherten Schlüssel löschen.  | 
| otPlatCryptoEcdsaExportPublicKey(otCryptoKeyRef aKeyRef, otPlatCryptoEcdsaPublicKey *aPublicKey) | Ruft den zugehörigen öffentlichen Schlüssel aus der übergebenen Schlüsselreferenz ab.  | 
| otPlatCryptoEcdsaGenerateAndImportKey(otCryptoKeyRef aKeyRef) | Generieren und importieren Sie ein neues ECDSA-Schlüsselpaar bei einer bestandenen Referenz.  | 
| otPlatCryptoEcdsaGenerateKey(otPlatCryptoEcdsaKeyPair *aKeyPair) | Generieren Sie ein neues ECDSA-Schlüsselpaar und füllen Sie den Ausgabezwischenspeicher.  | 
| otPlatCryptoEcdsaGetPublicKey(const otPlatCryptoEcdsaKeyPair *aKeyPair, otPlatCryptoEcdsaPublicKey *aPublicKey) | Rufen Sie den zugehörigen öffentlichen Schlüssel aus dem Eingabekontext ab.  | 
| otPlatCryptoEcdsaSign(const otPlatCryptoEcdsaKeyPair *aKeyPair, const otPlatCryptoSha256Hash *aHash, otPlatCryptoEcdsaSignature *aSignature) | Berechnen Sie die ECDSA-Signatur für eine gehashte Nachricht mithilfe des privaten Schlüssels aus dem Eingabekontext.  | 
| otPlatCryptoEcdsaSignUsingKeyRef(otCryptoKeyRef aKeyRef, const otPlatCryptoSha256Hash *aHash, otPlatCryptoEcdsaSignature *aSignature) | Berechnen Sie die ECDSA-Signatur für eine Hash-Nachricht mithilfe der übergebenen Schlüsselreferenz.  | 
| otPlatCryptoEcdsaVerify(const otPlatCryptoEcdsaPublicKey *aPublicKey, const otPlatCryptoSha256Hash *aHash, const otPlatCryptoEcdsaSignature *aSignature) | Verwenden Sie den Schlüssel aus dem Eingabekontext, um die ECDSA-Signatur einer gehashten Nachricht zu prüfen.  | 
| otPlatCryptoEcdsaVerifyUsingKeyRef(otCryptoKeyRef aKeyRef, const otPlatCryptoSha256Hash *aHash, const otPlatCryptoEcdsaSignature *aSignature) | Verwenden Sie „keyref“, um die ECDSA-Signatur einer Hash-Nachricht zu verifizieren.  | 
| otPlatCryptoExportKey(otCryptoKeyRef aKeyRef, uint8_t *aBuffer, size_t aBufferLen, size_t *aKeyLen) | Einen in PSA ITS gespeicherten Schlüssel exportieren.  | 
| otPlatCryptoHasKey(otCryptoKeyRef aKeyRef) | boolPrüft, ob der übergebenen Schlüsselreferenz ein Schlüssel in PSA ITS zugeordnet ist.  | 
| otPlatCryptoHkdfDeinit(otCryptoContext *aContext) | Initialisieren Sie den HKDF-Kontext.  | 
| otPlatCryptoHkdfExpand(otCryptoContext *aContext, const uint8_t *aInfo, uint16_t aInfoLength, uint8_t *aOutputKey, uint16_t aOutputKeyLength) | Führen Sie den HKDF-Maximierungsschritt durch.  | 
| otPlatCryptoHkdfExtract(otCryptoContext *aContext, const uint8_t *aSalt, uint16_t aSaltLength, const otCryptoKey *aInputKey) | HKDF-Extraktionsschritt ausführen.  | 
| otPlatCryptoHkdfInit(otCryptoContext *aContext) | Initialisieren Sie den HKDF-Kontext.  | 
| otPlatCryptoHmacSha256Deinit(otCryptoContext *aContext) | Heben Sie die Initialisierung des HMAC-Vorgangs auf.  | 
| otPlatCryptoHmacSha256Finish(otCryptoContext *aContext, uint8_t *aBuf, size_t aBufLength) | Schließen Sie den HMAC-Vorgang ab.  | 
| otPlatCryptoHmacSha256Init(otCryptoContext *aContext) | Initialisieren Sie den HMAC-Vorgang.  | 
| otPlatCryptoHmacSha256Start(otCryptoContext *aContext, const otCryptoKey *aKey) | HMAC-Vorgang starten.  | 
| otPlatCryptoHmacSha256Update(otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength) | HMAC-Vorgang mit neuer Eingabe aktualisieren  | 
| otPlatCryptoImportKey(otCryptoKeyRef *aKeyRef, otCryptoKeyType aKeyType, otCryptoKeyAlgorithm aKeyAlgorithm, int aKeyUsage, otCryptoKeyStorage aKeyPersistence, const uint8_t *aKey, size_t aKeyLen) | Importieren Sie einen Schlüssel in PSA ITS.  | 
| otPlatCryptoInit(void) | voidInitialisieren Sie das Crypto-Modul.  | 
| otPlatCryptoPbkdf2GenerateKey(const uint8_t *aPassword, uint16_t aPasswordLen, const uint8_t *aSalt, uint16_t aSaltLen, uint32_t aIterationCounter, uint16_t aKeyLen, uint8_t *aKey) | Führen Sie PKCS#5 PBKDF2 mit CMAC (AES-CMAC-PRF-128) durch.  | 
| otPlatCryptoRandomDeinit(void) | voidDeinitialisieren des kryptografisch sicheren Pseudozufallszahlengenerators (CSPRNG)  | 
| otPlatCryptoRandomGet(uint8_t *aBuffer, uint16_t aSize) | Füllt einen bestimmten Puffer mit kryptografisch sicheren zufälligen Byte.  | 
| otPlatCryptoRandomInit(void) | voidInitialisieren Sie den kryptografisch sicheren Pseudozufallszahlengenerator (CSPRNG).  | 
| otPlatCryptoSha256Deinit(otCryptoContext *aContext) | Initialisieren Sie den SHA-256-Vorgang.  | 
| otPlatCryptoSha256Finish(otCryptoContext *aContext, uint8_t *aHash, uint16_t aHashSize) | Beenden Sie den SHA-256-Vorgang.  | 
| otPlatCryptoSha256Init(otCryptoContext *aContext) | Initialisieren Sie den SHA-256-Vorgang.  | 
| otPlatCryptoSha256Start(otCryptoContext *aContext) | SHA-256-Vorgang starten.  | 
| otPlatCryptoSha256Update(otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength) | SHA-256-Vorgang mit neuer Eingabe aktualisieren.  | 
| Strukturen | |
|---|---|
| otCryptoContext | Speichert das Kontextobjekt für Plattform-APIs. | 
| otCryptoKey | Stellt das für Crypto-Vorgänge erforderliche Schlüsselmaterial dar. | 
| otPlatCryptoEcdsaKeyPair | Stellt ein ECDSA-Schlüsselpaar (öffentliche und private Schlüssel) dar. | 
| otPlatCryptoEcdsaPublicKey | Stellt einen öffentlichen ECDSA-Schlüssel dar. | 
| otPlatCryptoEcdsaSignature | Stellt eine ECDSA-Signatur dar. | 
| otPlatCryptoSha256Hash | Stellt einen SHA-256-Hash dar. | 
Aufzählungen
Anonyme Aufzählung
anonymous enum
Definiert die Schlüsselnutzungs-Flags.
| Attribute | |
|---|---|
| OT_CRYPTO_KEY_USAGE_DECRYPT | Schlüsselverwendung: AES ECB. | 
| OT_CRYPTO_KEY_USAGE_ENCRYPT | Schlüsselverwendung: Verschlüsselung (vom Anbieter definiert). | 
| OT_CRYPTO_KEY_USAGE_EXPORT | Schlüsselverwendung: Der Schlüssel kann exportiert werden. | 
| OT_CRYPTO_KEY_USAGE_NONE | Schlüsselverwendung: Die Schlüsselverwendung ist leer. | 
| OT_CRYPTO_KEY_USAGE_SIGN_HASH | Schlüsselverwendung: Signatur-Hash. | 
| OT_CRYPTO_KEY_USAGE_VERIFY_HASH | Schlüsselverwendung: Hash überprüfen. | 
otCryptoKeyAlgorithm
otCryptoKeyAlgorithm
Definiert die Schlüsselalgorithmen.
| Attribute | |
|---|---|
| OT_CRYPTO_KEY_ALG_AES_ECB | Schlüsselalgorithmus: AES ECB. | 
| OT_CRYPTO_KEY_ALG_ECDSA | Schlüsselalgorithmus: ECDSA. | 
| OT_CRYPTO_KEY_ALG_HMAC_SHA_256 | Schlüsselalgorithmus: HMAC SHA-256. | 
| OT_CRYPTO_KEY_ALG_VENDOR | Schlüsselalgorithmus: Anbieterdefiniert. | 
otCryptoKeyStorage
otCryptoKeyStorage
Definiert die Schlüsselspeichertypen.
| Attribute | |
|---|---|
| OT_CRYPTO_KEY_STORAGE_PERSISTENT | Schlüsselpersistenz: Der Schlüssel ist dauerhaft. | 
| OT_CRYPTO_KEY_STORAGE_VOLATILE | Schlüsselpersistenz: Der Schlüssel ist flüchtig. | 
otCryptoKeyType
otCryptoKeyType
Definiert die Schlüsseltypen.
| Attribute | |
|---|---|
| OT_CRYPTO_KEY_TYPE_AES | Schlüsseltyp: AES. | 
| OT_CRYPTO_KEY_TYPE_ECDSA | Schlüsseltyp: ECDSA. | 
| OT_CRYPTO_KEY_TYPE_HMAC | Schlüsseltyp: HMAC. | 
| OT_CRYPTO_KEY_TYPE_RAW | Schlüsseltyp: Rohdaten. | 
Typedefs
otCryptoContext
struct otCryptoContext otCryptoContext
otCryptoKey
struct otCryptoKey otCryptoKey
otCryptoKeyRef
uint32_t otCryptoKeyRef
Dieser Datentyp stellt den Schlüsselbezug dar.
otPlatCryptoEcdsaKeyPair
struct otPlatCryptoEcdsaKeyPair otPlatCryptoEcdsaKeyPair
otPlatCryptoEcdsaPublicKey
struct otPlatCryptoEcdsaPublicKey otPlatCryptoEcdsaPublicKey
otPlatCryptoEcdsaSignature
struct otPlatCryptoEcdsaSignature otPlatCryptoEcdsaSignature
otPlatCryptoSha256Hash
struct otPlatCryptoSha256Hash otPlatCryptoSha256Hash
Stellt einen SHA-256-Hash dar.
Variablen
OT_TOOL_PACKED_END
OT_TOOL_PACKED_BEGIN struct otPlatCryptoSha256Hash OT_TOOL_PACKED_END
Funktionen
otPlatCryptoAesEncrypt
otError otPlatCryptoAesEncrypt( otCryptoContext *aContext, const uint8_t *aInput, uint8_t *aOutput )
Verschlüsseln Sie die angegebenen Daten.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoAesFree
otError otPlatCryptoAesFree( otCryptoContext *aContext )
Geben Sie den AES-Kontext kostenlos.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoAesInit
otError otPlatCryptoAesInit( otCryptoContext *aContext )
Initialisieren Sie den AES-Vorgang.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoAesSetKey
otError otPlatCryptoAesSetKey( otCryptoContext *aContext, const otCryptoKey *aKey )
Legen Sie den Schlüssel für den AES-Vorgang fest.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoDestroyKey
otError otPlatCryptoDestroyKey( otCryptoKeyRef aKeyRef )
Einen in der PSA ITS gespeicherten Schlüssel löschen.
| Details | |||||
|---|---|---|---|---|---|
| Parameter | 
 | ||||
| Rückgabewerte | 
 | ||||
otPlatCryptoEcdsaExportPublicKey
otError otPlatCryptoEcdsaExportPublicKey( otCryptoKeyRef aKeyRef, otPlatCryptoEcdsaPublicKey *aPublicKey )
Ruft den zugehörigen öffentlichen Schlüssel aus der übergebenen Schlüsselreferenz ab.
Der öffentliche Schlüssel wird abhängig von der verwendeten kryptografischen Back-End-Bibliothek unterschiedlich gespeichert (OPENTHREAD_CONFIG_CRYPTO_LIB).
Diese API muss dafür sorgen, dass der öffentliche Schlüssel als Bytesequenzdarstellung eines unkomprimierten Kurvenpunkts (RFC 6605 – Sek. 4) zurückgegeben wird.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoEcdsaGenerateAndImportKey
otError otPlatCryptoEcdsaGenerateAndImportKey( otCryptoKeyRef aKeyRef )
Generieren und importieren Sie ein neues ECDSA-Schlüsselpaar bei einer bestandenen Referenz.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoEcdsaGenerateKey
otError otPlatCryptoEcdsaGenerateKey( otPlatCryptoEcdsaKeyPair *aKeyPair )
Generieren Sie ein neues ECDSA-Schlüsselpaar und füllen Sie den Ausgabezwischenspeicher.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoEcdsaGetPublicKey
otError otPlatCryptoEcdsaGetPublicKey( const otPlatCryptoEcdsaKeyPair *aKeyPair, otPlatCryptoEcdsaPublicKey *aPublicKey )
Rufen Sie den zugehörigen öffentlichen Schlüssel aus dem Eingabekontext ab.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoEcdsaSign
otError otPlatCryptoEcdsaSign( const otPlatCryptoEcdsaKeyPair *aKeyPair, const otPlatCryptoSha256Hash *aHash, otPlatCryptoEcdsaSignature *aSignature )
Berechnen Sie die ECDSA-Signatur für eine gehashte Nachricht mithilfe des privaten Schlüssels aus dem Eingabekontext.
Verwendet das Verfahren zur Generierung deterministischer digitaler Signaturen gemäß RFC 6979.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoEcdsaSignUsingKeyRef
otError otPlatCryptoEcdsaSignUsingKeyRef( otCryptoKeyRef aKeyRef, const otPlatCryptoSha256Hash *aHash, otPlatCryptoEcdsaSignature *aSignature )
Berechnen Sie die ECDSA-Signatur für eine Hash-Nachricht mithilfe der übergebenen Schlüsselreferenz.
Verwendet das Verfahren zur Generierung deterministischer digitaler Signaturen gemäß RFC 6979.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoEcdsaVerify
otError otPlatCryptoEcdsaVerify( const otPlatCryptoEcdsaPublicKey *aPublicKey, const otPlatCryptoSha256Hash *aHash, const otPlatCryptoEcdsaSignature *aSignature )
Verwenden Sie den Schlüssel aus dem Eingabekontext, um die ECDSA-Signatur einer gehashten Nachricht zu prüfen.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoEcdsaVerifyUsingKeyRef
otError otPlatCryptoEcdsaVerifyUsingKeyRef( otCryptoKeyRef aKeyRef, const otPlatCryptoSha256Hash *aHash, const otPlatCryptoEcdsaSignature *aSignature )
Verwenden Sie „keyref“, um die ECDSA-Signatur einer Hash-Nachricht zu verifizieren.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoExportKey
otError otPlatCryptoExportKey( otCryptoKeyRef aKeyRef, uint8_t *aBuffer, size_t aBufferLen, size_t *aKeyLen )
Einen in PSA ITS gespeicherten Schlüssel exportieren.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoHasKey
bool otPlatCryptoHasKey( otCryptoKeyRef aKeyRef )
Prüft, ob der übergebenen Schlüsselreferenz ein Schlüssel in PSA ITS zugeordnet ist.
| Details | |||||
|---|---|---|---|---|---|
| Parameter | 
 | ||||
| Rückgabewerte | 
 | ||||
otPlatCryptoHkdfDeinit
otError otPlatCryptoHkdfDeinit( otCryptoContext *aContext )
Initialisieren Sie den HKDF-Kontext.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoHkdfExpand
otError otPlatCryptoHkdfExpand( otCryptoContext *aContext, const uint8_t *aInfo, uint16_t aInfoLength, uint8_t *aOutputKey, uint16_t aOutputKeyLength )
Führen Sie den HKDF-Maximierungsschritt durch.
| Details | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||||
| Rückgabewerte | 
 | ||||||||||
otPlatCryptoHkdfExtract
otError otPlatCryptoHkdfExtract( otCryptoContext *aContext, const uint8_t *aSalt, uint16_t aSaltLength, const otCryptoKey *aInputKey )
HKDF-Extraktionsschritt ausführen.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||
| Rückgabewerte | 
 | ||||||||
otPlatCryptoHkdfInit
otError otPlatCryptoHkdfInit( otCryptoContext *aContext )
Initialisieren Sie den HKDF-Kontext.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoHmacSha256Deinit
otError otPlatCryptoHmacSha256Deinit( otCryptoContext *aContext )
Heben Sie die Initialisierung des HMAC-Vorgangs auf.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoHmacSha256Finish
otError otPlatCryptoHmacSha256Finish( otCryptoContext *aContext, uint8_t *aBuf, size_t aBufLength )
Schließen Sie den HMAC-Vorgang ab.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoHmacSha256Init
otError otPlatCryptoHmacSha256Init( otCryptoContext *aContext )
Initialisieren Sie den HMAC-Vorgang.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoHmacSha256Start
otError otPlatCryptoHmacSha256Start( otCryptoContext *aContext, const otCryptoKey *aKey )
HMAC-Vorgang starten.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoHmacSha256Update
otError otPlatCryptoHmacSha256Update( otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength )
HMAC-Vorgang mit neuer Eingabe aktualisieren
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoImportKey
otError otPlatCryptoImportKey( otCryptoKeyRef *aKeyRef, otCryptoKeyType aKeyType, otCryptoKeyAlgorithm aKeyAlgorithm, int aKeyUsage, otCryptoKeyStorage aKeyPersistence, const uint8_t *aKey, size_t aKeyLen )
Importieren Sie einen Schlüssel in PSA ITS.
Wenn OT_CRYPTO_KEY_STORAGE_VOLATILE für aKeyPersistence übergeben wird und dannaKeyRef ausgegeben wird, spielt der Ausgangswert keine Rolle und die Plattform-API MUSS ihn aktualisieren, um die neue Schlüsselreferenz zurückzugeben.
      | Details | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||||||||
| Rückgabewerte | 
 | ||||||||||||||
Diese API wird nur vom OT Core verwendet, wenn OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE aktiviert ist. 
otPlatCryptoInit
void otPlatCryptoInit( void )
Initialisieren Sie das Crypto-Modul.
otPlatCryptoPbkdf2GenerateKey (Schlüssel: otPlatCryptoPbkdf2GenerateKey)
otError otPlatCryptoPbkdf2GenerateKey( const uint8_t *aPassword, uint16_t aPasswordLen, const uint8_t *aSalt, uint16_t aSaltLen, uint32_t aIterationCounter, uint16_t aKeyLen, uint8_t *aKey )
Führen Sie PKCS#5 PBKDF2 mit CMAC (AES-CMAC-PRF-128) durch.
| Details | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||||||||||
| Rückgabewerte | 
 | ||||||||||||||
otPlatCryptoRandomDeinit
void otPlatCryptoRandomDeinit( void )
Deinitialisieren des kryptografisch sicheren Pseudozufallszahlengenerators (CSPRNG)
otPlatCryptoRandomGet
otError otPlatCryptoRandomGet( uint8_t *aBuffer, uint16_t aSize )
Füllt einen bestimmten Puffer mit kryptografisch sicheren zufälligen Byte.
| Details | |||||
|---|---|---|---|---|---|
| Parameter | 
 | ||||
| Rückgabewerte | 
 | ||||
otPlatCryptoRandomInit
void otPlatCryptoRandomInit( void )
Initialisieren Sie den kryptografisch sicheren Pseudozufallszahlengenerator (CSPRNG).
otPlatCryptoSha256Deinit
otError otPlatCryptoSha256Deinit( otCryptoContext *aContext )
Initialisieren Sie den SHA-256-Vorgang.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoSha256Finish
otError otPlatCryptoSha256Finish( otCryptoContext *aContext, uint8_t *aHash, uint16_t aHashSize )
Beenden Sie den SHA-256-Vorgang.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoSha256Init
otError otPlatCryptoSha256Init( otCryptoContext *aContext )
Initialisieren Sie den SHA-256-Vorgang.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoSha256Start
otError otPlatCryptoSha256Start( otCryptoContext *aContext )
SHA-256-Vorgang starten.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
otPlatCryptoSha256Update
otError otPlatCryptoSha256Update( otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength )
SHA-256-Vorgang mit neuer Eingabe aktualisieren.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameter | 
 | ||||||
| Rückgabewerte | 
 | ||||||
Makros
OT_CRYPTO_ECDSA_MAX_DER_SIZE
OT_CRYPTO_ECDSA_MAX_DER_SIZE 125
Maximale Puffergröße (in Byte) für die Darstellung des EDCSA-Schlüsselpaars im DER-Format.
OT_CRYPTO_ECDSA_PUBLIC_KEY_SIZE
OT_CRYPTO_ECDSA_PUBLIC_KEY_SIZE 64
Puffergröße (in Byte) für die Darstellung des öffentlichen EDCSA-Schlüssels.
OT_CRYPTO_ECDSA_SIGNATURE_SIZE
OT_CRYPTO_ECDSA_SIGNATURE_SIZE 64
Puffergröße (in Byte) für die Darstellung der EDCSA-Signatur.
OT_CRYPTO_PBDKF2_MAX_SALT_SIZE
OT_CRYPTO_PBDKF2_MAX_SALT_SIZE 30
Max. PBKDF2-SALT-Länge: Salt-Präfix (6) + Extended-Panid (8) + Netzwerkname (16)
OT_CRYPTO_SHA256_HASH_SIZE
OT_CRYPTO_SHA256_HASH_SIZE 32
Länge des SHA256-Hashs in Byte.
Ressourcen
OpenThread API-Referenzthemen stammen aus dem Quellcode, der auf GitHub verfügbar ist. Weitere Informationen finden Sie unter Ressourcen. Dort können Sie auch einen Beitrag zu unserer Dokumentation leisten.