- printfn "== Altering the cyphertext..."
- encrypt ()
- incrementByteCipherFileAt (int64 <| API.hmacSize + API.signatureSize + API.keysSize)
- try
- decrypt ()
- assert false
- with
- | error -> assert (error :? IntegrityError)
+ let cyphertextLength = (int (FileInfo (cipherFilename)).Length) + API.hmacSize + API.signatureSize + API.keysSize
+ printfn "== Altering the cyphertext... (%d bytes)" cyphertextLength
+ for i in 0 .. cyphertextLength do
+ printf "."
+ encrypt ()
+ incrementByteCipherFileAt (int64 <| API.hmacSize + API.signatureSize + API.keysSize + i)
+ try
+ decrypt ()
+ assert false
+ with
+ | error -> assert (error :? IntegrityError)
+ printfn ""