• No se han encontrado resultados

O período alto-imperial

In document Vista de Descargar número completo (página 142-146)

SEQUÊNCIA ESTRATIGRÁFICA E MATERIAIS CERÂMICOS DO SÍTIO DA PÓVOA DO MILEU (GUARDA, PORTUGAL)

2. A SEQUÊNCIA OCUPACIONAL

2.1. O período alto-imperial

1. Asynchronous: A callback will be invoked upon completion of the operation 2. Synchronous: The operation perform function will return

Note: Freeing Memory: For Asychronous mode, user allocated memory may be freed once the callback is called. For Sychronous mode, user allocated memory may be freed once the Operation Perform API returns.

12.8.2 Symmetric Operations

A symmetric operation typically has the following cycle: session initialization, perform one or more operations and session removal when finished.

12.8.2.1 Session Initialization

1. Define a symmetric callback function as per the API prototype, see the API manual.

If synchronous operation is preferred, instead simply pass NULL to the API for the callback parameter.

2. Allocate memory for the session a. Session setup data

b. Session context

— Call session context get size API to get the size

Note: The session context memory must be available to the API for the duration of the session. Other session memory may be freed once the session is initialized.

3. Populate the symmetric session setup data structure a. Session priority (normal or high)

b. Symmetric operation (Cipher, Hash, Auth-Cipher, chained) c. Operation setup data structure (Cipher and/or Hash) d. Algorithm chaining order

4. Populate the operation setup data structure

• Cipher and/or Hash

• Refer to the API manual for full parameter details 5. Populate the symmetric session setup structure 6. Call the symmetric session initialize API

Now the session is initialized it can be used to perform symmetric operations.

12.8.2.2 Session Removal

When the session is no longer required it may be removed by calling the session removal API.

After the session has been removed the memory allocated for the session context may be freed.

12.8.2.3 Cipher, Hash, Nested and Authentication (Full Packet)

Sample code is provided for Cipher and Hash operations, see [SAMPLE_CODE] and the API manual. The basic steps involved in performing an operation are detailed below. A symmetric operation requires a session for that operation type to be initialized before performing an operation.

1. Initialize a session, see Section 12.8.2.1

2. Allocate memory for the source and destination buffer lists

• For an in-place operation only one buffer list needs to be allocated 3. Allocate memory for the symmetric operation data

Cipher Only:

• Allocate memory for the Initialization Vector (IV)

— 8-byte aligned for optimal performance

4. Populate the appropriate symmetric operation data structure, see the API manual 5. Call the symmetric operation perform API one or more times

6. Completion of operation, see Section 12.8.1 7. Remove session, see Section 12.8.2.2

12.8.2.4 Partial Packet Variation (Cipher, Hash, Authentication)

The following partial packet variation applies to the full packet sequences described for Cipher, Hash and Authentication (Section 12.8.2.3). Partial packets may be used in a situation where a large packet was segmented on the network.

Change the following steps from full packet requests:

Using the Intel® QuickAssist Technology Cryptographic API—Security Software

1. Populate the symmetric operation data structure 2. Call the symmetric operation perform API

With the following steps which are used for partial packets:

1. Populate the symmetric operation data structure and set packet type to partial 2. Call the symmetric operation perform API

3. Repeat steps 1 & 2 above for each partial packet which needs to be processed 4. For the final partial packet initialize the symmetric operation data structure and set

the packet type to last partial 5. Perform the operation

Note: Steps 1) and 2) may be repeated according to number of partial packets requiring Cipher/Hash/Authentication.

Note: The size of the data to be Hashed or Ciphered must be a multiple of the block size of the algorithm for all partial packets except the last partial.

Note: For Hash/Authentication the digest pointer and the digest verify flag are only used for the last partial.

12.8.2.5 Algorithm Chaining and Authenticated-Encryption

Algorithm chaining involves performing a cipher followed by a hash or a hash followed by a cipher in one operation. Authenticated-encryption involves performing a

authenticate followed by a cipher in one operation.

Sample code is provided for algorithm chaining operations; see [SAMPLE_CODE] and the API manual. The basic steps involved in performing an operation are detailed below.

1. Initialize a session, see Section 12.8.2.1

2. Allocate memory for the source and destination buffer lists

• For an in-place operation, only memory for the source buffer list needs to be allocated

3. Allocate memory for the symmetric operation data

4. Populate the appropriate symmetric operation data structures, see the API manual 5. Call the symmetric operation perform API one or more times

6. Completion of operation, see Section 12.8.1 7. Remove session, see Section 12.8.2.2 12.8.2.6 SSL, TLS Key and MGF Mask Generation

Refer to the API manual for full details of Key and Mask Generation operations.

1. Define a Flat Buffer callback function as per the API prototype, see the API manual.

If synchronous operation is preferred, instead simply pass NULL to the API for the callback parameter.

2. Allocate memory for the operation

3. Populate data for the appropriate operation data structure, see the API manual

• Fill in the Flat Buffers; pointer to data and length

• Fill in the options for the operation required

5. Completion of the operation, see Section 12.8.1

Note: The API for TLS key operations is based on the TLS 1.1 standard (RFC 4346). Backward compatibility is supported with the legacy TLS 1.0 standard (RFC 2246). The user-defined label should be used for backward compatibility with the client write key, server write key, and iv block. See the Cryptographic API for details of populating

CpaCyKeyGenTlsOpData, the operation data structure. Below are some examples of the parameter mapping to the Cryptographic API.

12.8.2.6.1 Setting CpaCyKeyGenTlsOpData Structure Fields In RFC 4346, Section 6.3 ‘key_block’ is described as:

key_block = PRF(SecurityParameters.master_secret, "key expansion",

SecurityParameters.server_random + SecurityParameters.client_random);

This maps to the Cryptographic API's CpaCyKeyGenTlsOpData as follows:

TLS Key-Material Derivation:

tlsOp = CPA_CY_KEY_TLS_OP_KEY_MATERIAL_DERIVE secret = master secret key

seed = server_random + client_random userLabel = NULL

12.8.2.6.2 Setting CpaCyKeyGenTlsOpData Structure Fields for backward compatibility 1. In RFC 2246, Section 6.3 ‘final_client_write_key’ is described as:

final_client_write_key = PRF(client_write_key, "client write key", client_random + server_random)[0..15]

This maps to the Cryptographic API’s CpaCyKeyGenTlsOpData as follows:

TLS User Defined Derivation:

tlsOp = CPA_CY_KEY_TLS_OP_USER_DEFINED secret = client_write_key

seed = client_random + server_random userLabel = "client write key"

2. In RFC 2246, Section 6.3 ‘final_server_write_key’ is described as:

final_client_write_key = PRF(server_write_key, "server write key", client_random +

Using the Intel® QuickAssist Technology Cryptographic API—Security Software

server_random)[0..15]

This maps to the Cryptographic API’s CpaCyKeyGenTlsOpData as follows:

TLS User Defined Derivation:

tlsOp = CPA_CY_KEY_TLS_OP_USER_DEFINED secret = server_write_key

seed = client_random + server_random userLabel = "server write key"

3. In RFC 2246, Section 6.3 ‘iv_block’ is described as:

iv_block = PRF("", "IV block", client_random + server_random)[0..15]

This maps to the Cryptographic API’s CpaCyKeyGenTlsOpData as follows:

TLS User Defined Derivation:

tlsOp = CPA_CY_KEY_TLS_OP_USER_DEFINED secret = NULL

seed = client_random + server_random userLabel = "IV block"

Note: Memory for the user label must be physically contiguous memory allocated by the user.

This memory must be available to the API for the duration of the operation, see Section 12.5 for details.

12.8.2.7 Generate Random Data

1. Define a random data callback function as per the API prototype, see the API manual. If synchronous operation is preferred, instead simply pass NULL to the API for the callback parameter.

2. Allocate memory for the operation

3. Populate data for the Random operation data structure, see the API manual 4. Call the Random data generation perform operation API

5. Completion of the operation, see Section 12.8.1

In document Vista de Descargar número completo (página 142-146)