diff --git a/src/cryptojwt/jwe/jwe_ec.py b/src/cryptojwt/jwe/jwe_ec.py index 3e3dc0f6..0bbd57e1 100644 --- a/src/cryptojwt/jwe/jwe_ec.py +++ b/src/cryptojwt/jwe/jwe_ec.py @@ -34,7 +34,7 @@ def ecdh_derive_key(key, epk, apu, apv, alg, dk_len): shared_key = key.exchange(ec.ECDH(), epk) # Derive the key # AlgorithmID || PartyUInfo || PartyVInfo || SuppPubInfo - otherInfo = bytes(alg) + \ + otherInfo = struct.pack("!I", len(alg)) + bytes(alg) + \ struct.pack("!I", len(apu)) + apu + \ struct.pack("!I", len(apv)) + apv + \ struct.pack("!I", dk_len)