Skip to content

Commit

Permalink
Merge branch 'patch-1' of https://github.com/jmcrawford45/bc-java int…
Browse files Browse the repository at this point in the history
…o jmcrawford45-patch-1
  • Loading branch information
dghgit committed Jan 14, 2025
2 parents 5e84519 + 928626d commit 9a36e56
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions core/src/main/java/org/bouncycastle/crypto/hpke/HPKE.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,25 @@ public HPKE(byte mode, short kemId, short kdfId, short aeadId)

}

public HPKE(byte mode, short kemId, short kdfId, short aeadId, KEM kem, int encSize)
{
this.mode = mode;
this.kemId = kemId;
this.kdfId = kdfId;
this.aeadId = aeadId;
this.hkdf = new HKDF(kdfId);
this.kem = kem;
if (aeadId == aead_AES_GCM128)
{
Nk = 16;
}
else
{
Nk = 32;
}
this.encSize = encSize;
}

public int getEncSize()
{
return kem.getEncryptionSize();
Expand Down

0 comments on commit 9a36e56

Please sign in to comment.