Cripto - Piattaforma
Questo modulo include l'astrazione della piattaforma per la crittografia.
Riepilogo
Enumerazioni |
|
---|---|
anonymous enum{
|
enum Questa enumerazione definisce i flag di utilizzo delle chiavi. |
otCryptoKeyAlgorithm{
|
enum Questa enumerazione definisce gli algoritmi delle chiavi. |
otCryptoKeyStorage{
|
enum Questa enumerazione definisce i tipi di archiviazione delle chiavi. |
otCryptoKeyType{
|
enum Questa enumerazione definisce i tipi di chiavi. |
Typedef |
|
---|---|
otCryptoContext
|
typedefstruct otCryptoContext
|
otCryptoKey
|
typedefstruct otCryptoKey
|
otCryptoKeyRef
|
typedefuint32_t
Questo tipo di dati rappresenta il riferimento per la chiave. |
Functions |
|
---|---|
otPlatCryptoAesEncrypt(otCryptoContext *aContext, const uint8_t *aInput, uint8_t *aOutput)
|
Cripta i dati forniti.
|
otPlatCryptoAesFree(otCryptoContext *aContext)
|
Libera il contesto AES.
|
otPlatCryptoAesInit(otCryptoContext *aContext)
|
Inizializzare l'operazione AES.
|
otPlatCryptoAesSetKey(otCryptoContext *aContext, const otCryptoKey *aKey)
|
Imposta la chiave per il funzionamento dell'algoritmo AES.
|
otPlatCryptoDestroyKey(otCryptoKeyRef aKeyRef)
|
Elimina una chiave archiviata in PSA ITS.
|
otPlatCryptoExportKey(otCryptoKeyRef aKeyRef, uint8_t *aBuffer, size_t aBufferLen, size_t *aKeyLen)
|
Esporta una chiave archiviata in PSA ITS.
|
otPlatCryptoHasKey(otCryptoKeyRef aKeyRef)
|
bool
Verifica se il riferimento della chiave trasmesso ha una chiave associata in PSA ITS.
|
otPlatCryptoHkdfDeinit(otCryptoContext *aContext)
|
Annulla l'inizializzazione del contesto HKDF.
|
otPlatCryptoHkdfExpand(otCryptoContext *aContext, const uint8_t *aInfo, uint16_t aInfoLength, uint8_t *aOutputKey, uint16_t aOutputKeyLength)
|
Esegui il passaggio di espansione HKDF.
|
otPlatCryptoHkdfExtract(otCryptoContext *aContext, const uint8_t *aSalt, uint16_t aSaltLength, const otCryptoKey *aInputKey)
|
Esegui il passaggio di estrazione HKDF.
|
otPlatCryptoHkdfInit(otCryptoContext *aContext)
|
Inizializzare il contesto HKDF.
|
otPlatCryptoHmacSha256Deinit(otCryptoContext *aContext)
|
Annulla l'inizializzazione dell'operazione HMAC.
|
otPlatCryptoHmacSha256Finish(otCryptoContext *aContext, uint8_t *aBuf, size_t aBufLength)
|
Completa l'operazione HMAC.
|
otPlatCryptoHmacSha256Init(otCryptoContext *aContext)
|
Inizializzare l'operazione HMAC.
|
otPlatCryptoHmacSha256Start(otCryptoContext *aContext, const otCryptoKey *aKey)
|
Avvia operazione HMAC.
|
otPlatCryptoHmacSha256Update(otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength)
|
Aggiorna l'operazione HMAC con il nuovo input.
|
otPlatCryptoImportKey(otCryptoKeyRef *aKeyRef, otCryptoKeyType aKeyType, otCryptoKeyAlgorithm aKeyAlgorithm, int aKeyUsage, otCryptoKeyStorage aKeyPersistence, const uint8_t *aKey, size_t aKeyLen)
|
Importa una chiave in PSA ITS.
|
otPlatCryptoInit(void)
|
void
Inizializza il modulo Crittografia.
|
otPlatCryptoRandomDeinit(void)
|
void
DeInizializza il generatore di numeri pseudocasuali con protezione crittografica (CSPRNG).
|
otPlatCryptoRandomGet(uint8_t *aBuffer, uint16_t aSize)
|
Riempi un determinato buffer con byte casuali crittografici sicuri.
|
otPlatCryptoRandomInit(void)
|
void
Inizializza un generatore di numeri pseudocasuali con protezione crittografica (CSPRNG).
|
otPlatCryptoSha256Deinit(otCryptoContext *aContext)
|
Annulla l'inizializzazione dell'operazione SHA-256.
|
otPlatCryptoSha256Finish(otCryptoContext *aContext, uint8_t *aHash, uint16_t aHashSize)
|
Completa l'operazione SHA-256.
|
otPlatCryptoSha256Init(otCryptoContext *aContext)
|
Inizializza l'operazione SHA-256.
|
otPlatCryptoSha256Start(otCryptoContext *aContext)
|
Avvia l'operazione SHA-256.
|
otPlatCryptoSha256Update(otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength)
|
Aggiorna l'operazione SHA-256 con il nuovo input.
|
Punti ristoro |
|
---|---|
otCryptoContext |
Questa struttura archivia l'oggetto di contesto per le API della piattaforma. |
otCryptoKey |
Questa struttura rappresenta il materiale delle chiavi richiesto per le operazioni crittografiche. |
Enumerazioni
enumerazione anonima
anonymous enum
Questa enumerazione definisce i flag di utilizzo delle chiavi.
Proprietà | |
---|---|
OT_CRYPTO_KEY_USAGE_DECRYPT
|
Utilizzo chiave: ECB AES. |
OT_CRYPTO_KEY_USAGE_ENCRYPT
|
Utilizzo chiave: crittografia (definita dal fornitore). |
OT_CRYPTO_KEY_USAGE_EXPORT
|
Utilizzo chiave: la chiave può essere esportata. |
OT_CRYPTO_KEY_USAGE_NONE
|
Utilizzo chiave: l'utilizzo della chiave è vuoto. |
OT_CRYPTO_KEY_USAGE_SIGN_HASH
|
Utilizzo chiave: HMAC SHA-256. |
otCryptoKeyAlgorithm
otCryptoKeyAlgorithm
Questa enumerazione definisce gli algoritmi delle chiavi.
Proprietà | |
---|---|
OT_CRYPTO_KEY_ALG_AES_ECB
|
Algoritmo chiave: ECB AES. |
OT_CRYPTO_KEY_ALG_HMAC_SHA_256
|
Algoritmo chiave: HMAC SHA-256. |
OT_CRYPTO_KEY_ALG_VENDOR
|
Algoritmo chiave: definito dal fornitore. |
otCryptoKeyStorage
otCryptoKeyStorage
Questa enumerazione definisce i tipi di archiviazione delle chiavi.
Proprietà | |
---|---|
OT_CRYPTO_KEY_STORAGE_PERSISTENT
|
Persistenza della chiave: la chiave è persistente. |
OT_CRYPTO_KEY_STORAGE_VOLATILE
|
Persistenza delle chiavi: la chiave è volatile. |
otCryptoKeyType
otCryptoKeyType
Questa enumerazione definisce i tipi di chiavi.
Proprietà | |
---|---|
OT_CRYPTO_KEY_TYPE_AES
|
Tipo di chiave: AES. |
OT_CRYPTO_KEY_TYPE_HMAC
|
Tipo di chiave: HMAC. |
OT_CRYPTO_KEY_TYPE_RAW
|
Tipo di chiave: dati non elaborati. |
Typedef
otCryptoContext
struct otCryptoContext otCryptoContext
OtCryptoKey
struct otCryptoKey otCryptoKey
otCryptoKeyRef
uint32_t otCryptoKeyRef
Questo tipo di dati rappresenta il riferimento per la chiave.
Functions
otPlatCryptoAesEncrypt
otError otPlatCryptoAesEncrypt( otCryptoContext *aContext, const uint8_t *aInput, uint8_t *aOutput )
Cripta i dati forniti.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoAesFree
otError otPlatCryptoAesFree( otCryptoContext *aContext )
Libera il contesto AES.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoAesInit
otError otPlatCryptoAesInit( otCryptoContext *aContext )
Inizializzare l'operazione AES.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otPlatCryptoAesSetKey
otError otPlatCryptoAesSetKey( otCryptoContext *aContext, const otCryptoKey *aKey )
Imposta la chiave per il funzionamento dell'algoritmo AES.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
OtPlatCryptoDestroyKey
otError otPlatCryptoDestroyKey( otCryptoKeyRef aKeyRef )
Elimina una chiave archiviata in PSA ITS.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Valori restituiti |
|
Chiave otPlatCryptoExport
otError otPlatCryptoExportKey( otCryptoKeyRef aKeyRef, uint8_t *aBuffer, size_t aBufferLen, size_t *aKeyLen )
Esporta una chiave archiviata in PSA ITS.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otPlatCryptoHasKey
bool otPlatCryptoHasKey( otCryptoKeyRef aKeyRef )
Verifica se il riferimento della chiave trasmesso ha una chiave associata in PSA ITS.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Valori restituiti |
|
otPlatCryptoHkdfDeinit
otError otPlatCryptoHkdfDeinit( otCryptoContext *aContext )
Annulla l'inizializzazione del contesto HKDF.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoHkdfEspandi
otError otPlatCryptoHkdfExpand( otCryptoContext *aContext, const uint8_t *aInfo, uint16_t aInfoLength, uint8_t *aOutputKey, uint16_t aOutputKeyLength )
Esegui il passaggio di espansione HKDF.
Dettagli | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||
Valori restituiti |
|
otPlatCryptoHkdfEstratto
otError otPlatCryptoHkdfExtract( otCryptoContext *aContext, const uint8_t *aSalt, uint16_t aSaltLength, const otCryptoKey *aInputKey )
Esegui il passaggio di estrazione HKDF.
Dettagli | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||
Valori restituiti |
|
otPlatCryptoHkdfInit
otError otPlatCryptoHkdfInit( otCryptoContext *aContext )
Inizializzare il contesto HKDF.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoHmacSha256Deinit
otError otPlatCryptoHmacSha256Deinit( otCryptoContext *aContext )
Annulla l'inizializzazione dell'operazione HMAC.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoHmacSha256Fine
otError otPlatCryptoHmacSha256Finish( otCryptoContext *aContext, uint8_t *aBuf, size_t aBufLength )
Completa l'operazione HMAC.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoHmacSha256Init
otError otPlatCryptoHmacSha256Init( otCryptoContext *aContext )
Inizializzare l'operazione HMAC.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoHmacSha256Start
otError otPlatCryptoHmacSha256Start( otCryptoContext *aContext, const otCryptoKey *aKey )
Avvia operazione HMAC.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoHmacSha256Update
otError otPlatCryptoHmacSha256Update( otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength )
Aggiorna l'operazione HMAC con il nuovo input.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoImportKey
otError otPlatCryptoImportKey( otCryptoKeyRef *aKeyRef, otCryptoKeyType aKeyType, otCryptoKeyAlgorithm aKeyAlgorithm, int aKeyUsage, otCryptoKeyStorage aKeyPersistence, const uint8_t *aKey, size_t aKeyLen )
Importa una chiave in PSA ITS.
Nota: se la chiave OT_CRYPTO_KEY_STORAGE_PERSISTENT viene trasmessa per AKeyPersistence, aKeyRef
viene inserito e la piattaforma deve utilizzare il valore AKeyRef specificato e DEVE non modificarlo.
Se OT_CRYPTO_KEY_STORAGE_VOLATILE viene trasmesso per una chiave di chiave, viene restituito aKeyRef
e il valore iniziale non è rilevante, mentre l'API della piattaforma DEVE aggiornarlo per restituire il nuovo riferimento chiave.
Dettagli | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametri |
|
||||||||||||||
Valori restituiti |
|
Questa API viene utilizzata dal core OT solo quando OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
è abilitato.
otPlatCryptoInit
void otPlatCryptoInit( void )
Inizializza il modulo Crittografia.
otPlatCryptoShuffleDeinit
void otPlatCryptoRandomDeinit( void )
DeInizializza il generatore di numeri pseudocasuali con protezione crittografica (CSPRNG).
otPlatCryptorandomGet
otError otPlatCryptoRandomGet( uint8_t *aBuffer, uint16_t aSize )
Riempi un determinato buffer con byte casuali crittografici sicuri.
Dettagli | |||||
---|---|---|---|---|---|
Parametri |
|
||||
Valori restituiti |
|
otPlatCryptorandomInit
void otPlatCryptoRandomInit( void )
Inizializza un generatore di numeri pseudocasuali con protezione crittografica (CSPRNG).
otPlatCryptoSha256Deinit
otError otPlatCryptoSha256Deinit( otCryptoContext *aContext )
Annulla l'inizializzazione dell'operazione SHA-256.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoSha256Fine
otError otPlatCryptoSha256Finish( otCryptoContext *aContext, uint8_t *aHash, uint16_t aHashSize )
Completa l'operazione SHA-256.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoSha256Init
otError otPlatCryptoSha256Init( otCryptoContext *aContext )
Inizializza l'operazione SHA-256.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoSha256Avvia
otError otPlatCryptoSha256Start( otCryptoContext *aContext )
Avvia l'operazione SHA-256.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
otPlatCryptoSha256Update
otError otPlatCryptoSha256Update( otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength )
Aggiorna l'operazione SHA-256 con il nuovo input.
Dettagli | |||||||
---|---|---|---|---|---|---|---|
Parametri |
|
||||||
Valori restituiti |
|
Risorse
Gli argomenti di riferimento dell'API OpenThread provengono dal codice sorgente, disponibile su GitHub. Per ulteriori informazioni, o per contribuire alla nostra documentazione, consulta la pagina Risorse.