암호화 - 플랫폼
이 모듈에는 Crypto의 플랫폼 추상화가 포함됩니다.
요약
열거 |
|
---|---|
anonymous enum{
|
enum 이 열거형은 키 사용 플래그를 정의합니다. |
otCryptoKeyAlgorithm{
|
enum 이 열거는 키 알고리즘을 정의합니다. |
otCryptoKeyStorage{
|
enum 이 열거형은 키 저장소 유형을 정의합니다. |
otCryptoKeyType{
|
enum 이 열거형은 키 유형을 정의합니다. |
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 |
이 구조는 암호화 작업에 필요한 키 자료를 나타냅니다. |
열거
익명 enum
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 |
otCryptoKeyAlgorithm
otCryptoKeyAlgorithm
이 열거는 키 알고리즘을 정의합니다.
속성 | |
---|---|
OT_CRYPTO_KEY_ALG_AES_ECB
|
키 알고리즘: AES ECB. |
OT_CRYPTO_KEY_ALG_HMAC_SHA_256
|
키 알고리즘: HMAC SHA-256 |
OT_CRYPTO_KEY_ALG_VENDOR
|
주요 알고리즘: 공급업체 정의. |
otCryptoKeyStorage
otCryptoKeyStorage
이 열거형은 키 저장소 유형을 정의합니다.
속성 | |
---|---|
OT_CRYPTO_KEY_STORAGE_PERSISTENT
|
키 지속성: 키는 영구적입니다. |
OT_CRYPTO_KEY_STORAGE_VOLATILE
|
키 지속성: 키가 휘발성입니다. |
otCryptoKeyType
otCryptoKeyType
이 열거형은 키 유형을 정의합니다.
속성 | |
---|---|
OT_CRYPTO_KEY_TYPE_AES
|
키 유형: AES |
OT_CRYPTO_KEY_TYPE_HMAC
|
키 유형: HMAC |
OT_CRYPTO_KEY_TYPE_RAW
|
키 유형: 원시 데이터 |
Typedef
otCryptoContext
struct otCryptoContext otCryptoContext
otCryptoKey
struct otCryptoKey otCryptoKey
otCryptoKeyRef
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 작업을 초기화합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otPlatCryptoHmacSha256시작
otError otPlatCryptoHmacSha256Start( otCryptoContext *aContext, const otCryptoKey *aKey )
HMAC 작업을 시작합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otPlatCryptoHmacSha256업데이트
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로 가져옵니다.
참고: aKeyPersistence에 OT_CRYPTO_KEY_STORAGE_PERSISTENT가 전달되는 경우 aKeyRef
는 입력이며 플랫폼은 주어진 aKeyRef를 사용해야 하며 이 값을 변경하면 안 됩니다(MUST NOT).
aKeyPersistence에 OT_CRYPTO_KEY_STORAGE_VOLATILE이 전달되면 aKeyRef
가 출력되고 초 the값은 문제가 되지 않으며 플랫폼 API가 새 키 참조를 반환하도록 업데이트해야 합니다(MUST).
세부정보 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||||||
반환 값 |
|
이 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 작업을 초기화합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otPlatCryptoSha256시작
otError otPlatCryptoSha256Start( otCryptoContext *aContext )
SHA-256 작업을 시작합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otPlatCryptoSha256업데이트
otError otPlatCryptoSha256Update( otCryptoContext *aContext, const void *aBuf, uint16_t aBufLength )
새 입력으로 SHA-256 작업을 업데이트합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
리소스
OpenThread API 참조 주제는 GitHub에서 제공되는 소스 코드에서 시작됩니다. 자세한 내용을 알아보거나 문서에 기여하려면 리소스를 참조하세요.