equal
deleted
inserted
replaced
37 protected int outLen; |
37 protected int outLen; |
38 protected int seedLen; |
38 protected int seedLen; |
39 |
39 |
40 private static int alg2strength(String algorithm) { |
40 private static int alg2strength(String algorithm) { |
41 switch (algorithm.toUpperCase(Locale.ROOT)) { |
41 switch (algorithm.toUpperCase(Locale.ROOT)) { |
42 case "SHA-1": |
|
43 return 128; |
|
44 case "SHA-224": |
42 case "SHA-224": |
45 case "SHA-512/224": |
43 case "SHA-512/224": |
46 return 192; |
44 return 192; |
47 case "SHA-256": |
45 case "SHA-256": |
48 case "SHA-512/256": |
46 case "SHA-512/256": |
80 // Remember to sync with "securerandom.drbg.config" in java.security |
78 // Remember to sync with "securerandom.drbg.config" in java.security |
81 algorithm = "SHA-256"; |
79 algorithm = "SHA-256"; |
82 this.securityStrength = tryStrength; |
80 this.securityStrength = tryStrength; |
83 } |
81 } |
84 switch (algorithm.toUpperCase(Locale.ROOT)) { |
82 switch (algorithm.toUpperCase(Locale.ROOT)) { |
85 case "SHA-1": |
|
86 this.seedLen = 440 / 8; |
|
87 this.outLen = 160 / 8; |
|
88 break; |
|
89 case "SHA-224": |
83 case "SHA-224": |
90 case "SHA-512/224": |
84 case "SHA-512/224": |
91 this.seedLen = 440 / 8; |
85 this.seedLen = 440 / 8; |
92 this.outLen = 224 / 8; |
86 this.outLen = 224 / 8; |
93 break; |
87 break; |