<s> from __future__ import absolute_import , division , print_function <EOL> import binascii <EOL> import os <EOL> import pytest <EOL> from cryptography . hazmat . backends . interfaces import CipherBackend <EOL> from cryptography . hazmat . primitives . ciphers import algorithms , modes <EOL> from . utils import generate_encrypt_test <EOL> from ... utils import ( <EOL> load_cryptrec_vectors , load_nist_vectors <EOL> ) <EOL> @ pytest . mark . supported ( <EOL> only_if = lambda backend : backend . cipher_supported ( <EOL> algorithms . Camellia ( b"<STR_LIT:\x00>" * <NUM_LIT:16> ) , modes . ECB ( ) <EOL> ) , <EOL> skip_message = "<STR_LIT>" , <EOL> ) <EOL> @ pytest . mark . requires_backend_interface ( interface = CipherBackend ) <EOL> class TestCamelliaModeECB ( object ) : <EOL> test_ECB = generate_encrypt_test ( <EOL> load_cryptrec_vectors , <EOL> os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] , <EOL> lambda key , ** kwargs : algorithms . Camellia ( binascii . unhexlify ( key ) ) , <EOL> lambda ** kwargs : modes . ECB ( ) , <EOL> ) <EOL> @ pytest . mark . supported ( <EOL> only_if = lambda backend : backend . cipher_supported ( <EOL> algorithms . Camellia ( b"<STR_LIT:\x00>" * <NUM_LIT:16> ) , modes . CBC ( b"<STR_LIT:\x00>" * <NUM_LIT:16> ) <EOL> ) , <EOL> skip_message = "<STR_LIT>" , <EOL> ) <EOL> @ pytest . mark . requires_backend_interface ( interface = CipherBackend ) <EOL> class TestCamelliaModeCBC ( object ) : <EOL> test_CBC = generate_encrypt_test ( <EOL> load_nist_vectors , <EOL> os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> [ "<STR_LIT>" ] , <EOL> lambda key , ** kwargs : algorithms . Camellia ( binascii . unhexlify ( key ) ) , <EOL> lambda iv , ** kwargs : modes . CBC ( binascii . unhexlify ( iv ) ) , <EOL> ) <EOL> @ pytest . mark . supported ( <EOL> only_if = lambda backend : backend . cipher_supported ( <EOL> algorithms . Camellia ( b"<STR_LIT:\x00>" * <NUM_LIT:16> ) , modes . OFB ( b"<STR_LIT:\x00>" * <NUM_LIT:16> ) <EOL> ) , <EOL> skip_message = "<STR_LIT>" , <EOL> ) <EOL> @ pytest . mark . requires_backend_interface ( interface = CipherBackend ) <EOL> class TestCamelliaModeOFB ( object ) : <EOL> test_OFB = generate_encrypt_test ( <EOL> load_nist_vectors , <EOL> os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> [ "<STR_LIT>" ] , <EOL> lambda key , ** kwargs : algorithms . Camellia ( binascii . unhexlify ( key ) ) , <EOL> lambda iv , ** kwargs : modes . OFB ( binascii . unhexlify ( iv ) ) , <EOL> ) <EOL> @ pytest . mark . supported ( <EOL> only_if = lambda backend : backend . cipher_supported ( <EOL> algorithms . Camellia ( b"<STR_LIT:\x00>" * <NUM_LIT:16> ) , modes . CFB ( b"<STR_LIT:\x00>" * <NUM_LIT:16> ) <EOL> ) , <EOL> skip_message = "<STR_LIT>" , <EOL> ) <EOL> @ pytest . mark . requires_backend_interface ( interface = CipherBackend ) <EOL> class TestCamelliaModeCFB ( object ) : <EOL> test_CFB = generate_encrypt_test ( <EOL> load_nist_vectors , <EOL> os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> [ "<STR_LIT>" ] , <EOL> lambda key , ** kwargs : algorithms . Camellia ( binascii . unhexlify ( key ) ) , <EOL> lambda iv , ** kwargs : modes . CFB ( binascii . unhexlify ( iv ) ) , <EOL> ) </s>
