예제 #1
0
 static IEnumerable _GetVarKey128BitKey()
 {
     foreach (var item in KATData.GetVarKey128BitKey())
     {
         yield return(new TestCaseData(item.CipherText.ToHex(), item));
     }
 }
예제 #2
0
        public static List <AlgoArrayResponse> GetVarKey128BitKey()
        {
            var results = KATData.GetVarKey128BitKey();

            VarKeyTransform(results);
            AllTransform(results);
            return(results);
        }
예제 #3
0
        public static List <AlgoArrayResponse> GetKeySBox256BitKey()
        {
            var results = KATData.GetKeySBox256BitKey();

            KeySBoxTransform(results);
            AllTransform(results);
            return(results);
        }
예제 #4
0
        public static List <AlgoArrayResponse> GetGfSBox(int keyLen)
        {
            switch (keyLen)
            {
            case 128:
                return(TransformKatDataToCtr(KATData.GetGFSBox128BitKey()));

            case 192:
                return(TransformKatDataToCtr(KATData.GetGFSBox192BitKey()));

            case 256:
                return(TransformKatDataToCtr(KATData.GetGFSBox256BitKey()));

            default:
                throw new ArgumentException($"Invalid keyLen: {keyLen}");
            }
        }
예제 #5
0
    public static void CreateKAT()
    {
        string str = File.ReadAllText(Application.dataPath + "/kat.json");

        KATData kATData = JsonUtility.FromJson <KATData>(str);

        foreach (var parent in kATData.obj)
        {
            GameObject obj = new GameObject(parent.name);
            obj.transform.localPosition = new Vector3(parent.pos_x, parent.pos_y, parent.pos_z);
            obj.transform.localRotation = new Quaternion(parent.rot_x, parent.rot_y, parent.rot_z, parent.rot_w);
            GameObject pare = GameObject.Find(parent.parentName);
            if (pare)
            {
                obj.transform.SetParent(pare.transform);
            }
        }
    }
예제 #6
0
    public static void SaveKAT()
    {
        objs.Clear();
        Debug.Log("5555");
        GameObject obj = Selection.activeGameObject;

        Debug.Log(obj.name);

        Dat dd = new Dat();

        dd.name       = obj.transform.name;
        dd.parentName = "111";
        dd.pos_x      = obj.transform.localPosition.x;
        dd.pos_y      = obj.transform.localPosition.y;
        dd.pos_z      = obj.transform.localPosition.z;

        dd.rot_x = obj.transform.localRotation.x;
        dd.rot_y = obj.transform.localRotation.y;
        dd.rot_z = obj.transform.localRotation.z;
        dd.rot_w = obj.transform.localRotation.w;

        dd.scal_x = obj.transform.localScale.x;
        dd.scal_y = obj.transform.localScale.y;
        dd.scal_z = obj.transform.localScale.z;

        objs.Add(dd);

        AddDat(obj.transform);

        KATData kATData = new KATData();

        Debug.Log(objs.Count);
        kATData.obj = objs.ToArray();
        string str = JsonUtility.ToJson(kATData);

        Debug.Log(str);
        File.WriteAllText(Application.dataPath + "/kat.json", str);
    }
예제 #7
0
        public static List <AlgoArrayResponse> GetVarKey256BitKey()
        {
            var initial = KATData.GetVarKey256BitKey();

            return(TransformKATDataToKATDataOFb(initial));
        }