Apparatus for cryptographic operations on information and associated methods
An apparatus includes an encryption circuit. The encryption circuit includes a block function circuit to generate a plurality of blocks of output data. A first part of a keystream is generated from a block of output data having an initial sequence number. A second part of the keystream is generated from blocks of output having sequence numbers other than the initial sequence number.
1 . An apparatus comprising:
an encryption circuit comprising:
a block function circuit configured to generate a plurality of blocks of output data,
wherein a hash key value and a first part of a keystream are generated from a block of output data having an initial sequence number, and
wherein a second part of the keystream is generated from blocks of output data having sequence numbers other than the initial sequence number.
2 . The apparatus according to claim 1 , wherein the encryption circuit comprises an authenticated encryption with associated data (AEAD) circuit.
3 . The apparatus according to claim 2 , further comprising:
an authentication circuit configured to generate a tag based on input data and associated data,
wherein the input data is based on the keystream and the associated data includes the hash key value.
4 . The apparatus according to claim 3 , wherein the authentication circuit comprises a finite state machine (FSM) configured to generate the tag based on the hash key value and based on ciphertext generated using the keystream.
5 . The apparatus according to claim 2 , further comprising:
an authentication circuit,
wherein the authentication circuit comprises a Poly 1305 authenticator configured to generate a tag based on the hash key value and based on ciphertext generated using the keystream and plaintext.
6 . The apparatus according to claim 1 , wherein the block function circuit generates the plurality of blocks of output data based on a constant, a key, and a nonce.
7 . The apparatus according to claim 1 , wherein the block function circuit comprises a finite state machine (FSM).
8 . The apparatus according to claim 1 ,
wherein the block function circuit provides a ChaCha20 block function, and
wherein the block of output data having the initial sequence number includes more state than used by the ChaCha20 block function.
9 . The apparatus according to claim 1 , wherein the hash key value includes a first partial hash key value and a second partial hash key value and the block function circuit is configured to deconstruct the block of output data having the initial sequence number into the first partial hash key value, the second partial hash key value, and the first part of the keystream.
10 . The apparatus according to claim 9 , wherein the apparatus further comprises an authenticator circuit configured to generate a tag by using the first partial hash key value in a modular multiply with an accumulator value based on the keystream to generate an updated accumulator value and by adding the second partial hash key value to the updated accumulator value.
11 . An apparatus, comprising:
an encryption circuit comprising:
a block function circuit configured to use ChaCha20 block functionality to generate a plurality of blocks of output data having respective sequence numbers; and
a finite state machine (FSM) configured to generate a hash key value and a first part of a keystream from a block of output data having an initial sequence number, and to generate a second part of the keystream from blocks of output data having sequence numbers greater than the initial sequence number.
12 . The apparatus according to claim 11 , wherein the encryption circuit comprises an authenticated encryption with associated data (AEAD) circuit.
13 . The apparatus according to claim 11 , further comprising an authentication circuit that generates a tag based on input data and associated data.
14 . The apparatus according to claim 11 , further comprising:
an authentication circuit,
wherein the authentication circuit comprises a Poly 1305 authenticator configured to generate a tag based on the hash key value and based on ciphertext generated using the keystream and plaintext.
15 . The apparatus according to claim 11 , wherein the block function circuit generates the plurality of blocks of output data based on a constant, a key, and a nonce.
16 . A method of encrypting information, the method comprising:
using a block function to generate a plurality of blocks of output data;
generating a hash key value and a first part of a keystream from a block of output data having an initial sequence number; and
generating a second part of the keystream from blocks of output data having sequence numbers other than the initial sequence number.
17 . The method according to claim 16 , wherein encrypting information comprises an authenticated encryption with associated data (AEAD) operation.
18 . The method according to claim 16 , further comprising authenticating information by generating a tag based on input data and associated data, wherein the input data is based on the keystream and the associated data includes the hash key value.
19 . The method according to claim 18 , further comprising:
generating ciphertext using the keystream and plaintext,
wherein authenticating information by generating the tag based on input data and associated data comprises using a Poly 1305 authenticator to generate the tag based on the hash key value and the ciphertext.
20 . The method according to claim 16 , wherein using the block function to generate the plurality of blocks of output data comprises using a ChaCha20 block function.
21 . The method according to claim 16 , wherein using the block function to generate the plurality of blocks of output data comprises using a constant, a key, and a nonce.