暗号 - プラットフォーム
このモジュールには、暗号のプラットフォーム抽象化が含まれています。
概要
列挙型 |
|
---|---|
anonymous enum{
|
列挙型 この列挙型は、キー用途フラグを定義します。 |
otCryptoKeyAlgorithm{
|
列挙型 この列挙型は、鍵アルゴリズムを定義します。 |
otCryptoKeyStorage{
|
列挙型 この列挙型は、主なストレージ タイプを定義します。 |
otCryptoKeyType{
|
列挙型 この列挙型は、鍵タイプを定義します。 |
Typedef |
|
---|---|
otCryptoContext
|
typedefstruct otCryptoContext
|
otCryptoKey
|
typedefstruct otCryptoKey
|
otCryptoKeyRef
|
typedefuint32_t
このデータ型はキー参照を表します。 |
関数 |
|
---|---|
otPlatCryptoAesEncrypt(otCryptoContext *aContext, const uint8_t *aInput, uint8_t *aOutput)
|
特定のデータを暗号化します。
|
otPlatCryptoAesFree(otCryptoContext *aContext)
|
AES コンテキストを解放します。
|
otPlatCryptoAesInit(otCryptoContext *aContext)
|
AES オペレーションを初期化します。
|
otPlatCryptoAesSetKey(otCryptoContext *aContext, const otCryptoKey *aKey)
|
AES オペレーションのキーを設定します。
|
otPlatCryptoDestroyKey(otCryptoKeyRef aKeyRef)
|
PSA ITS に保存されている鍵を破棄する。
|
otPlatCryptoExportKey(otCryptoKeyRef aKeyRef, uint8_t *aBuffer, size_t aBufferLen, size_t *aKeyLen)
|
PSA ITS に保存されている鍵をエクスポートします。
|
otPlatCryptoHasKey(otCryptoKeyRef aKeyRef)
|
bool
渡されたキー参照に PSA ITS のキーが関連付けられているかどうかを確認します。
|
otPlatCryptoHkdfDeinit(otCryptoContext *aContext)
|
HKDF コンテキストの初期化を解除します。
|
otPlatCryptoHkdfExpand(otCryptoContext *aContext, const uint8_t *aInfo, uint16_t aInfoLength, uint8_t *aOutputKey, uint16_t aOutputKeyLength)
|
HKDF 展開手順を実行します。
|
otPlatCryptoHkdfExtract(otCryptoContext *aContext, const uint8_t *aSalt, uint16_t aSaltLength, const otCryptoKey *aInputKey)
|
HKDF 抽出ステップを実行します。
|
otPlatCryptoHkdfInit(otCryptoContext *aContext)
|
HKDF コンテキストを初期化します。
|
otPlatCryptoHmacSha256Deinit(otCryptoContext *aContext)
|
HMAC オペレーションを初期化解除します。
|
otPlatCryptoHmacSha256Finish(otCryptoContext *aContext, uint8_t *aBuf, size_t aBufLength)
|
HMAC オペレーションを完了します。
|
otPlatCryptoHmacSha256Init(otCryptoContext *aContext)
|
HMAC オペレーションを初期化します。
|
otPlatCryptoHmacSha256Start(otCryptoContext *aContext, const otCryptoKey *aKey)
|
HMAC オペレーションを開始します。
|
otPlatCryptoHmacSha256Update(otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength)
|
新しい入力で HMAC オペレーションを更新します。
|
otPlatCryptoImportKey(otCryptoKeyRef *aKeyRef, otCryptoKeyType aKeyType, otCryptoKeyAlgorithm aKeyAlgorithm, int aKeyUsage, otCryptoKeyStorage aKeyPersistence, const uint8_t *aKey, size_t aKeyLen)
|
PSA ITS に鍵をインポートします。
|
otPlatCryptoInit(void)
|
void
Crypto モジュールを初期化します。
|
otPlatCryptoRandomDeinit(void)
|
void
暗号的に安全な疑似乱数生成ツール(CSPRNG)の初期化を解除します。
|
otPlatCryptoRandomGet(uint8_t *aBuffer, uint16_t aSize)
|
バッファに暗号による安全なランダムバイトを格納します。
|
otPlatCryptoRandomInit(void)
|
void
暗号的に安全な疑似乱数生成ツール(CSPRNG)を初期化します。
|
otPlatCryptoSha256Deinit(otCryptoContext *aContext)
|
SHA-256 操作を初期化解除します。
|
otPlatCryptoSha256Finish(otCryptoContext *aContext, uint8_t *aHash, uint16_t aHashSize)
|
SHA-256 の操作を終了します。
|
otPlatCryptoSha256Init(otCryptoContext *aContext)
|
SHA-256 オペレーションを初期化します。
|
otPlatCryptoSha256Start(otCryptoContext *aContext)
|
SHA-256 の操作を開始します。
|
otPlatCryptoSha256Update(otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength)
|
新しい入力で SHA-256 演算を更新してください。
|
構造体 |
|
---|---|
otCryptoContext |
この構造体には、プラットフォーム API のコンテキスト オブジェクトが格納されます。 |
otCryptoKey |
この構造は、暗号オペレーションに必要な鍵マテリアルを表します。 |
列挙型
匿名列挙型
anonymous enum
この列挙型は、キー用途フラグを定義します。
プロパティ | |
---|---|
OT_CRYPTO_KEY_USAGE_DECRYPT
|
鍵の用途: AES ECB。 |
OT_CRYPTO_KEY_USAGE_ENCRYPT
|
鍵の用途: 暗号化(ベンダー定義)。 |
OT_CRYPTO_KEY_USAGE_EXPORT
|
鍵の用途: 鍵をエクスポートできます。 |
OT_CRYPTO_KEY_USAGE_NONE
|
鍵の用途: 鍵の用途が空です。 |
OT_CRYPTO_KEY_USAGE_SIGN_HASH
|
鍵の用途: HMAC SHA-256。 |
otPlaceholderAlgorithm
otCryptoKeyAlgorithm
この列挙型は、鍵アルゴリズムを定義します。
プロパティ | |
---|---|
OT_CRYPTO_KEY_ALG_AES_ECB
|
鍵アルゴリズム: AES ECB。 |
OT_CRYPTO_KEY_ALG_HMAC_SHA_256
|
鍵アルゴリズム: HMAC SHA-256 |
OT_CRYPTO_KEY_ALG_VENDOR
|
鍵アルゴリズム: ベンダー定義。 |
otDrawableStorage
otCryptoKeyStorage
この列挙型は、主なストレージ タイプを定義します。
プロパティ | |
---|---|
OT_CRYPTO_KEY_STORAGE_PERSISTENT
|
キーの永続性: キーは永続的です。 |
OT_CRYPTO_KEY_STORAGE_VOLATILE
|
キーの永続性: キーは揮発性です。 |
OT 暗号鍵のタイプ
otCryptoKeyType
この列挙型は、鍵タイプを定義します。
プロパティ | |
---|---|
OT_CRYPTO_KEY_TYPE_AES
|
キータイプ: AES |
OT_CRYPTO_KEY_TYPE_HMAC
|
キータイプ: HMAC |
OT_CRYPTO_KEY_TYPE_RAW
|
キータイプ: 元データ |
Typedef
otCryptoContext
struct otCryptoContext otCryptoContext
OT 暗号鍵
struct otCryptoKey otCryptoKey
otPlaceholderRef
uint32_t otCryptoKeyRef
このデータ型はキー参照を表します。
関数
otPlatCryptoAesEncrypt
otError otPlatCryptoAesEncrypt( otCryptoContext *aContext, const uint8_t *aInput, uint8_t *aOutput )
特定のデータを暗号化します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoAesFree
otError otPlatCryptoAesFree( otCryptoContext *aContext )
AES コンテキストを解放します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoAesInit
otError otPlatCryptoAesInit( otCryptoContext *aContext )
AES オペレーションを初期化します。
詳細 | |||||||||
---|---|---|---|---|---|---|---|---|---|
パラメータ |
|
||||||||
戻り値 |
|
otPlatCryptoAesSetKey
otError otPlatCryptoAesSetKey( otCryptoContext *aContext, const otCryptoKey *aKey )
AES オペレーションのキーを設定します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoDestroyKey
otError otPlatCryptoDestroyKey( otCryptoKeyRef aKeyRef )
PSA ITS に保存されている鍵を破棄する。
詳細 | |||||
---|---|---|---|---|---|
パラメータ |
|
||||
戻り値 |
|
otPlatCryptoExportKey
otError otPlatCryptoExportKey( otCryptoKeyRef aKeyRef, uint8_t *aBuffer, size_t aBufferLen, size_t *aKeyLen )
PSA ITS に保存されている鍵をエクスポートします。
詳細 | |||||||||
---|---|---|---|---|---|---|---|---|---|
パラメータ |
|
||||||||
戻り値 |
|
otPlatCryptoHasKey
bool otPlatCryptoHasKey( otCryptoKeyRef aKeyRef )
渡されたキー参照に PSA ITS のキーが関連付けられているかどうかを確認します。
詳細 | |||||
---|---|---|---|---|---|
パラメータ |
|
||||
戻り値 |
|
otPlatCryptoHkdfDeinit
otError otPlatCryptoHkdfDeinit( otCryptoContext *aContext )
HKDF コンテキストの初期化を解除します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoHkdfExpand
otError otPlatCryptoHkdfExpand( otCryptoContext *aContext, const uint8_t *aInfo, uint16_t aInfoLength, uint8_t *aOutputKey, uint16_t aOutputKeyLength )
HKDF 展開手順を実行します。
詳細 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
パラメータ |
|
||||||||||
戻り値 |
|
otPlatCryptoHkdfExtract
otError otPlatCryptoHkdfExtract( otCryptoContext *aContext, const uint8_t *aSalt, uint16_t aSaltLength, const otCryptoKey *aInputKey )
HKDF 抽出ステップを実行します。
詳細 | |||||||||
---|---|---|---|---|---|---|---|---|---|
パラメータ |
|
||||||||
戻り値 |
|
otPlatCryptoHkdfInit
otError otPlatCryptoHkdfInit( otCryptoContext *aContext )
HKDF コンテキストを初期化します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoHmacSha256Deinit(英語)
otError otPlatCryptoHmacSha256Deinit( otCryptoContext *aContext )
HMAC オペレーションを初期化解除します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoHmacSha256Finish
otError otPlatCryptoHmacSha256Finish( otCryptoContext *aContext, uint8_t *aBuf, size_t aBufLength )
HMAC オペレーションを完了します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoHmacSha256Init
otError otPlatCryptoHmacSha256Init( otCryptoContext *aContext )
HMAC オペレーションを初期化します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoHmacSha256Start
otError otPlatCryptoHmacSha256Start( otCryptoContext *aContext, const otCryptoKey *aKey )
HMAC オペレーションを開始します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoHmacSha256Update
otError otPlatCryptoHmacSha256Update( otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength )
新しい入力で HMAC オペレーションを更新します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoImportKey
otError otPlatCryptoImportKey( otCryptoKeyRef *aKeyRef, otCryptoKeyType aKeyType, otCryptoKeyAlgorithm aKeyAlgorithm, int aKeyUsage, otCryptoKeyStorage aKeyPersistence, const uint8_t *aKey, size_t aKeyLen )
PSA ITS に鍵をインポートします。
注: OT_CRYPTO_KEY_STORAGE_PERSISTENT が aKeyPersistence に渡された場合、aKeyRef
が入力されるため、プラットフォームは指定された aKeyRef を使用する必要があり、変更してはなりません。
OT_CRYPTO_KEY_STORAGE_VOLATILE が aKeyPersistence に渡された場合、aKeyRef
が出力されます。初期値は重要でないため、プラットフォーム API は新しいキー参照を返すように更新する必要があります。
詳細 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
パラメータ |
|
||||||||||||||
戻り値 |
|
この API は、OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
が有効になっている場合、OT Core でのみ使用されます。
otPlatCryptoInit
void otPlatCryptoInit( void )
Crypto モジュールを初期化します。
otPlatCryptoRandomDeinit
void otPlatCryptoRandomDeinit( void )
暗号的に安全な疑似乱数生成ツール(CSPRNG)の初期化を解除します。
otPlatCryptoRandomGet(オットラットの暗号ランダム化)
otError otPlatCryptoRandomGet( uint8_t *aBuffer, uint16_t aSize )
バッファに暗号による安全なランダムバイトを格納します。
詳細 | |||||
---|---|---|---|---|---|
パラメータ |
|
||||
戻り値 |
|
otPlatCryptoRandomInit
void otPlatCryptoRandomInit( void )
暗号的に安全な疑似乱数生成ツール(CSPRNG)を初期化します。
otPlatCryptoSha256Deinit
otError otPlatCryptoSha256Deinit( otCryptoContext *aContext )
SHA-256 操作を初期化解除します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoSha256Finish
otError otPlatCryptoSha256Finish( otCryptoContext *aContext, uint8_t *aHash, uint16_t aHashSize )
SHA-256 の操作を終了します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoSha256Init(認証プロトコル)
otError otPlatCryptoSha256Init( otCryptoContext *aContext )
SHA-256 オペレーションを初期化します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoSha256Start(開始)
otError otPlatCryptoSha256Start( otCryptoContext *aContext )
SHA-256 の操作を開始します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otPlatCryptoSha256Update(更新)
otError otPlatCryptoSha256Update( otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength )
新しい入力で SHA-256 演算を更新してください。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
リソース
OpenThread API リファレンスのトピックは、GitHub で入手可能なソースコードに基づいています。 詳細またはドキュメントへの投稿については、リソースをご覧ください。