/** * This routine processes the passed chunk of data and updates the hash context based on it. If the 'finalize' * parameter is not set, then the length of the data passed in must be a multiple of 16. If the 'finalize' parameter * is set then the length can be any value up 1-16, and the final hash value will be calculated. * * @param code the integer array to hash * @return the resulting {@link EmberAesMmoHashContext} */ public EmberAesMmoHashContext MmoHash(int[] code) { EmberAesMmoHashContext hashContext = new EmberAesMmoHashContext(); hashContext.SetResult(new int[16]); hashContext.SetLength(0); EzspAesMmoHashRequest request = new EzspAesMmoHashRequest(); request.SetContext(hashContext); request.SetData(code); request.SetFinalize(true); request.SetLength(code.Length); IEzspTransaction transaction = _protocolHandler.SendEzspTransaction(new EzspSingleResponseTransaction(request, typeof(EzspAesMmoHashResponse))); EzspAesMmoHashResponse response = (EzspAesMmoHashResponse)transaction.GetResponse(); _lastStatus = response.GetStatus(); Log.Debug(response.ToString()); if (response.GetStatus() != EmberStatus.EMBER_SUCCESS) { Log.Debug("Error performing AES MMO hash: {}", response); } return(response.GetReturnContext()); }
/// <summary> /// The context to set as <see cref="EmberAesMmoHashContext"/> </summary> public void SetContext(EmberAesMmoHashContext context) { _context = context; }
/// <summary> /// The returnContext to set as <see cref="EmberAesMmoHashContext"/> </summary> public void SetReturnContext(EmberAesMmoHashContext returnContext) { _returnContext = returnContext; }
public EzspAesMmoHashResponse(int[] inputBuffer) : base(inputBuffer) { _status = deserializer.DeserializeEmberStatus(); _returnContext = deserializer.DeserializeEmberAesMmoHashContext(); }
public void SerializeEmberAesMmoHashContext(EmberAesMmoHashContext context) { context.Serialize(this); }