@@ -3115,8 +3115,8 @@ func (p *scionPacketProcessor) processEgress( /*@ ghost ub []byte @*/ ) (reserr
31153115// @ let ubPath := p.scionLayer.UBPath(ub) in
31163116// @ (unfolding acc(p.scionLayer.Mem(ub), _) in
31173117// @ p.path === p.scionLayer.GetPath(ub) &&
3118- // @ p.path.GetBase(ubPath) == currBase.IncPathSpec() &&
3119- // @ currBase.IncPathSpec().Valid() )
3118+ // @ p.path.GetBase(ubPath) == currBase.IncPathSpec())
3119+ // @ ensures reserr == nil ==> currBase.IncPathSpec().Valid()
31203120// @ ensures reserr == nil ==>
31213121// @ p.scionLayer.ValidPathMetaData(ub) == old(p.scionLayer.ValidPathMetaData(ub))
31223122// @ decreases
@@ -3131,14 +3131,19 @@ func (p *scionPacketProcessor) doXover( /*@ ghost ub []byte, ghost currBase scio
31313131 // @ sl.SplitByIndex_Bytes(ub, 0, startP, slayers.CmnHdrLen, R54)
31323132 // @ sl.Reslice_Bytes(ub, 0, slayers.CmnHdrLen, R54)
31333133 // @ slayers.IsSupportedPktSubslice(ub, slayers.CmnHdrLen)
3134+ // @ assert p.path == p.scionLayer.GetPath(ub)
31343135 // @ p.AbsPktToSubSliceAbsPkt(ub, startP, endP)
3136+ // @ assert p.path == p.scionLayer.GetPath(ub)
31353137 // @ p.scionLayer.ValidHeaderOffsetToSubSliceLemma(ub, startP)
3138+ // @ ghost preAbsPkt := p.path.absPkt(ubPath)
31363139 // @ p.path.XoverLemma(ubPath)
31373140 // @ reveal p.EqAbsInfoField(absPkt(ub))
31383141 // @ reveal p.EqAbsHopField(absPkt(ub))
31393142 // @ sl.SplitRange_Bytes(ub, startP, endP, HalfPerm)
31403143 // @ reveal p.scionLayer.ValidHeaderOffset(ub, startP)
31413144 // @ unfold acc(p.scionLayer.Mem(ub), R55)
3145+ // @ assert p.path.GetBase(ubPath) == currBase
3146+ // @ ghost nextBase := currBase.IncPathSpec()
31423147 if err := p .path .IncPath ( /*@ ubPath @*/ ); err != nil {
31433148 // TODO parameter problem invalid path
31443149 // (VerifiedSCION) we currently expose a lot of internal information from slayers here. Can we avoid it?
@@ -3150,18 +3155,28 @@ func (p *scionPacketProcessor) doXover( /*@ ghost ub []byte, ghost currBase scio
31503155 // @ fold p.scionLayer.NonInitMem()
31513156 return processResult {}, serrors .WrapStr ("incrementing path" , err )
31523157 }
3158+ // @ assert p.path.GetBase(ubPath) == nextBase
3159+ // @ assert p.path.absPkt(ubPath) == scion.AbsXover(preAbsPkt)
31533160 // @ fold acc(p.scionLayer.Mem(ub), R55)
31543161 // @ assert reveal p.scionLayer.ValidHeaderOffset(ub, startP)
31553162 // @ ghost sl.CombineRange_Bytes(ub, startP, endP, HalfPerm)
31563163 // @ slayers.IsSupportedPktSubslice(ub, slayers.CmnHdrLen)
31573164 // @ sl.Unslice_Bytes(ub, 0, slayers.CmnHdrLen, R54)
31583165 // @ sl.CombineAtIndex_Bytes(ub, 0, startP, slayers.CmnHdrLen, R54)
3166+ // @ assert p.path == p.scionLayer.GetPath(ub)
31593167 // @ p.scionLayer.ValidHeaderOffsetFromSubSliceLemma(ub, startP)
3168+ // @ assert p.scionLayer.ValidHeaderOffset(ub, len(ub))
3169+ // @ assert p.path == p.scionLayer.GetPath(ub)
31603170 // @ p.SubSliceAbsPktToAbsPkt(ub, startP, endP)
3171+ // @ assert p.scionLayer.ValidHeaderOffset(ub, len(ub))
3172+ // @ assert p.path == p.scionLayer.GetPath(ub)
3173+ // @ assert p.path.GetBase(ubPath) == nextBase
31613174 // @ assert len(get(old(absPkt(ub)).LeftSeg).Future) > 0
31623175 // @ assert len(get(old(absPkt(ub)).LeftSeg).History) == 0
31633176 // @ assert slayers.ValidPktMetaHdr(ub) && p.scionLayer.EqAbsHeader(ub)
31643177 // @ assert absPkt(ub) == reveal AbsDoXover(old(absPkt(ub)))
3178+ // @ assert p.path == p.scionLayer.GetPath(ub)
3179+ // @ assert p.path.GetBase(ubPath) == nextBase
31653180 var err error
31663181 // (VerifiedSCION) Due to an incompleteness (https://github.com/viperproject/gobra/issues/770),
31673182 // we introduce a temporary variable to be able to call `path.AbsMacArrayCongruence()`.
@@ -3173,6 +3188,7 @@ func (p *scionPacketProcessor) doXover( /*@ ghost ub []byte, ghost currBase scio
31733188 // TODO parameter problem invalid path
31743189 return processResult {}, err
31753190 }
3191+ // @ assert p.path.GetBase(ubPath) == nextBase
31763192 p .hopField = tmpHopField
31773193 // @ path.AbsMacArrayCongruence(p.hopField.Mac, tmpHopField.Mac)
31783194 // @ assert p.hopField.ToIO_HF() == tmpHopField.ToIO_HF()
@@ -3185,15 +3201,18 @@ func (p *scionPacketProcessor) doXover( /*@ ghost ub []byte, ghost currBase scio
31853201 // TODO parameter problem invalid path
31863202 return processResult {}, err
31873203 }
3188- // @ ghost sl.CombineRange_Bytes(ub, startP, endP, HalfPerm)
3204+ // @ assert p.path.GetBase(ubPath) == nextBase
31893205 // @ p.SubSliceAbsPktToAbsPkt(ub, startP, endP)
3206+ // @ ghost sl.CombineRange_Bytes(ub, startP, endP, HalfPerm/2)
31903207 // @ absPktFutureLemma(ub)
31913208 // @ p.path.DecodingLemma(ubPath, p.infoField, p.hopField)
31923209 // @ assert reveal p.path.EqAbsInfoField(p.path.absPkt(ubPath), p.infoField.ToAbsInfoField())
31933210 // @ assert reveal p.path.EqAbsHopField(p.path.absPkt(ubPath), p.hopField.ToIO_HF())
31943211 // @ assert reveal p.EqAbsHopField(absPkt(ub))
31953212 // @ assert reveal p.EqAbsInfoField(absPkt(ub))
3213+ // @ ghost sl.CombineRange_Bytes(ub, startP, endP, HalfPerm/2)
31963214 // @ fold acc(p.scionLayer.Mem(ub), 1-R55)
3215+ // @ assert currBase.IncPathSpec().Valid()
31973216 return processResult {}, nil
31983217}
31993218
0 commit comments