Files
rosenpass/analysis/crypto/kem.mpv
James Brownlee 91da0dfd2d feat: identity hiding in two stage process
Changed identity hiding test to work as a two stage process where
participants with fresh secure secret keys communicate with each other
and other compromised participants. Then the attacker is asked to
identify the difference between two of the secure participants as on of
them acts as a responder.
2024-01-03 18:35:54 +01:00

29 lines
720 B
Plaintext

#pragma once
#include "prelude/basic.mpv"
#include "prelude/bits.mpv"
#include "crypto/key.mpv"
#include "crypto/setup.mpv"
@module kem
type kem_sk.
type kem_pk.
fun kem_pub(kem_sk) : kem_pk.
fun kem_enc(kem_pk, key) : bits.
fun kem_dec(kem_sk, bits) : key
reduc forall sk:kem_sk, shk:key;
kem_dec(sk, kem_enc(kem_pub(sk), shk)) = shk.
fun kem_pk2b(kem_pk) : bits [typeConverter].
const kem_sk0:kem_sk.
letfun kem_pk0 = kem_pub(kem_sk0).
#if FULL_MODEL
fun kem_keyeq(bits, bits) : bool
reduc forall k:kem_pk, pt1:key, pt2:key;
kem_keyeq(kem_enc(k, pt1), kem_enc(k, pt2)) = true
otherwise forall k1:kem_pk, pt1:key, k2:kem_pk, pt2:key;
kem_keyeq(kem_enc(k1, pt1), kem_enc(k2, pt2)) = false.
#endif