protected static void WriteEcdhTupleProofs(BinaryWriter bw, EcdhTupleProofs ecdhTuple) { bw.Write(ecdhTuple.Mask); bw.Write(ecdhTuple.AssetId); bw.Write(ecdhTuple.AssetIssuer); bw.Write(ecdhTuple.Payload); }
protected void ReadEcdhTupleProofs(ref Memory <byte> spanBody, ref int readBytes, out EcdhTupleProofs ecdhTuple) { byte[] mask = spanBody.Slice(readBytes, Globals.NODE_PUBLIC_KEY_SIZE).ToArray(); readBytes += Globals.NODE_PUBLIC_KEY_SIZE; byte[] assetId = spanBody.Slice(readBytes, Globals.NODE_PUBLIC_KEY_SIZE).ToArray(); readBytes += Globals.NODE_PUBLIC_KEY_SIZE; byte[] assetIssuer = spanBody.Slice(readBytes, Globals.NODE_PUBLIC_KEY_SIZE).ToArray(); readBytes += Globals.NODE_PUBLIC_KEY_SIZE; byte[] payload = spanBody.Slice(readBytes, Globals.NODE_PUBLIC_KEY_SIZE).ToArray(); readBytes += Globals.NODE_PUBLIC_KEY_SIZE; ecdhTuple = new EcdhTupleProofs { Mask = mask, AssetId = assetId, AssetIssuer = assetIssuer, Payload = payload }; }