Skip to content

Commit

Permalink
With AESNI, encrypt 8 blocks in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
Legrandin committed Jun 5, 2018
1 parent 42f4ba3 commit e1c7272
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 112 deletions.
24 changes: 24 additions & 0 deletions lib/Crypto/Cipher/__init__.py
@@ -1,3 +1,27 @@
#
# A block cipher is instantiated as a combination of:
# 1. A base cipher (such as AES)
# 2. A mode of operation (such as CBC)
#
# Both items are implemented as C modules.
#
# The API of #1 is (replace "AES" with the name of the actual cipher):
# - AES_start_operaion(key) --> base_cipher_state
# - AES_encrypt(base_cipher_state, in, out, length)
# - AES_decrypt(base_cipher_state, in, out, length)
# - AES_stop_operation(base_cipher_state)
#
# Where base_cipher_state is AES_State, a struct with BlockBase (set of
# pointers to encrypt/decrypt/stop) followed by cipher-specific data.
#
# The API of #2 is (replace "CBC" with the name of the actual mode):
# - CBC_start_operation(base_cipher_state) --> mode_state
# - CBC_encrypt(mode_state, in, out, length)
# - CBC_decrypt(mode_state, in, out, length)
# - CBC_stop_operation(mode_state)
#
# where mode_state is a a pointer to base_cipher_state plus mode-specific data.

import os

from Crypto.Cipher._mode_ecb import _create_ecb_cipher
Expand Down

0 comments on commit e1c7272

Please sign in to comment.