Skip to content

Commit c9d83fb

Browse files
committed
Merge branch 'jmcrawford45-patch-1'
2 parents 5e84519 + 9a36e56 commit c9d83fb

File tree

1 file changed

+19
-0
lines changed
  • core/src/main/java/org/bouncycastle/crypto/hpke

1 file changed

+19
-0
lines changed

core/src/main/java/org/bouncycastle/crypto/hpke/HPKE.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,25 @@ public HPKE(byte mode, short kemId, short kdfId, short aeadId)
7070

7171
}
7272

73+
public HPKE(byte mode, short kemId, short kdfId, short aeadId, KEM kem, int encSize)
74+
{
75+
this.mode = mode;
76+
this.kemId = kemId;
77+
this.kdfId = kdfId;
78+
this.aeadId = aeadId;
79+
this.hkdf = new HKDF(kdfId);
80+
this.kem = kem;
81+
if (aeadId == aead_AES_GCM128)
82+
{
83+
Nk = 16;
84+
}
85+
else
86+
{
87+
Nk = 32;
88+
}
89+
this.encSize = encSize;
90+
}
91+
7392
public int getEncSize()
7493
{
7594
return kem.getEncryptionSize();

0 commit comments

Comments
 (0)