public static EncryptedSealBfvMatrix Read(StreamReader str, EncryptedSealBfvEnvironment env) { var mtx = new EncryptedSealBfvMatrix(); var line = str.ReadLine(); if (line != "<Start LargeEncryptedMatrix>") { throw new Exception("Bad stream format."); } mtx.Format = (EMatrixFormat)Enum.Parse(mtx.Format.GetType(), str.ReadLine()); mtx.leVectors = new EncryptedSealBfvVector[int.Parse(str.ReadLine())]; for (int i = 0; i < mtx.leVectors.Length; i++) { mtx.leVectors[i] = EncryptedSealBfvVector.Read(str, env); } line = str.ReadLine(); if (line != "<End LargeEncryptedMatrix>") { throw new Exception("Bad stream format."); } return(mtx); }
public IVector LoadVector(StreamReader str) { return(Utils.ProcessInEnv(env => EncryptedSealBfvVector.Read(str, env as EncryptedSealBfvEnvironment), this)); }