nl:: 編織:: Crypto
此命名空間包含 Weave 內所有支援共用加密支援的介面。
總結
列舉 |
|
---|---|
X963EncodedPointFormat
|
列舉 |
Typedefs |
|
---|---|
AES128CTRDRBG
|
typedef |
AES128CTRMode
|
typedef |
AES256CTRMode
|
typedef |
EntropyFunct)(uint8_t *buf, size_t bufSize)
|
typedefint(*
用來收集熵來源隨機資料的函式簽章。 |
HKDFSHA1
|
typedef |
HKDFSHA256
|
typedef |
HMACSHA1
|
typedef |
HMACSHA256
|
typedef |
函式 |
|
---|---|
ClearSecretData(uint8_t *buf, uint32_t len)
|
NL_DLL_EXPORT void
清除記憶體區域「
buf 」的前 len 個位元組。 |
ConstantTimeCompare(const uint8_t *buf1, const uint8_t *buf2, uint16_t len)
|
bool
比較記憶體區域
buf1 和記憶體區域 buf2 的前 len 個位元組。 |
DecodeBIGNUMValueLE(BIGNUM & val, uint16_t size, const uint8_t *& p)
|
|
DecodeECDSASignature(const EncodedECDSASignature & encodedSig, ECDSA_SIG *& sig)
|
|
DecodeECKey(OID curveOID, const EncodedECPrivateKey *encodedPrivKey, const EncodedECPublicKey *encodedPubKey, EC_KEY *& ecKey)
|
NL_DLL_EXPORT WEAVE_ERROR
|
DecodeX962ECPoint(const uint8_t *encodedPoint, uint16_t encodedPointLen, EC_GROUP *group, EC_POINT *& point)
|
NL_DLL_EXPORT WEAVE_ERROR
|
DecodeX962ECPoint(const uint8_t *encodedPoint, uint16_t encodedPointLen, BIGNUM *& x, BIGNUM *& y)
|
|
ECDHComputeSharedSecret(OID curveOID, const EC_GROUP *ecGroup, const EC_POINT *pubKeyPoint, const BIGNUM *privKeyBN, uint8_t *sharedSecretBuf, uint16_t sharedSecretBufSize, uint16_t & sharedSecretLen)
|
NL_DLL_EXPORT WEAVE_ERROR
|
ECDHComputeSharedSecret(OID curveOID, const EncodedECPublicKey & encodedPubKey, const EncodedECPrivateKey & encodedPrivKey, uint8_t *sharedSecretBuf, uint16_t sharedSecretBufSize, uint16_t & sharedSecretLen)
|
|
ECDSASigToFixedLenSig(OID curveOID, const ECDSA_SIG *ecSig, uint8_t *fixedLenSig)
|
|
ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
|
void
|
ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
|
int
|
EncodeBIGNUMValueLE(const BIGNUM & val, uint16_t size, uint8_t *& p)
|
|
EncodeECDSASignature(const ECDSA_SIG *sig, EncodedECDSASignature & encodedSig)
|
|
EncodeX962ECPoint(OID curveOID, EC_GROUP *ecGroup, const EC_POINT *point, uint8_t *buf, uint16_t bufSize, uint16_t & encodedPointLen)
|
NL_DLL_EXPORT WEAVE_ERROR
|
FixedLenSigToECDSASig(OID curveOID, const uint8_t *fixedLenSig, ECDSA_SIG *& ecSig)
|
|
GenerateAndEncodeWeaveHMACSignature(OID sigAlgoOID, TLVWriter & writer, uint64_t tag, const uint8_t *data, uint16_t dataLen, const uint8_t *key, uint16_t keyLen)
|
產生並編碼 Weave HMAC 簽名。
|
GenerateAndEncodeWeaveRSASignature(OID sigAlgoOID, TLVWriter & writer, uint64_t tag, const uint8_t *hash, uint8_t hashLen, const uint8_t *keyDER, uint16_t keyDERLen)
|
產生並對 Weave RSA 簽名進行編碼。
|
GenerateECDHKey(OID curveOID, EncodedECPublicKey & encodedPubKey, EncodedECPrivateKey & encodedPrivKey)
|
|
GenerateECDSASignature(OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const EncodedECPrivateKey & encodedPrivKey, EncodedECDSASignature & encodedSig)
|
|
GenerateECDSASignature(OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const EncodedECPrivateKey & encodedPrivKey, uint8_t *fixedLenSig)
|
|
GetCurveG(OID curveOID, EncodedECPublicKey & encodedPubKey)
|
|
GetCurveSize(const OID curveOID, const EC_GROUP *ecGroup)
|
int
|
GetCurveSize(const OID curveOID)
|
int
取得橢圓曲線大小 (以位元組為單位)。
|
GetECGroupForCurve(OID curveOID, EC_GROUP *& ecGroup)
|
NL_DLL_EXPORT WEAVE_ERROR
|
ReverseBytes(uint8_t *buf, size_t len)
|
void
|
ShaNIDFromSigAlgoOID(OID sigAlgoOID)
|
int
|
VerifyECDSASignature(OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const EncodedECDSASignature & encodedSig, const EncodedECPublicKey & encodedPubKey)
|
|
VerifyECDSASignature(OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const uint8_t *fixedLenSig, const EncodedECPublicKey & encodedPubKey)
|
|
VerifyHMACSignature(OID sigAlgoOID, const uint8_t *data, uint16_t dataLen, const EncodedHMACSignature & sig, const uint8_t *key, uint16_t keyLen)
|
驗證 Weave HMAC 簽名。
|
VerifyRSASignature(OID sigAlgoOID, const uint8_t *hash, uint8_t hashLen, const EncodedRSASignature & sig, const uint8_t *certDER, uint16_t certDERLen)
|
驗證 Weave RSA 簽名。
|
列舉
X963EncodedPointFormat
X963EncodedPointFormat
Typedefs
AES128CTRDRBG
CTR_DRBG< Platform::Security::AES128BlockCipherEnc > AES128CTRDRBG
AES128CTRMode
CTRMode< Platform::Security::AES128BlockCipherEnc > AES128CTRMode
AES256CTRMode
CTRMode< Platform::Security::AES256BlockCipherEnc > AES256CTRMode
熵
int(* EntropyFunct)(uint8_t *buf, size_t bufSize)
用來收集熵來源隨機資料的函式簽章。
HKDFSHA1
HKDF< Platform::Security::SHA1 > HKDFSHA1
HKDFSHA256
HKDF< Platform::Security::SHA256 > HKDFSHA256
HMACSHA1
HMAC< Platform::Security::SHA1 > HMACSHA1
HMACSHA256
HMAC< Platform::Security::SHA256 > HMACSHA256
函式
ClearSecret 資料
NL_DLL_EXPORT void ClearSecretData( uint8_t *buf, uint32_t len )
清除記憶體區域「buf
」的前 len
個位元組。
在此實作中,記憶體區域「buf
」的前 len
個位元組有零。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
常數時間比較
bool ConstantTimeCompare( const uint8_t *buf1, const uint8_t *buf2, uint16_t len )
比較記憶體區域 buf1
和記憶體區域 buf2
的前 len
個位元組。
這個函式所需時間與記憶體區域 buf1
和 buf2
中的資料不同。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
解碼 BIGNUMValueLE
WEAVE_ERROR DecodeBIGNUMValueLE( BIGNUM & val, uint16_t size, const uint8_t *& p )
DecodeECDSA 簽名
WEAVE_ERROR DecodeECDSASignature( const EncodedECDSASignature & encodedSig, ECDSA_SIG *& sig )
解碼碼
NL_DLL_EXPORT WEAVE_ERROR DecodeECKey( OID curveOID, const EncodedECPrivateKey *encodedPrivKey, const EncodedECPublicKey *encodedPubKey, EC_KEY *& ecKey )
DecodeX962ECPoint
NL_DLL_EXPORT WEAVE_ERROR DecodeX962ECPoint( const uint8_t *encodedPoint, uint16_t encodedPointLen, EC_GROUP *group, EC_POINT *& point )
DecodeX962ECPoint
WEAVE_ERROR DecodeX962ECPoint( const uint8_t *encodedPoint, uint16_t encodedPointLen, BIGNUM *& x, BIGNUM *& y )
ECDHComputeSharedSecret
NL_DLL_EXPORT WEAVE_ERROR ECDHComputeSharedSecret( OID curveOID, const EC_GROUP *ecGroup, const EC_POINT *pubKeyPoint, const BIGNUM *privKeyBN, uint8_t *sharedSecretBuf, uint16_t sharedSecretBufSize, uint16_t & sharedSecretLen )
ECDHComputeSharedSecret
WEAVE_ERROR ECDHComputeSharedSecret( OID curveOID, const EncodedECPublicKey & encodedPubKey, const EncodedECPrivateKey & encodedPrivKey, uint8_t *sharedSecretBuf, uint16_t sharedSecretBufSize, uint16_t & sharedSecretLen )
ECDSASigToFixedLenSig
WEAVE_ERROR ECDSASigToFixedLenSig( OID curveOID, const ECDSA_SIG *ecSig, uint8_t *fixedLenSig )
ECDSA_SIG_get0
void ECDSA_SIG_get0( const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps )
ECDSA_SIG_set0
int ECDSA_SIG_set0( ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s )
編碼 BIGNUMValueLE
WEAVE_ERROR EncodeBIGNUMValueLE( const BIGNUM & val, uint16_t size, uint8_t *& p )
EncodeECDSA 簽名
WEAVE_ERROR EncodeECDSASignature( const ECDSA_SIG *sig, EncodedECDSASignature & encodedSig )
EncodeX962ECPoint
NL_DLL_EXPORT WEAVE_ERROR EncodeX962ECPoint( OID curveOID, EC_GROUP *ecGroup, const EC_POINT *point, uint8_t *buf, uint16_t bufSize, uint16_t & encodedPointLen )
已修正:LenSigToECDSASig
WEAVE_ERROR FixedLenSigToECDSASig( OID curveOID, const uint8_t *fixedLenSig, ECDSA_SIG *& ecSig )
產生 AndEncodeWeaveHMAC 簽名
WEAVE_ERROR GenerateAndEncodeWeaveHMACSignature( OID sigAlgoOID, TLVWriter & writer, uint64_t tag, const uint8_t *data, uint16_t dataLen, const uint8_t *key, uint16_t keyLen )
產生並編碼 Weave HMAC 簽名。
使用密鑰計算指定資料的 HMAC 簽名,並將簽名做為 Weave HMACSignature 結構寫入指定的 TLV 寫入器和指定標記。
詳細資料 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||||
傳回值 |
|
產生及編碼 WeaveRSASignature
WEAVE_ERROR GenerateAndEncodeWeaveRSASignature( OID sigAlgoOID, TLVWriter & writer, uint64_t tag, const uint8_t *hash, uint8_t hashLen, const uint8_t *keyDER, uint16_t keyDERLen )
產生並對 Weave RSA 簽名進行編碼。
使用指定的 X509 編碼 RSA 私密金鑰和郵件雜湊來計算 RSA 簽名,並將簽名以 Weave RSASignature 結構寫入指定的標記 TLV 寫入器中。
詳細資料 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||||
傳回值 |
|
產生 ECDHKey
WEAVE_ERROR GenerateECDHKey( OID curveOID, EncodedECPublicKey & encodedPubKey, EncodedECPrivateKey & encodedPrivKey )
GenerateECDSA 簽名
WEAVE_ERROR GenerateECDSASignature( OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const EncodedECPrivateKey & encodedPrivKey, EncodedECDSASignature & encodedSig )
GenerateECDSA 簽名
WEAVE_ERROR GenerateECDSASignature( OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const EncodedECPrivateKey & encodedPrivKey, uint8_t *fixedLenSig )
GetCurveG
WEAVE_ERROR GetCurveG( OID curveOID, EncodedECPublicKey & encodedPubKey )
GetCurveSize
int GetCurveSize( const OID curveOID, const EC_GROUP *ecGroup )
GetCurveSize
int GetCurveSize( const OID curveOID )
取得橢圓曲線大小 (以位元組為單位)。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回值 |
|
GetECGroupForCurve
NL_DLL_EXPORT WEAVE_ERROR GetECGroupForCurve( OID curveOID, EC_GROUP *& ecGroup )
反向位元組數
void ReverseBytes( uint8_t *buf, size_t len )
ShaNIDFromSigAlgoOID
int ShaNIDFromSigAlgoOID( OID sigAlgoOID )
驗證 ECDSA 簽名
WEAVE_ERROR VerifyECDSASignature( OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const EncodedECDSASignature & encodedSig, const EncodedECPublicKey & encodedPubKey )
驗證 ECDSA 簽名
WEAVE_ERROR VerifyECDSASignature( OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const uint8_t *fixedLenSig, const EncodedECPublicKey & encodedPubKey )
驗證 HMAC 簽名
WEAVE_ERROR VerifyHMACSignature( OID sigAlgoOID, const uint8_t *data, uint16_t dataLen, const EncodedHMACSignature & sig, const uint8_t *key, uint16_t keyLen )
驗證 Weave HMAC 簽名。
使用指定資料和一組金鑰來驗證簽名,藉此驗證 HMAC 簽名。
詳細資料 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
傳回值 |
|
驗證 RSA 簽名
WEAVE_ERROR VerifyRSASignature( OID sigAlgoOID, const uint8_t *hash, uint8_t hashLen, const EncodedRSASignature & sig, const uint8_t *certDER, uint16_t certDERLen )
驗證 Weave RSA 簽名。
使用指定的資料雜湊和 X509 編碼的 RSA 憑證,驗證要用於驗證簽章的 RSA 簽名。
詳細資料 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
傳回值 |
|