@@ -837,6 +837,38 @@ ATCA_STATUS atcab_checkmac(uint8_t mode, uint16_t key_id, const uint8_t* challen
837837 }
838838 return status ;
839839}
840+
841+ /** \brief Compares a MAC response with input values.SHA105 device can generate optional mac
842+ * Output response mac mode only supports in SHA105 device
843+ * \param[in] mode Controls which fields within the device are used in
844+ * the message
845+ * \param[in] challenge Challenge data (32 bytes)
846+ * \param[in] response MAC response data (32 bytes)
847+ * \param[in] other_data OtherData parameter (13 bytes)
848+ * \param[out] mac MAC response (32 bytes)
849+ * \return ATCA_SUCCESS on success, otherwise an error code.
850+ */
851+ ATCA_STATUS atcab_checkmac_with_response_mac (uint8_t mode , const uint8_t * challenge , const uint8_t * response , const uint8_t * other_data , uint8_t * mac )
852+ {
853+ ATCA_STATUS status = ATCA_UNIMPLEMENTED ;
854+ ATCADeviceType dev_type = atcab_get_device_type ();
855+
856+ if (SHA105 == dev_type )
857+ {
858+ #ifdef ATCA_SHA105_SUPPORT
859+ status = calib_checkmac_with_response_mac (_gDevice , mode , challenge , response , other_data , mac );
860+ #endif
861+ }
862+ else if (atcab_is_ta_device (dev_type ))
863+ {
864+ status = ATCA_UNIMPLEMENTED ;
865+ }
866+ else
867+ {
868+ status = ATCA_NOT_INITIALIZED ;
869+ }
870+ return status ;
871+ }
840872#endif /* ATCAB_CHECKMAC */
841873
842874/* Counter command */
@@ -1231,6 +1263,34 @@ ATCA_STATUS atcab_gendig(uint8_t zone, uint16_t key_id, const uint8_t* other_dat
12311263 }
12321264 return status ;
12331265}
1266+
1267+ /** \brief Issues a GenDivKey command to generate the equivalent diversified key as that programmed into the
1268+ * client side device
1269+ * \param[in] device Device context pointer
1270+ * \param[in] other_data Must match data used when generating the diversified key in the client device
1271+ * \return ATCA_SUCCESS on success, otherwise an error code.
1272+ */
1273+ ATCA_STATUS atcab_gendivkey (const uint8_t * other_data )
1274+ {
1275+ ATCA_STATUS status = ATCA_UNIMPLEMENTED ;
1276+ ATCADeviceType dev_type = atcab_get_device_type ();
1277+
1278+ if (SHA105 == dev_type )
1279+ {
1280+ #ifdef ATCA_SHA105_SUPPORT
1281+ status = calib_sha105_gendivkey (_gDevice , other_data );
1282+ #endif
1283+ }
1284+ else if (atcab_is_ta_device (dev_type ))
1285+ {
1286+ status = ATCA_UNIMPLEMENTED ;
1287+ }
1288+ else
1289+ {
1290+ status = ATCA_NOT_INITIALIZED ;
1291+ }
1292+ return status ;
1293+ }
12341294#endif /* ATCAB_GENDIG */
12351295
12361296/* GenKey command */
@@ -1493,7 +1553,7 @@ ATCA_STATUS atcab_info_lock_status(uint16_t param2, uint8_t *is_locked)
14931553}
14941554
14951555/** \brief Use the Info command to get the chip status
1496- * \param[out] chip status returns chip status here
1556+ * \param[out] chip_status returns chip status here
14971557 *
14981558 * \return ATCA_SUCCESS on success, otherwise an error code.
14991559 */
0 commit comments