let test () =
  let res1 = test_scalarmult scalar1 point1 expected1 in
  let res2 = test_scalarmult scalar2 point2 expected2 in
  
  let res = res1 && res2 in
  if res then begin IO.print_string "\n\nCurve25519 : Success!\n"; true end
  else begin IO.print_string "\n\nCurve25519: Failure :(\n"; false end
let test () =
let res1 = test_scalarmult scalar1 point1 expected1 in
let res2 = test_scalarmult scalar2 point2 expected2 in
let res = res1 && res2 in
if res
then
  (IO.print_string "\n\nCurve25519 : Success!\n";
    true)
else
  (IO.print_string "\n\nCurve25519: Failure :(\n";
    false)
Spec.Curve25519.Test.fst.checked
Spec.Curve25519.fst.checked prims.fst.checked Lib.Sequence.fsti.checked Lib.RawIntTypes.fsti.checked Lib.PrintSequence.fsti.checked Lib.IntTypes.fsti.checked Lib.ByteSequence.fsti.checked FStar.UInt8.fsti.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.IO.fst.checked FStar.All.fst.checked
Spec.Curve25519.Test.fst
Prims.unit Prims.bool FStar.IO.print_string Prims.op_AmpAmp Spec.Curve25519.Test.test_scalarmult Spec.Curve25519.Test.scalar2 Spec.Curve25519.Test.point2 Spec.Curve25519.Test.expected2 Spec.Curve25519.Test.scalar1 Spec.Curve25519.Test.point1 Spec.Curve25519.Test.expected1
module Spec.Curve25519.Test

open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
open Spec.Curve25519
module PS = Lib.PrintSequence

#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"

(* ********************* *)
(* RFC 7748 Test Vectors *)
(* ********************* *)

let scalar1 : lbytes 32 =
  let l = List.Tot.map u8_from_UInt8 [
    0xa5uy; 0x46uy; 0xe3uy; 0x6buy; 0xf0uy; 0x52uy; 0x7cuy; 0x9duy;
    0x3buy; 0x16uy; 0x15uy; 0x4buy; 0x82uy; 0x46uy; 0x5euy; 0xdduy;
    0x62uy; 0x14uy; 0x4cuy; 0x0auy; 0xc1uy; 0xfcuy; 0x5auy; 0x18uy;
    0x50uy; 0x6auy; 0x22uy; 0x44uy; 0xbauy; 0x44uy; 0x9auy; 0xc4uy
  ] in
  assert_norm (List.Tot.length l == 32);
  of_list l


let scalar2 : lbytes 32 =
  let l = List.Tot.map u8_from_UInt8 [
    0x4buy; 0x66uy; 0xe9uy; 0xd4uy; 0xd1uy; 0xb4uy; 0x67uy; 0x3cuy;
    0x5auy; 0xd2uy; 0x26uy; 0x91uy; 0x95uy; 0x7duy; 0x6auy; 0xf5uy;
    0xc1uy; 0x1buy; 0x64uy; 0x21uy; 0xe0uy; 0xeauy; 0x01uy; 0xd4uy;
    0x2cuy; 0xa4uy; 0x16uy; 0x9euy; 0x79uy; 0x18uy; 0xbauy; 0x0duy
  ] in
  assert_norm (List.Tot.length l == 32);
  of_list l


let point1 : lbytes 32 =
  let l = List.Tot.map u8_from_UInt8 [
    0xe6uy; 0xdbuy; 0x68uy; 0x67uy; 0x58uy; 0x30uy; 0x30uy; 0xdbuy;
    0x35uy; 0x94uy; 0xc1uy; 0xa4uy; 0x24uy; 0xb1uy; 0x5fuy; 0x7cuy;
    0x72uy; 0x66uy; 0x24uy; 0xecuy; 0x26uy; 0xb3uy; 0x35uy; 0x3buy;
    0x10uy; 0xa9uy; 0x03uy; 0xa6uy; 0xd0uy; 0xabuy; 0x1cuy; 0x4cuy
  ] in
  assert_norm (List.Tot.length l == 32);
  of_list l


let point2 : lbytes 32 =
  let l = List.Tot.map u8_from_UInt8 [
    0xe5uy; 0x21uy; 0x0fuy; 0x12uy; 0x78uy; 0x68uy; 0x11uy; 0xd3uy;
    0xf4uy; 0xb7uy; 0x95uy; 0x9duy; 0x05uy; 0x38uy; 0xaeuy; 0x2cuy;
    0x31uy; 0xdbuy; 0xe7uy; 0x10uy; 0x6fuy; 0xc0uy; 0x3cuy; 0x3euy;
    0xfcuy; 0x4cuy; 0xd5uy; 0x49uy; 0xc7uy; 0x15uy; 0xa4uy; 0x93uy
  ] in
  assert_norm (List.Tot.length l == 32);
  of_list l


let expected1 : lbytes 32 =
  let l = List.Tot.map u8_from_UInt8 [
    0xc3uy; 0xdauy; 0x55uy; 0x37uy; 0x9duy; 0xe9uy; 0xc6uy; 0x90uy;
    0x8euy; 0x94uy; 0xeauy; 0x4duy; 0xf2uy; 0x8duy; 0x08uy; 0x4fuy;
    0x32uy; 0xecuy; 0xcfuy; 0x03uy; 0x49uy; 0x1cuy; 0x71uy; 0xf7uy;
    0x54uy; 0xb4uy; 0x07uy; 0x55uy; 0x77uy; 0xa2uy; 0x85uy; 0x52uy
  ] in
  assert_norm (List.Tot.length l == 32);
  of_list l


let expected2 : lbytes 32 =
  let l = List.Tot.map u8_from_UInt8 [
    0x95uy; 0xcbuy; 0xdeuy; 0x94uy; 0x76uy; 0xe8uy; 0x90uy; 0x7duy;
    0x7auy; 0xaduy; 0xe4uy; 0x5cuy; 0xb4uy; 0xb8uy; 0x73uy; 0xf8uy;
    0x8buy; 0x59uy; 0x5auy; 0x68uy; 0x79uy; 0x9fuy; 0xa1uy; 0x52uy;
    0xe6uy; 0xf8uy; 0xf7uy; 0x64uy; 0x7auy; 0xacuy; 0x79uy; 0x57uy
  ] in
  assert_norm (List.Tot.length l == 32);
  of_list l


val test_scalarmult:
    scalar:lbytes 32
  -> point:lbytes 32
  -> expected:lbytes 32 ->
  FStar.All.ML bool

let test_scalarmult scalar point expected =
  let computed = scalarmult scalar point in
  PS.print_compare true 32 expected computed
val test : _: Prims.unit -> FStar.All.ALL Prims.bool
_: Prims.unit -> FStar.All.ALL Prims.bool