Skip to content

Commit

Permalink
error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed Jan 10, 2024
1 parent c2f47b5 commit 1e5e7b5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down

0 comments on commit 1e5e7b5

Please sign in to comment.