Documentation

Cryptlib.Protocols.Sphinx.geometry

Sphinx packet geometry #

Every fixed byte offset of the header, routing-info, and packet layout, computed from a hop count, a payload size, and a NIKE or KEM.

  • packetLength : ℕ
  • nrHops : ℕ
  • headerLength : ℕ
  • routingInfoLength : ℕ
  • perHopRoutingInfoLength : ℕ
  • surbLength : ℕ
  • sphinxPlaintextHeaderLength : ℕ
  • payloadTagLength : ℕ
  • forwardPayloadLength : ℕ
  • userForwardPayloadLength : ℕ
  • nextNodeHopLength : ℕ
  • sprpKeyMaterialLength : ℕ
  • nikeName : String

    The NIKE scheme name; empty for a KEM geometry.

  • kemName : String

    The KEM scheme name; empty for a NIKE geometry.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Cryptlib.Protocols.Sphinx.Geometry.ofNIKE (nikeSchemeName : String) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :

        Geometry for a NIKE named nikeSchemeName, with the given user payload length.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Cryptlib.Protocols.Sphinx.Geometry.ofKEM (kemSchemeName : String) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :

          Geometry for a KEM named kemSchemeName, with the given user payload length.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Cryptlib.Protocols.Sphinx.Geometry.ofNIKETargetSize (nikeSchemeName : String) (targetPacketLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :

            Geometry for a NIKE whose total packet length is targetPacketLength. Fails if it is smaller than the fixed overhead.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Cryptlib.Protocols.Sphinx.Geometry.ofKEMTargetSize (kemSchemeName : String) (targetPacketLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :

              As ofNIKETargetSize, for a KEM.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Checks that exactly one scheme name is set, that it names a registered scheme, and that the header dimensions are nonzero.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[instance_reducible]
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[reducible]

                  geom has the field values buildNIKE gives for nike.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[reducible]

                    geom has the field values buildKEM gives for kem.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Cryptlib.Protocols.Sphinx.Geometry.ofNIKEWith (label : String) (nike : Primitives.NIKE.NIKE.NIKE) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :

                      As ofNIKE, for a NIKE given directly rather than by name. label is only stored.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Cryptlib.Protocols.Sphinx.Geometry.ofNIKEWith_validForNIKE (label : String) (nike : Primitives.NIKE.NIKE.NIKE) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :
                        (ofNIKEWith label nike userForwardPayloadLength withSURB nrHops).ValidForNIKE nike

                        ofNIKEWith nike is valid for nike.

                        theorem Cryptlib.Protocols.Sphinx.Geometry.ofNIKEWith_payloadTagLength (label : String) (nike : Primitives.NIKE.NIKE.NIKE) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :
                        (ofNIKEWith label nike userForwardPayloadLength withSURB nrHops).payloadTagLength = Constants.payloadTagLength

                        ofNIKEWith sets payloadTagLength.

                        def Cryptlib.Protocols.Sphinx.Geometry.ofKEMWith (label : String) (kem : Primitives.KEM.KEM.KEM) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :

                        As ofNIKEWith, for a KEM.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Cryptlib.Protocols.Sphinx.Geometry.ofKEMWith_validForKEM (label : String) (kem : Primitives.KEM.KEM.KEM) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :
                          (ofKEMWith label kem userForwardPayloadLength withSURB nrHops).ValidForKEM kem
                          theorem Cryptlib.Protocols.Sphinx.Geometry.ofKEMWith_payloadTagLength (label : String) (kem : Primitives.KEM.KEM.KEM) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) :
                          (ofKEMWith label kem userForwardPayloadLength withSURB nrHops).payloadTagLength = Constants.payloadTagLength
                          theorem Cryptlib.Protocols.Sphinx.Geometry.ofNIKE_validForNIKE (nikeSchemeName : String) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) (geom : Geometry) (nike : Primitives.NIKE.NIKE.NIKE) (h : ofNIKE nikeSchemeName userForwardPayloadLength withSURB nrHops = Except.ok geom) (hn : Primitives.NIKE.byName nikeSchemeName = some nike) :
                          geom.ValidForNIKE nike
                          theorem Cryptlib.Protocols.Sphinx.Geometry.ofKEM_validForKEM (kemSchemeName : String) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) (geom : Geometry) (kem : Primitives.KEM.KEM.KEM) (h : ofKEM kemSchemeName userForwardPayloadLength withSURB nrHops = Except.ok geom) (hk : Primitives.KEM.byName kemSchemeName = some kem) :
                          geom.ValidForKEM kem
                          theorem Cryptlib.Protocols.Sphinx.Geometry.ofKEM_payloadTagLength (kemSchemeName : String) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) (geom : Geometry) (h : ofKEM kemSchemeName userForwardPayloadLength withSURB nrHops = Except.ok geom) :

                          ofKEM sets payloadTagLength.

                          theorem Cryptlib.Protocols.Sphinx.Geometry.ofNIKE_payloadTagLength (nikeSchemeName : String) (userForwardPayloadLength : ℕ) (withSURB : Bool) (nrHops : ℕ) (geom : Geometry) (h : ofNIKE nikeSchemeName userForwardPayloadLength withSURB nrHops = Except.ok geom) :

                          ofNIKE sets payloadTagLength.

                          theorem Cryptlib.Protocols.Sphinx.Geometry.ofNIKETargetSize_packetLength (nikeSchemeName : String) (targetPacketLength : ℕ) (withSURB : Bool) (nrHops : ℕ) (geom : Geometry) (h : ofNIKETargetSize nikeSchemeName targetPacketLength withSURB nrHops = Except.ok geom) :
                          geom.packetLength = targetPacketLength

                          ofNIKETargetSize produces a geometry with exactly the target packet length.

                          theorem Cryptlib.Protocols.Sphinx.Geometry.ofKEMTargetSize_packetLength (kemSchemeName : String) (targetPacketLength : ℕ) (withSURB : Bool) (nrHops : ℕ) (geom : Geometry) (h : ofKEMTargetSize kemSchemeName targetPacketLength withSURB nrHops = Except.ok geom) :
                          geom.packetLength = targetPacketLength

                          As ofNIKETargetSize_packetLength, for a KEM.