Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
RC5KeyParameters | 32 | 5 | 0% | 3 | 8 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.crypto.params.cipher.symmetric; | |
21 | ||
22 | /** | |
23 | * Derived version of key parameters to specify rounds of RC5. | |
24 | * | |
25 | * WARNING: RSA Security own the US Patent US5724428 A on this algorithm. Therefore, before expiration of this patent, | |
26 | * which will happen in november 2015, the usage of this algorithm is subject to restricted usage on the US territories. | |
27 | * RC5 is a registered trademark of RSA Security. | |
28 | * | |
29 | * @version $Id: 804c41d37459a537ec763a144edca8b0384b1be8 $ | |
30 | * @since 5.4M1 | |
31 | */ | |
32 | public class RC5KeyParameters extends KeyParameter | |
33 | { | |
34 | private static final int ROUNDS = 12; | |
35 | ||
36 | private final int rounds; | |
37 | ||
38 | /** | |
39 | * Initialize parameters with a default number of rounds set to {@value #ROUNDS}. | |
40 | * | |
41 | * @param key the key. | |
42 | */ | |
43 | 0 | public RC5KeyParameters(byte[] key) |
44 | { | |
45 | 0 | super(key); |
46 | 0 | this.rounds = ROUNDS; |
47 | } | |
48 | ||
49 | /** | |
50 | * Initialize parameters. | |
51 | * | |
52 | * @param key the key. | |
53 | * @param rounds the number of "rounds" in the encryption operation between 8 and 127. | |
54 | */ | |
55 | 0 | public RC5KeyParameters(byte[] key, int rounds) |
56 | { | |
57 | 0 | super(key); |
58 | 0 | this.rounds = rounds; |
59 | } | |
60 | ||
61 | /** | |
62 | * @return the number of "rounds" in the encryption operation between 8 and 127. | |
63 | */ | |
64 | 0 | public int getRounds() |
65 | { | |
66 | 0 | return this.rounds; |
67 | } | |
68 | } |