aboutsummaryrefslogtreecommitdiffstats
path: root/examples/smtbmc/demo1.v
blob: 567dde1483e9307cd188bbb31875c8045da9e294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module demo1(input clk, input addtwo, output iseven);
	reg [3:0] cnt;
	wire [3:0] next_cnt;

	inc inc_inst (addtwo, iseven, cnt, next_cnt);

	always @(posedge clk)
		cnt = (iseven ? cnt == 10 : cnt == 11) ? 0 : next_cnt;

`ifdef FORMAL
	assert property (cnt != 15);
	initial assume (!cnt[2]);
`endif
endmodule

module inc(input addtwo, output iseven, input [3:0] a, output [3:0] y);
	assign iseven = !a[0];
	assign y = a + (addtwo ? 2 : 1);
endmodule
nst EVP_MD *, ENGINE *); int Cryptography_HMAC_Update(HMAC_CTX *, const unsigned char *, size_t); int Cryptography_HMAC_Final(HMAC_CTX *, unsigned char *, unsigned int *); int Cryptography_HMAC_CTX_copy(HMAC_CTX *, HMAC_CTX *); """ MACROS = """ """ CUSTOMIZATIONS = """ int Cryptography_HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int key_len, const EVP_MD *md, ENGINE *impl) { #if OPENSSL_VERSION_NUMBER >= 0x010000000 return HMAC_Init_ex(ctx, key, key_len, md, impl); #else HMAC_Init_ex(ctx, key, key_len, md, impl); return 1; #endif } int Cryptography_HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t data_len) { #if OPENSSL_VERSION_NUMBER >= 0x010000000 return HMAC_Update(ctx, data, data_len); #else HMAC_Update(ctx, data, data_len); return 1; #endif } int Cryptography_HMAC_Final(HMAC_CTX *ctx, unsigned char *digest, unsigned int *outlen) { #if OPENSSL_VERSION_NUMBER >= 0x010000000 return HMAC_Final(ctx, digest, outlen); #else HMAC_Final(ctx, digest, outlen); return 1; #endif } int Cryptography_HMAC_CTX_copy(HMAC_CTX *dst_ctx, HMAC_CTX *src_ctx) { #if OPENSSL_VERSION_NUMBER >= 0x010000000 return HMAC_CTX_copy(dst_ctx, src_ctx); #else HMAC_CTX_init(dst_ctx); if (!EVP_MD_CTX_copy_ex(&dst_ctx->i_ctx, &src_ctx->i_ctx)) { goto err; } if (!EVP_MD_CTX_copy_ex(&dst_ctx->o_ctx, &src_ctx->o_ctx)) { goto err; } if (!EVP_MD_CTX_copy_ex(&dst_ctx->md_ctx, &src_ctx->md_ctx)) { goto err; } memcpy(dst_ctx->key, src_ctx->key, HMAC_MAX_MD_CBLOCK); dst_ctx->key_length = src_ctx->key_length; dst_ctx->md = src_ctx->md; return 1; err: return 0; #endif } """ CONDITIONAL_NAMES = {}