Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vtec234 committed Sep 6, 2023
1 parent acdc047 commit 3d24bed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/McEliece.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def main (args:List String): IO Unit := do
| [reqPath, rspPath] => do
let mut drbg0 := randombytesInit (byteSequence 48);
let mut seedArray : Array Seed := #[]
let fpReq ← IO.FS.Handle.mk reqPath IO.FS.Mode.write false
let fpReq ← IO.FS.Handle.mk reqPath IO.FS.Mode.write
for i in [0:10] do
let (seed, drbg2) := PRNG.randombytes drbg0 48
drbg0 := drbg2
Expand All @@ -20,7 +20,7 @@ def main (args:List String): IO Unit := do
fpReq.putStrLn "ct ="
fpReq.putStrLn "ss =\n"
seedArray := seedArray.push seed
let fpRsp ← IO.FS.Handle.mk rspPath IO.FS.Mode.write false
let fpRsp ← IO.FS.Handle.mk rspPath IO.FS.Mode.write
fpRsp.putStrLn $ s!"# kem/{Mceliece.Ref348864.name}\n"
for i in [0:10], seed in seedArray do
let (key, drbg) ←
Expand Down
9 changes: 5 additions & 4 deletions tests/aes/GF256Pow.lean
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ example (x : GF256) : GF256.pow2 8 x = x := by
conv at GF256.pow2.def =>
intro k x
rw [ GaloisField2k.mul.GF256.specialization ]
save
-- TODO: breaks mvar context
-- save

extract_def polyMod
specialize_def GF2BVPoly.polyMod [16, 8]
save
-- save

extract_def polyMul
specialize_def GF2BVPoly.polyMul [8, 8]
save
-- save

conv at GaloisField2k.mul.GF256.def =>
intro a b
Expand All @@ -34,5 +35,5 @@ example (x : GF256) : GF256.pow2 8 x = x := by
GF2BVPoly.polyMul.«8».«8»,
GF2BVPoly.polyMod.«16».«8»
]

sorry

0 comments on commit 3d24bed

Please sign in to comment.