Lines Matching refs:macMsg
980 LoRaMacCryptoStatus_t LoRaMacCryptoPrepareJoinRequest( LoRaMacMessageJoinRequest_t* macMsg ) in LoRaMacCryptoPrepareJoinRequest() argument
982 if( macMsg == 0 ) in LoRaMacCryptoPrepareJoinRequest()
996 macMsg->DevNonce = CryptoNvm->DevNonce; in LoRaMacCryptoPrepareJoinRequest()
1000 if( DeriveLifeTimeSessionKey( J_S_INT_KEY, macMsg->DevEUI ) != LORAMAC_CRYPTO_SUCCESS ) in LoRaMacCryptoPrepareJoinRequest()
1004 if( DeriveLifeTimeSessionKey( J_S_ENC_KEY, macMsg->DevEUI ) != LORAMAC_CRYPTO_SUCCESS ) in LoRaMacCryptoPrepareJoinRequest()
1011 if( LoRaMacSerializerJoinRequest( macMsg ) != LORAMAC_SERIALIZER_SUCCESS ) in LoRaMacCryptoPrepareJoinRequest()
1017 …mentComputeAesCmac( NULL, macMsg->Buffer, ( LORAMAC_JOIN_REQ_MSG_SIZE - LORAMAC_MIC_FIELD_SIZE ), … in LoRaMacCryptoPrepareJoinRequest()
1023 if( LoRaMacSerializerJoinRequest( macMsg ) != LORAMAC_SERIALIZER_SUCCESS ) in LoRaMacCryptoPrepareJoinRequest()
1031 LoRaMacCryptoStatus_t LoRaMacCryptoPrepareReJoinType1( LoRaMacMessageReJoinType1_t* macMsg ) in LoRaMacCryptoPrepareReJoinType1() argument
1034 if( macMsg == 0 ) in LoRaMacCryptoPrepareReJoinType1()
1046 if( LoRaMacSerializerReJoinType1( macMsg ) != LORAMAC_SERIALIZER_SUCCESS ) in LoRaMacCryptoPrepareReJoinType1()
1053 …eElementComputeAesCmac( NULL, macMsg->Buffer, ( LORAMAC_RE_JOIN_1_MSG_SIZE - LORAMAC_MIC_FIELD_SIZ… in LoRaMacCryptoPrepareReJoinType1()
1059 if( LoRaMacSerializerReJoinType1( macMsg ) != LORAMAC_SERIALIZER_SUCCESS ) in LoRaMacCryptoPrepareReJoinType1()
1073 LoRaMacCryptoStatus_t LoRaMacCryptoPrepareReJoinType0or2( LoRaMacMessageReJoinType0or2_t* macMsg ) in LoRaMacCryptoPrepareReJoinType0or2() argument
1076 if( macMsg == 0 ) in LoRaMacCryptoPrepareReJoinType0or2()
1088 if( LoRaMacSerializerReJoinType0or2( macMsg ) != LORAMAC_SERIALIZER_SUCCESS ) in LoRaMacCryptoPrepareReJoinType0or2()
1095 …ementComputeAesCmac( NULL, macMsg->Buffer, ( LORAMAC_RE_JOIN_0_2_MSG_SIZE - LORAMAC_MIC_FIELD_SIZE… in LoRaMacCryptoPrepareReJoinType0or2()
1101 if( LoRaMacSerializerReJoinType0or2( macMsg ) != LORAMAC_SERIALIZER_SUCCESS ) in LoRaMacCryptoPrepareReJoinType0or2()
1115 …JoinAccept( JoinReqIdentifier_t joinReqType, uint8_t* joinEUI, LoRaMacMessageJoinAccept_t* macMsg ) in LoRaMacCryptoHandleJoinAccept() argument
1117 if( ( macMsg == 0 ) || ( joinEUI == 0 ) ) in LoRaMacCryptoHandleJoinAccept()
1151 if( SecureElementProcessJoinAccept( joinReqType, joinEUI, nonce, macMsg->Buffer, in LoRaMacCryptoHandleJoinAccept()
1152 macMsg->BufSize, decJoinAccept, in LoRaMacCryptoHandleJoinAccept()
1158 memcpy1( macMsg->Buffer, decJoinAccept, macMsg->BufSize ); in LoRaMacCryptoHandleJoinAccept()
1161 if( LoRaMacParserJoinAccept( macMsg ) != LORAMAC_PARSER_SUCCESS ) in LoRaMacCryptoHandleJoinAccept()
1169 currentJoinNonce = ( uint32_t )macMsg->JoinNonce[0]; in LoRaMacCryptoHandleJoinAccept()
1170 currentJoinNonce |= ( ( uint32_t )macMsg->JoinNonce[1] << 8 ); in LoRaMacCryptoHandleJoinAccept()
1171 currentJoinNonce |= ( ( uint32_t )macMsg->JoinNonce[2] << 16 ); in LoRaMacCryptoHandleJoinAccept()
1242 netID = ( uint32_t )macMsg->NetID[0]; in LoRaMacCryptoHandleJoinAccept()
1243 netID |= ( ( uint32_t )macMsg->NetID[1] << 8 ); in LoRaMacCryptoHandleJoinAccept()
1244 netID |= ( ( uint32_t )macMsg->NetID[2] << 16 ); in LoRaMacCryptoHandleJoinAccept()
1287 …MacCryptoSecureMessage( uint32_t fCntUp, uint8_t txDr, uint8_t txCh, LoRaMacMessageData_t* macMsg ) in LoRaMacCryptoSecureMessage() argument
1292 if( macMsg == NULL ) in LoRaMacCryptoSecureMessage()
1303 if( macMsg->FPort == 0 ) in LoRaMacCryptoSecureMessage()
1311 …retval = PayloadEncrypt( macMsg->FRMPayload, macMsg->FRMPayloadSize, payloadDecryptionKeyID, macMs… in LoRaMacCryptoSecureMessage()
1321 …retval = FOptsEncrypt( macMsg->FHDR.FCtrl.Bits.FOptsLen, macMsg->FHDR.DevAddr, UPLINK, FCNT_UP, fC… in LoRaMacCryptoSecureMessage()
1331 if( LoRaMacSerializerData( macMsg ) != LORAMAC_SERIALIZER_SUCCESS ) in LoRaMacCryptoSecureMessage()
1344 …mputeCmacB1( macMsg->Buffer, ( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE ), S_NWK_S_INT_KEY, macMsg… in LoRaMacCryptoSecureMessage()
1350 …ComputeCmacB0( macMsg->Buffer, ( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE ), F_NWK_S_INT_KEY, macM… in LoRaMacCryptoSecureMessage()
1356 macMsg->MIC = ( ( cmacF << 16 ) & 0xFFFF0000 ) | ( cmacS & 0x0000FFFF ); in LoRaMacCryptoSecureMessage()
1363 …puteCmacB0( macMsg->Buffer, ( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE ), NWK_S_ENC_KEY, false, UP… in LoRaMacCryptoSecureMessage()
1371 if( LoRaMacSerializerData( macMsg ) != LORAMAC_SERIALIZER_SUCCESS ) in LoRaMacCryptoSecureMessage()
1381 …ddrID, uint32_t address, FCntIdentifier_t fCntID, uint32_t fCntDown, LoRaMacMessageData_t* macMsg ) in LoRaMacCryptoUnsecureMessage() argument
1383 if( macMsg == 0 ) in LoRaMacCryptoUnsecureMessage()
1399 if( LoRaMacParserData( macMsg ) != LORAMAC_PARSER_SUCCESS ) in LoRaMacCryptoUnsecureMessage()
1415 if( address != macMsg->FHDR.DevAddr ) in LoRaMacCryptoUnsecureMessage()
1421 bool isAck = macMsg->FHDR.FCtrl.Bits.Ack; in LoRaMacCryptoUnsecureMessage()
1429 …VerifyCmacB0( macMsg->Buffer, ( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE ), micComputationKeyID, i… in LoRaMacCryptoUnsecureMessage()
1436 if( macMsg->FPort == 0 ) in LoRaMacCryptoUnsecureMessage()
1441 …retval = PayloadEncrypt( macMsg->FRMPayload, macMsg->FRMPayloadSize, payloadDecryptionKeyID, addre… in LoRaMacCryptoUnsecureMessage()
1453 …retval = FOptsEncrypt( macMsg->FHDR.FCtrl.Bits.FOptsLen, address, DOWNLINK, fCntID, fCntDown, macM… in LoRaMacCryptoUnsecureMessage()