Switched to 256-bit ECDSA. Modified some tests because two signatures

over the same data are not necessarily identical. Key generation is
fast again - should I be worried? ;-)
This commit is contained in:
akwizgran
2011-07-25 10:49:41 +01:00
parent fb95565880
commit b1f27757df
3 changed files with 11 additions and 11 deletions

View File

@@ -13,12 +13,13 @@ import net.sf.briar.api.crypto.KeyParser;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
public class CryptoComponentImpl implements CryptoComponent {
class CryptoComponentImpl implements CryptoComponent {
private static final String PROVIDER = "BC";
private static final String DIGEST_ALGO = "SHA-256";
private static final String KEY_PAIR_ALGO = "RSA";
private static final String SIGNATURE_ALGO = "SHA256withRSA";
private static final String KEY_PAIR_ALGO = "ECDSA";
private static final int KEY_PAIR_KEYSIZE = 256;
private static final String SIGNATURE_ALGO = "ECDSA";
private final KeyParser keyParser;
private final KeyPairGenerator keyPairGenerator;
@@ -29,6 +30,7 @@ public class CryptoComponentImpl implements CryptoComponent {
keyParser = new KeyParserImpl(KEY_PAIR_ALGO, PROVIDER);
keyPairGenerator = KeyPairGenerator.getInstance(KEY_PAIR_ALGO,
PROVIDER);
keyPairGenerator.initialize(KEY_PAIR_KEYSIZE);
} catch(NoSuchAlgorithmException impossible) {
throw new RuntimeException(impossible);
} catch(NoSuchProviderException impossible) {