|
| 1 | +# Copyright (c) The mlkem-native project authors |
| 2 | +# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT |
| 3 | + |
| 4 | +include ../Makefile_params.common |
| 5 | + |
| 6 | +HARNESS_ENTRY = harness |
| 7 | +HARNESS_FILE = enc_getnoise_eta1_eta2_harness |
| 8 | + |
| 9 | +# This should be a unique identifier for this proof, and will appear on the |
| 10 | +# Litani dashboard. It can be human-readable and contain spaces if you wish. |
| 11 | +PROOF_UID = mlk_enc_getnoise_eta1_eta2 |
| 12 | + |
| 13 | +DEFINES += |
| 14 | +INCLUDES += |
| 15 | + |
| 16 | +REMOVE_FUNCTION_BODY += |
| 17 | + |
| 18 | +PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE).c |
| 19 | +PROJECT_SOURCES += $(SRCDIR)/mlkem/src/indcpa.c |
| 20 | + |
| 21 | +CHECK_FUNCTION_CONTRACTS=mlk_enc_getnoise_eta1_eta2 |
| 22 | + |
| 23 | +# Note that the called function mlk_poly_getnoise_eta2_4x() is actually |
| 24 | +# just #define'd to be mlk_poly_getnoise_eta1_4x() |
| 25 | +ifeq ($(MLKEM_K),2) |
| 26 | +USE_FUNCTION_CONTRACTS = mlk_poly_getnoise_eta1122_4x |
| 27 | +USE_FUNCTION_CONTRACTS += mlk_poly_getnoise_eta2 |
| 28 | +else ifeq ($(MLKEM_K),3) |
| 29 | +USE_FUNCTION_CONTRACTS = mlk_poly_getnoise_eta1_4x |
| 30 | +else # MLKEM_K must be 4 |
| 31 | +USE_FUNCTION_CONTRACTS = mlk_poly_getnoise_eta1_4x |
| 32 | +USE_FUNCTION_CONTRACTS += mlk_poly_getnoise_eta2 |
| 33 | +endif |
| 34 | + |
| 35 | +APPLY_LOOP_CONTRACTS=on |
| 36 | +USE_DYNAMIC_FRAMES=1 |
| 37 | + |
| 38 | +# Disable any setting of EXTERNAL_SAT_SOLVER, and choose SMT backend instead |
| 39 | +EXTERNAL_SAT_SOLVER= |
| 40 | +CBMCFLAGS=--smt2 --slice-formula |
| 41 | + |
| 42 | +FUNCTION_NAME = mlk_enc_getnoise_eta1_eta2 |
| 43 | + |
| 44 | +# If this proof is found to consume huge amounts of RAM, you can set the |
| 45 | +# EXPENSIVE variable. With new enough versions of the proof tools, this will |
| 46 | +# restrict the number of EXPENSIVE CBMC jobs running at once. See the |
| 47 | +# documentation in Makefile.common under the "Job Pools" heading for details. |
| 48 | +# EXPENSIVE = true |
| 49 | + |
| 50 | +# This function is large enough to need... |
| 51 | +CBMC_OBJECT_BITS = 10 |
| 52 | + |
| 53 | +# If you require access to a file-local ("static") function or object to conduct |
| 54 | +# your proof, set the following (and do not include the original source file |
| 55 | +# ("mlkem/src/poly.c") in PROJECT_SOURCES). |
| 56 | +# REWRITTEN_SOURCES = $(PROOFDIR)/<__SOURCE_FILE_BASENAME__>.i |
| 57 | +# include ../Makefile.common |
| 58 | +# $(PROOFDIR)/<__SOURCE_FILE_BASENAME__>.i_SOURCE = $(SRCDIR)/mlkem/src/poly.c |
| 59 | +# $(PROOFDIR)/<__SOURCE_FILE_BASENAME__>.i_FUNCTIONS = foo bar |
| 60 | +# $(PROOFDIR)/<__SOURCE_FILE_BASENAME__>.i_OBJECTS = baz |
| 61 | +# Care is required with variables on the left-hand side: REWRITTEN_SOURCES must |
| 62 | +# be set before including Makefile.common, but any use of variables on the |
| 63 | +# left-hand side requires those variables to be defined. Hence, _SOURCE, |
| 64 | +# _FUNCTIONS, _OBJECTS is set after including Makefile.common. |
| 65 | + |
| 66 | +include ../Makefile.common |
0 commit comments