source: trunk/CrypPlugins/KeySearcher/KeyPattern/LinearKeyMovement.cs @ 2061

Last change on this file since 2061 was 2061, checked in by Sven Rech, 11 years ago

Added code to generate openCL bruteforce code in KeySearcher.
Not used yet, so don't try it

File size: 1.5 KB
Line 
1/*                             
2   Copyright 2010 Sven Rech (svenrech at googlemail dot com), Uni Duisburg-Essen
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15*/
16
17using System;
18using System.Collections.Generic;
19using System.Linq;
20using System.Text;
21
22namespace KeySearcher.KeyPattern
23{
24    /// <summary>
25    /// This class represents key movements which can be described by A*x+B
26    /// </summary>
27    public class LinearKeyMovement : IKeyMovement
28    {
29        public int A
30        {
31            get;
32            private set;
33        }
34
35        public int B
36        {
37            get;
38            private set;
39        }
40
41        public int UpperBound
42        {
43            get;
44            private set;
45        }
46
47        public LinearKeyMovement(int a, int b, int upperBound)
48        {
49            this.A = a;
50            this.B = b;
51            this.UpperBound = upperBound;
52        }
53
54        public int Count()
55        {
56            return UpperBound;
57        }
58    }
59}
Note: See TracBrowser for help on using the repository browser.