diff --git a/cryptography/src/main/java/com/salesforce/apollo/cryptography/EncryptionAlgorithm.java b/cryptography/src/main/java/com/salesforce/apollo/cryptography/EncryptionAlgorithm.java index e0979c9a2..603ddb494 100644 --- a/cryptography/src/main/java/com/salesforce/apollo/cryptography/EncryptionAlgorithm.java +++ b/cryptography/src/main/java/com/salesforce/apollo/cryptography/EncryptionAlgorithm.java @@ -105,7 +105,7 @@ final public SecretKey decapsulate(PrivateKey privateKey, byte[] encapsulated, S var kem = KEM.getInstance(DHKEM); return kem.newDecapsulator(privateKey).decapsulate(encapsulated, 0, encapsulated.length, algorithm); } catch (NoSuchAlgorithmException | InvalidKeyException | DecapsulateException e) { - throw new IllegalArgumentException("Invalid public key", e); + throw new IllegalArgumentException("error decapsulating", e); } } @@ -114,7 +114,7 @@ final public KEM.Encapsulated encapsulated(PublicKey publicKey) { var kem = KEM.getInstance(DHKEM); return kem.newEncapsulator(publicKey).encapsulate(); } catch (NoSuchAlgorithmException | InvalidKeyException e) { - throw new IllegalArgumentException("Invalid public key", e); + throw new IllegalArgumentException("error encapsulating", e); } }