MpcLib.MpcProtocols.Bgw.Vss.MultStepBCaseShare.createRandom C# (CSharp) Method

createRandom() public static method

public static createRandom ( int prime ) : MultStepBCaseShare
prime int
return MultStepBCaseShare
        public static MultStepBCaseShare createRandom(int prime)
        {
            double d = (new Random(1)).NextDouble();
            if (d < 0.25)
                return null;
            var multStepBCaseShare = new MultStepBCaseShare();
            multStepBCaseShare.AShare = new Zp(prime, (int)Math.Floor(d * 20));
            multStepBCaseShare.BShare = new Zp(prime, (int)Math.Floor(d * 40));
            multStepBCaseShare.AbShare = new Zp(prime, (int)Math.Floor(d * 60));
            multStepBCaseShare.RShare = new Zp(prime, (int)Math.Floor(d * 80));
            return multStepBCaseShare;
        }