Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/Crypto/Cipher/_state_machine.py: 89%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

9 statements  

1# SPDX-FileCopyrightText: 2026 Helder Eijs <helderijs@gmail.com> 

2# SPDX-License-Identifier: BSD-2-Clause 

3 

4"""The order in which the methods of a cipher object can be called. 

5 

6Each cipher object keeps in ``self._next`` the methods that the caller 

7may invoke next. Each method checks that it is in ``self._next`` (or raises 

8``TypeError``), and then sets ``self._next`` to the methods allowed after it. 

9""" 

10 

11from enum import Enum 

12 

13 

14class Method(Enum): 

15 """A method of a cipher object""" 

16 

17 UPDATE = "update" 

18 ENCRYPT = "encrypt" 

19 DECRYPT = "decrypt" 

20 DIGEST = "digest" 

21 VERIFY = "verify"