key_provider=VALUES["data_keys"][0].key_provider, encrypted_data_key=VALUES["data_keys"][0].encrypted_data_key, ) ]), content_type=ContentType.FRAMED_DATA, frame_length=32, commitment_key=six. b("\x00\xfa\x8c\xdd\x08Au\xc6\x92_4\xc5\xfb\x90\xaf\x8f\xa1D\xaf\xcc\xd25\xa8\x0b\x0b\x16\x92\x91W\x01\xb7\x84" ), ) VALUES["deserialized_header_auth_block"] = MessageHeaderAuthentication( iv=VALUES["header_auth_base"].iv, tag=VALUES["header_auth_base"].tag) VALUES["deserialized_header_auth_block_v2"] = MessageHeaderAuthentication( iv=b"\x00" * 12, tag=VALUES["header_auth_base"].tag) VALUES["deserialized_body_block"] = MessageNoFrameBody( iv=VALUES["non_framed_base"].iv, ciphertext=VALUES["non_framed_base"].ciphertext, tag=VALUES["non_framed_base"].tag) VALUES["deserialized_footer"] = MessageFooter(VALUES["signature"]) VALUES["deserialized_empty_footer"] = MessageFooter(b"") VALUES["deserialized_body_final_frame_single"] = MessageFrameBody( iv=VALUES["final_frame_base"].iv, ciphertext=VALUES["final_frame_base"].ciphertext, tag=VALUES["final_frame_base"].tag, sequence_number=1, final_frame=True, ) VALUES["deserialized_body_frame_1"] = MessageFrameBody( iv=VALUES["frame_base"].iv, ciphertext=VALUES["frame_base"].ciphertext, tag=VALUES["frame_base"].tag, sequence_number=1,
def test_message_no_frame_body_succeeds(): test = MessageNoFrameBody(iv=b'', ciphertext=b'', tag=b'') assert test.sequence_number == 1 assert test.final_frame
encrypted_data_keys=set([EncryptedDataKey( key_provider=VALUES['data_keys'][0].key_provider, encrypted_data_key=VALUES['data_keys'][0].encrypted_data_key )]), content_type=ContentType.FRAMED_DATA, content_aad_length=0, header_iv_length=Algorithm.AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384.iv_len, frame_length=32 ) VALUES['deserialized_header_auth_block'] = MessageHeaderAuthentication( iv=VALUES['header_auth_base'].iv, tag=VALUES['header_auth_base'].tag ) VALUES['deserialized_body_block'] = MessageNoFrameBody( iv=VALUES['non_framed_base'].iv, ciphertext=VALUES['non_framed_base'].ciphertext, tag=VALUES['non_framed_base'].tag ) VALUES['deserialized_footer'] = MessageFooter(VALUES['signature']) VALUES['deserialized_empty_footer'] = MessageFooter(b'') VALUES['deserialized_body_final_frame_single'] = MessageFrameBody( iv=VALUES['final_frame_base'].iv, ciphertext=VALUES['final_frame_base'].ciphertext, tag=VALUES['final_frame_base'].tag, sequence_number=1, final_frame=True ) VALUES['deserialized_body_frame_1'] = MessageFrameBody( iv=VALUES['frame_base'].iv, ciphertext=VALUES['frame_base'].ciphertext, tag=VALUES['frame_base'].tag,
def test_message_no_frame_body_fails(iv, ciphertext, tag): with pytest.raises(TypeError): MessageNoFrameBody(iv=iv, ciphertext=ciphertext, tag=tag)