diff options
Diffstat (limited to 'packages/meshbay-common/src/meshbay_common/groupbox.py')
| -rw-r--r-- | packages/meshbay-common/src/meshbay_common/groupbox.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/meshbay-common/src/meshbay_common/groupbox.py b/packages/meshbay-common/src/meshbay_common/groupbox.py index eb2f630..e020ed8 100644 --- a/packages/meshbay-common/src/meshbay_common/groupbox.py +++ b/packages/meshbay-common/src/meshbay_common/groupbox.py @@ -50,6 +50,10 @@ from cryptography.hazmat.primitives.kdf.hkdf import HKDF PURPOSE_INDEX = "index" PURPOSE_ACK = "ack" PURPOSE_UPLOAD = "upload" +# The chat epoch keys themselves, on their way to a member. The keys are what +# the chat archive is encrypted under; this is only how they travel, which is +# why rotating the group key costs a re-wrap and not a re-encryption. +PURPOSE_CHAT_KEYS = "chat_keys" # `salt=None` here and `salt: new Uint8Array(0)` in crypto.js agree — RFC 5869 # extracts with a zero key either way. Already proven in production by @@ -58,6 +62,7 @@ _INFO = { PURPOSE_INDEX: b"meshbay:index:v1", PURPOSE_ACK: b"meshbay:ack:v1", PURPOSE_UPLOAD: b"meshbay:upload:v1", + PURPOSE_CHAT_KEYS: b"meshbay:chat_keys:v1", } # One subkey per purpose, and `seal` draws a fresh 96-bit nonce per message, so |