コード例 #1
0
        public bool Predicate(Concat3Response resp)
        {
            VProgram_API.AssumeTrusted(Entity.Of("Alice"));
            var tmp      = resp.first + resp.second;
            var expected = tmp + resp.third;

            return(expected == resp.output);
        }
コード例 #2
0
            public bool LoginSafety(RPAuthenticationConclusion conc)
            {
                var googleUser = GoogleUserPrincipal(conc.googleUsername);

                VProgram_API.AssumeTrustedServer(googlePrincipal);
                VProgram_API.AssumeTrustedServer(SVX_Principal);
                VProgram_API.AssumeTrusted(googleUser);

                return(VProgram_API.ActsFor(conc.authenticatedClient, googleUser));
            }
コード例 #3
0
            public bool LoginSafety(AuthenticationConclusion conc)
            {
                var userPrincipal = IdPUserPrincipal(conc.idpUsername);

                VProgram_API.AssumeTrusted(idpPrincipal);
                VProgram_API.AssumeTrusted(rpPrincipal);
                VProgram_API.AssumeTrusted(userPrincipal);
                // BCT accepts this code but silently mistranslates it!
                //return VProgram_API.ActsForAny(conc.authenticatedClient,
                //    new PrincipalHandle[] { idpPrincipal, rpPrincipal, IdPUserPrincipal(conc.idpUsername) });
                var targets = new Principal[3];

                targets[0] = idpPrincipal;
                targets[1] = rpPrincipal;
                targets[2] = userPrincipal;
                return(VProgram_API.ActsForAny(conc.authenticatedClient, targets));
            }