Documentation

DY.Bytes.AttackerKnowledge

The attacker knowledge is ultimately defined as a Kleene fixpoint, and SubAttackerKnowledge is a component of this fixpoint computation.

For example, to say that the attacker is allowed to concatenate bytes, we can write:

-- attacker knows out when pred p out := ∃ lhs rhs, -- out is the concatenation of lhs and rhs and out = concat lhs rhs ∧ p lhs ∧ -- the attacker knows lhs and p rhs -- the attacker knows rhs.

To prove the scott-continuity of pred (a technical requirement for Kleene fixpoint) it is better to use the Forall predicate like this:

pred p out := ∃ lhs rhs, out = concat lhs rhs ∧ DY.Kleene.Forall p [lhs, rhs]

This allows to rely on the lemma DY.Kleene.isScottContinuous_Forall_lemma, and allow for pred_isScottContinuous to be proved automatically by our tactic script.

The SubF parameter is not useful in this definition. It is only for hygiene, to make sure we don't miss equational theories by using SubAttackerKnowledge.combine

Instances For
    Instances
      Instances
        instance DY.AttackerKnowledge.instHasOfHasStep [BytesFunctor] [AttackerKnowledge] {SubF1 SubF2 : TypeType} (att1 : SubAttackerKnowledge SubF1) (att2 : SubAttackerKnowledge SubF2) [inst1 : HasStep att1 att2] [inst2 : Has att2] :
        Has att1
        def DY.SubAttackerKnowledge.combine [BytesFunctor] {t : Type} {SubFs : tTypeType} (atts : (id : t) → SubAttackerKnowledge (SubFs id)) :
        Equations
        Instances For
          Equations
          Instances For
            Equations
            Instances For
              instance DY.AttackerKnowledge.instHasStepCombineCombine [BytesFunctor] {t : Type} {SubFs : tTypeType} (atts : (id : t) → SubAttackerKnowledge (SubFs id)) (id : t) :
              instance DY.AttackerKnowledge.instHasStepCombine' [BytesFunctor] {SubF : TypeType} {t : Type} (atts : tSubAttackerKnowledge SubF) (id : t) :

              Main theorem to prove that the attacker knows some particular value

              The attacker knowledge AttackerKnows is the weakest predicate P such that every sub-attacker knowledge predicate att, att.pred P b implies P b

              The attacker knowledge satisfies this property: this is the theorem by Bytes.AttackerKnows.prove The attacker knowledge is the weakest predicate: this is the theorem Bytes.AttackerKnows.is_least_fixpoint. In other words, if a predicate P has this property, then Bytes.AttackerKnows b => P b

              We can use SubAttackerKnowledge.Implies to modularly prove that a predicate P satisfy this property.

              Equations
              Instances For
                theorem DY.SubAttackerKnowledge.combine'.implies [BytesFunctor] {SubF : TypeType} {t : Type} (atts : tSubAttackerKnowledge SubF) (p : BytesProp) (pfs : ∀ (id : t), (atts id).Implies p) :
                (combine' atts).Implies p
                theorem DY.SubAttackerKnowledge.combine.implies [BytesFunctor] {t : Type} {SubFs : tTypeType} (atts : (id : t) → SubAttackerKnowledge (SubFs id)) (p : BytesProp) (pfs : ∀ (id : t), (atts id).Implies p) :
                (combine atts).Implies p