1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.
Dependents: MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more
Superseded by MaximInterface.
Diff: OneWire_Masters/ISha256MacCoprocessor.hpp
- Revision:
- 21:00c94aeb533e
- Child:
- 33:a4c015046956
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OneWire_Masters/ISha256MacCoprocessor.hpp Mon Mar 21 14:12:28 2016 -0500 @@ -0,0 +1,35 @@ +#ifndef ISHA256MACCOPROCESSOR_H +#define ISHA256MACCOPROCESSOR_H + +#include <cstddef> +#include <cstdint> + +class ISha256MacCoprocessor +{ +public: + enum CmdResult + { + Success, + OperationFailure + }; + + static const std::size_t devicePage_len = 32; + static const std::size_t deviceScratchpad_len = 32; + static const std::size_t secret_len = 32; + + static const std::size_t mac_len = 32; + + static const std::size_t WriteMAC_data_len = 20; + static const std::size_t AuthMAC_data_len = 12; + static const std::size_t SSecret_data_len = 12; + + virtual CmdResult setMasterSecret(const std::uint8_t (&secret)[secret_len]) = 0; + + virtual CmdResult ComputeAndRead_WriteMAC(const std::uint8_t (&WriteMAC_data)[WriteMAC_data_len], std::uint8_t (&mac)[mac_len]) const = 0; + virtual CmdResult ComputeAndRead_AuthMAC(const std::uint8_t (&devicePage)[devicePage_len], const std::uint8_t (&challenge)[deviceScratchpad_len], + const std::uint8_t (&AuthMAC_data)[AuthMAC_data_len], std::uint8_t (&mac)[mac_len]) const = 0; + virtual CmdResult Compute_SSecret(const std::uint8_t (&devicePage)[devicePage_len], + const std::uint8_t (&deviceScratchpad)[deviceScratchpad_len], const std::uint8_t (&SSecret_data)[SSecret_data_len]) = 0; +}; + +#endif \ No newline at end of file