/// <summary> /// Compare this object instance with another /// </summary> /// /// <param name="Obj">Object to compare</param> /// /// <returns>True if equal, otherwise false</returns> public override bool Equals(Object Obj) { if (!(Obj is MacDescription)) { return(false); } MacDescription other = (MacDescription)Obj; if (MacType != other.MacType) { return(false); } if (KeySize != other.KeySize) { return(false); } if (IvSize != other.IvSize) { return(false); } if (HmacEngine != other.HmacEngine) { return(false); } if (EngineType != other.EngineType) { return(false); } if (BlockSize != other.BlockSize) { return(false); } if (RoundCount != other.RoundCount) { return(false); } if (KdfEngine != other.KdfEngine) { return(false); } return(true); }
/// <summary> /// Get this is a valid header file /// </summary> /// /// <param name="Description">The stream containing a key header</param> /// /// <returns>Valid</returns> public static bool IsValid(MacDescription Description) { // not guaranteed, but should be ok return(Description.KeySize != 0 && Description.EngineType != 0 && Description.HmacEngine != 0); }