nl:: Weave:: Mã hóa
Vùng chứa tên này bao gồm tất cả giao diện trong Weave để hỗ trợ mật mã dùng chung.
Tóm tắt
Bảng liệt kê |
|
---|---|
X963EncodedPointFormat
|
enum |
Typedef |
|
---|---|
AES128CTRDRBG
|
typedef |
AES128CTRMode
|
typedef |
AES256CTRMode
|
typedef |
EntropyFunct)(uint8_t *buf, size_t bufSize)
|
typedefint(*
Chữ ký của một hàm dùng để thu thập dữ liệu ngẫu nhiên từ một nguồn entropy. |
HKDFSHA1
|
typedef |
HKDFSHA256
|
typedef |
HMACSHA1
|
typedef |
HMACSHA256
|
typedef |
Hàm |
|
---|---|
ClearSecretData(uint8_t *buf, uint32_t len)
|
NL_DLL_EXPORT void
Xóa
len byte đầu tiên của vùng bộ nhớ buf . |
ConstantTimeCompare(const uint8_t *buf1, const uint8_t *buf2, uint16_t len)
|
bool
So sánh
len byte đầu tiên của vùng bộ nhớ buf1 và vùng bộ nhớ buf2 . |
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)
|
Tạo và mã hóa chữ ký HMAC của Weave.
|
GenerateAndEncodeWeaveRSASignature(OID sigAlgoOID, TLVWriter & writer, uint64_t tag, const uint8_t *hash, uint8_t hashLen, const uint8_t *keyDER, uint16_t keyDERLen)
|
Tạo và mã hóa chữ ký Wesve 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
Nhận kích thước đường cong hình elip (tính bằng byte).
|
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)
|
Xác minh chữ ký Weave HMAC.
|
VerifyRSASignature(OID sigAlgoOID, const uint8_t *hash, uint8_t hashLen, const EncodedRSASignature & sig, const uint8_t *certDER, uint16_t certDERLen)
|
Xác minh chữ ký Weave RSA.
|
Bảng liệt kê
X963EnEncodingPointFormat
X963EncodedPointFormat
Typedef
AES128CTRDRBG
CTR_DRBG< Platform::Security::AES128BlockCipherEnc > AES128CTRDRBG
Chế độ AES128CTRMode
CTRMode< Platform::Security::AES128BlockCipherEnc > AES128CTRMode
Chế độ AES256CTRMode
CTRMode< Platform::Security::AES256BlockCipherEnc > AES256CTRMode
Tác phẩm EntropyFunct
int(* EntropyFunct)(uint8_t *buf, size_t bufSize)
Chữ ký của một hàm dùng để thu thập dữ liệu ngẫu nhiên từ một nguồn entropy.
HKDFSHA1
HKDF< Platform::Security::SHA1 > HKDFSHA1
HKDFSHA256
HKDF< Platform::Security::SHA256 > HKDFSHA256
Hàm MACMAC1
HMAC< Platform::Security::SHA1 > HMACSHA1
HMACSHA256
HMAC< Platform::Security::SHA256 > HMACSHA256
Hàm
Dữ liệu bí mật
NL_DLL_EXPORT void ClearSecretData( uint8_t *buf, uint32_t len )
Xóa len
byte đầu tiên của vùng bộ nhớ buf
.
Trong quá trình triển khai này, len
byte dung lượng bộ nhớ buf
đầu tiên được lấp đầy bằng 0.
Thông tin chi tiết | |||||
---|---|---|---|---|---|
Các thông số |
|
So sánh thời gian không đổi
bool ConstantTimeCompare( const uint8_t *buf1, const uint8_t *buf2, uint16_t len )
So sánh len
byte đầu tiên của vùng bộ nhớ buf1
và vùng bộ nhớ buf2
.
Thời gian mà hàm này thực hiện độc lập với dữ liệu trong các vùng bộ nhớ buf1
và buf2
.
Thông tin chi tiết | |||||||
---|---|---|---|---|---|---|---|
Các thông số |
|
||||||
Giá trị trả về |
|
Giải mãVANNUMNUMGiá trị
WEAVE_ERROR DecodeBIGNUMValueLE( BIGNUM & val, uint16_t size, const uint8_t *& p )
Chữ ký giải mã ECDSA
WEAVE_ERROR DecodeECDSASignature( const EncodedECDSASignature & encodedSig, ECDSA_SIG *& sig )
Giải mã ECKey
NL_DLL_EXPORT WEAVE_ERROR DecodeECKey( OID curveOID, const EncodedECPrivateKey *encodedPrivKey, const EncodedECPublicKey *encodedPubKey, EC_KEY *& ecKey )
Giải mãX962ECPoint
NL_DLL_EXPORT WEAVE_ERROR DecodeX962ECPoint( const uint8_t *encodedPoint, uint16_t encodedPointLen, EC_GROUP *group, EC_POINT *& point )
Giải mãX962ECPoint
WEAVE_ERROR DecodeX962ECPoint( const uint8_t *encodedPoint, uint16_t encodedPointLen, BIGNUM *& x, BIGNUM *& y )
Điện toán chung được chia sẻ
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 )
Điện toán chung được chia sẻ
WEAVE_ERROR ECDHComputeSharedSecret( OID curveOID, const EncodedECPublicKey & encodedPubKey, const EncodedECPrivateKey & encodedPrivKey, uint8_t *sharedSecretBuf, uint16_t sharedSecretBufSize, uint16_t & sharedSecretLen )
ECDSASigToFixLenSig
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 )
EncodeBIGNUMValueLE
WEAVE_ERROR EncodeBIGNUMValueLE( const BIGNUM & val, uint16_t size, uint8_t *& p )
Chữ ký EncodeECDSA
WEAVE_ERROR EncodeECDSASignature( const ECDSA_SIG *sig, EncodedECDSASignature & encodedSig )
Mã hóaX962ECPoint
NL_DLL_EXPORT WEAVE_ERROR EncodeX962ECPoint( OID curveOID, EC_GROUP *ecGroup, const EC_POINT *point, uint8_t *buf, uint16_t bufSize, uint16_t & encodedPointLen )
Ống kính cố định
WEAVE_ERROR FixedLenSigToECDSASig( OID curveOID, const uint8_t *fixedLenSig, ECDSA_SIG *& ecSig )
CreateAndEncodeWeaveHMACSignature
WEAVE_ERROR GenerateAndEncodeWeaveHMACSignature( OID sigAlgoOID, TLVWriter & writer, uint64_t tag, const uint8_t *data, uint16_t dataLen, const uint8_t *key, uint16_t keyLen )
Tạo và mã hóa chữ ký HMAC của Weave.
Tính toán chữ ký HMAC cho một dữ liệu nhất định bằng cách sử dụng khóa bí mật và viết chữ ký dưới dạng cấu trúc Have HMACChữ ký cho trình ghi TLV được chỉ định có thẻ đã cho.
Thông tin chi tiết | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Các thông số |
|
||||||||||||||
Giá trị trả về |
|
CreateAndEncodeWeaveRSAChữ ký
WEAVE_ERROR GenerateAndEncodeWeaveRSASignature( OID sigAlgoOID, TLVWriter & writer, uint64_t tag, const uint8_t *hash, uint8_t hashLen, const uint8_t *keyDER, uint16_t keyDERLen )
Tạo và mã hóa chữ ký Wesve RSA.
Tính toán chữ ký RSA bằng cách sử dụng khóa cá nhân RSA được mã hóa X509 và hàm băm thông báo và ghi chữ ký dưới dạng cấu trúc RSA chữ ký Weave cho tác giả TLV đã chỉ định với thẻ đã cho.
Thông tin chi tiết | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Các thông số |
|
||||||||||||||
Giá trị trả về |
|
Tạo khóa ECDHKey
WEAVE_ERROR GenerateECDHKey( OID curveOID, EncodedECPublicKey & encodedPubKey, EncodedECPrivateKey & encodedPrivKey )
Chữ ký CreateECDSA
WEAVE_ERROR GenerateECDSASignature( OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const EncodedECPrivateKey & encodedPrivKey, EncodedECDSASignature & encodedSig )
Chữ ký CreateECDSA
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 )
Nhận kích thước đường cong hình elip (tính bằng byte).
Thông tin chi tiết | |||
---|---|---|---|
Các thông số |
|
||
Giá trị trả về |
|
GetECGroupForCurve
NL_DLL_EXPORT WEAVE_ERROR GetECGroupForCurve( OID curveOID, EC_GROUP *& ecGroup )
Đảo ngược
void ReverseBytes( uint8_t *buf, size_t len )
ShaNIDTừSigAlgoOID
int ShaNIDFromSigAlgoOID( OID sigAlgoOID )
Xác minh chữ ký ECECDSA
WEAVE_ERROR VerifyECDSASignature( OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const EncodedECDSASignature & encodedSig, const EncodedECPublicKey & encodedPubKey )
Xác minh chữ ký ECECDSA
WEAVE_ERROR VerifyECDSASignature( OID curveOID, const uint8_t *msgHash, uint8_t msgHashLen, const uint8_t *fixedLenSig, const EncodedECPublicKey & encodedPubKey )
Xác minh
WEAVE_ERROR VerifyHMACSignature( OID sigAlgoOID, const uint8_t *data, uint16_t dataLen, const EncodedHMACSignature & sig, const uint8_t *key, uint16_t keyLen )
Xác minh chữ ký Weave HMAC.
Xác minh chữ ký HMAC bằng cách sử dụng dữ liệu đã cho và khoá bí mật dùng để xác minh chữ ký.
Thông tin chi tiết | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Các thông số |
|
||||||||||||
Giá trị trả về |
|
Chữ ký Xác minh quảng cáo
WEAVE_ERROR VerifyRSASignature( OID sigAlgoOID, const uint8_t *hash, uint8_t hashLen, const EncodedRSASignature & sig, const uint8_t *certDER, uint16_t certDERLen )
Xác minh chữ ký Weave RSA.
Xác minh chữ ký RSA bằng một dữ liệu băm đã cho và một chứng chỉ RSA được mã hóa X509 có chứa khóa công khai được dùng để xác minh chữ ký.
Thông tin chi tiết | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Các thông số |
|
||||||||||||
Giá trị trả về |
|