Skip to content

Commit

Permalink
Merge branch 'jmcrawford45-patch-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Jan 14, 2025
2 parents 5e84519 + 9a36e56 commit c9d83fb
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 c9d83fb

Please sign in to comment.