def test_would_overflow_buffer(self):
        """ Test overflow of buffer. """
        nonce = "abc123"
        # key 0x2000 has all flags set
        key_handle = 0x2000

        self.assertEqual(64, self.hsm.load_random(16, offset = 8 - pyhsm.defines.YSM_DATA_BUF_SIZE))
        self.assertEqual(16, self.hsm.load_random(16, offset = 0)) # offset = 0 clears buffer
        self.assertEqual(17, self.hsm.load_random(1, offset = 16))
        self.assertEqual(17, self.hsm.load_random(7, offset = 10))
        self.assertEqual(63, self.hsm.load_random(1, offset = 62))
        self.assertEqual(64, self.hsm.load_random(63, offset = 62))
dataset/ETHPy150Open Yubico/python-pyhsm/test/test_buffer.py/TestBuffer.test_would_overflow_buffer/swapped operands of `-`