|
MOC_EXTERN MSTATUS | AESCTRInit (MOC_SYM(hwAccelDescr hwAccelCtx) AES_CTR_Ctx *aesCtrCtx, const ubyte *keyMaterial, sbyte4 keyLength, const ubyte initCounter[AES_BLOCK_SIZE]) |
| Prepare the key schedule for an existing AES-CTR context. More...
|
|
MOC_EXTERN MSTATUS | CloneAESCTRCtx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx) |
| Clone a AES-CTR context. More...
|
|
MOC_EXTERN BulkCtx | CreateAESCTRCtx (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *keyMaterial, sbyte4 keyLength, sbyte4 encrypt) |
| Create a new AES-CTR context data structure and prepare the key schedule. More...
|
|
MOC_EXTERN BulkCtx | CreateAesCtrCtx (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *keyMaterial, sbyte4 keyLength, sbyte4 encrypt) |
| Create a new AES-CTR context data structure and prepare the key schedule for using with IPsec Encapsulating Security Payload. More...
|
|
MOC_EXTERN MSTATUS | DeleteAESCTRCtx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ctx) |
| Delete AES-CTR context data structure. More...
|
|
MOC_EXTERN MSTATUS | DoAESCTR (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *data, sbyte4 dataLength, sbyte4 encrypt, ubyte *iv) |
| AES-CTR encrypt or decrypt a data buffer. More...
|
|
MOC_EXTERN MSTATUS | DoAesCtr (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *data, sbyte4 dataLength, sbyte4 encrypt, ubyte *iv) |
| AES-CTR encrypt or decrypt a data buffer. More...
|
|
MOC_EXTERN MSTATUS | DoAESCTREx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *data, sbyte4 dataLength, sbyte4 encrypt, ubyte *iv, sbyte4 limit) |
| AES-CTR encrypt or decrypt a data buffer. More...
|
|
MOC_EXTERN MSTATUS | DoAesCtrEx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *data, sbyte4 dataLength, sbyte4 encrypt, ubyte *iv) |
| AES-CTR encrypt or decrypt a data buffer. More...
|
|
MOC_EXTERN MSTATUS | GetCounterBlockAESCTR (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte pCounterBuffer[AES_BLOCK_SIZE]) |
| AES-CTR get current counter block used in given context. More...
|
|
Header file for the NanoCrypto AES-CTR API.
MOC_EXTERN BulkCtx CreateAESCTRCtx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte * |
keyMaterial, |
|
|
sbyte4 |
keyLength, |
|
|
sbyte4 |
encrypt |
|
) |
| |
This function creates and returns a context data structure for AES operations, and prepares the key schedule (intermediate key material). This is the first function your application calls when performing AES-CTR operations (encryption or decryption). Your application uses the returned structure in subsequent DoAESCTR() function calls.
FIPS Approved |
|
Suite B Algorithm |
|
Flowchart | AES-CTR |
The AES-CTR context is an opaque data structure that holds information such as key length, key schedule, counter block, and mode of operation. To avoid memory leaks, your application code must call the DeleteAESCTRCtx function after completing AES-related operations (because the AES-CTR context is dynamically allocated by this function during context creation).
- Warning
- If
NULL
is returned for the context pointer, you cannot use it as input to subsequent AES function calls.
There are no flag dependencies to enable this function.
aes_ctr.h
- Parameters
-
hwAccelCtx | If a hardware acceleration flag is defined, this macro expands to an additional parameter, "hwAccelDescr
hwAccelCtx". Otherwise, this macro resolves to nothing. But... what does the user specify? In the 5.3.1 docs, we just said that this was "Reserved
for future use." Ditto this for all aes_ccm.{c,h} functions. |
keyMaterial | Key material plus counter block. |
keyLength | Number of octets for AES key plus a fixed length counter block (AES_BLOCK_SIZE). Valid key lengths are: AES-CTR-128(16 + 16 = 32 octets), AES-CTR-192(40 octets), and AES-CTR-256 (48 octets). |
encrypt | TRUE to prepare the key schedule for encryption; FALSE to prepare the key schedule for decryption. |
- Returns
NULL
if any error; otherwise pointer to created AES-CTR context.
Confirm that this function appears properly in the output; it's in question given the compiler-controlled declarations.
aes_ctr.h
MOC_EXTERN BulkCtx CreateAesCtrCtx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) ubyte * |
keyMaterial, |
|
|
sbyte4 |
keyLength, |
|
|
sbyte4 |
encrypt |
|
) |
| |
This function creates and returns a context data structure for AES operations, and prepares the key schedule (intermediate key material). This is the first function your application calls when performing AES-CTR operations (encryption or decryption). Your application uses the returned structure in subsequent DoAesCtr() or DoAesCtrEx() function calls. Counter block must be initialized to one. Key material pointer must have 4 octet nonce following key.
FIPS Approved |
|
Suite B Algorithm |
|
Flowchart | AES-CTR |
The AES-CTR context is an opaque data structure that holds information such as key length, key schedule, counter block, and mode of operation. To avoid memory leaks, your application code must call the DeleteAESCTRCtx function after completing AES-related operations (because the AES-CTR context is dynamically allocated by this function during context creation).
- Warning
- If
NULL
is returned for the context pointer, you cannot use it as input to subsequent AES function calls.
There are no flag dependencies to enable this function.
aes_ctr.h
- Parameters
-
hwAccelCtx | If a hardware acceleration flag is defined, this macro expands to an additional parameter, "hwAccelDescr
hwAccelCtx". Otherwise, this macro resolves to nothing. But... what does the user specify? In the 5.3.1 docs, we just said that this was "Reserved
for future use." Ditto this for all aes_ccm.{c,h} functions. |
keyMaterial | Key material plus nonce blocks. |
keyLength | Number of octets for AES key plus a fixed length counter block (AES_BLOCK_SIZE). Valid key lengths are: AES-CTR-128(16 + 4 = 20 octets), AES-CTR-192(28 octets), and AES-CTR-256 (36 octets). |
encrypt | TRUE to prepare the key schedule for encryption; FALSE to prepare the key schedule for decryption. |
- Returns
NULL
if any error; otherwise pointer to created AES-CTR context.
Confirm that this function appears properly in the output; it's in question given the compiler-controlled declarations.
aes_ctr.h
MOC_EXTERN MSTATUS DoAESCTR |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
ctx, |
|
|
ubyte * |
data, |
|
|
sbyte4 |
dataLength, |
|
|
sbyte4 |
encrypt, |
|
|
ubyte * |
iv |
|
) |
| |
This function AES-CTR encrypts or decrypts a data buffer. Before calling this function, your application must call the CreateAESCTRCtx() function to dynamically create a valid AES-CTR context. For RFC 3686 usage, the IV should be NULL. If the IV parameter is not NULL, the contents of the IV are copied to counter block context within AES-CTR context. The internal counter block is incremented for each block that is encrypted/decrypted. AES in CTR mode does not require that the submitted data buffer be an even multiple of the AES block size (128 bits). Therefore, no padding is required, which makes this mode compatible with stream data.
FIPS Approved |
|
Suite B Algorithm |
|
Flowchart | AES-CTR |
There are no flag dependencies to enable this function.
aes_ctr.h
- Parameters
-
hwAccelCtx | If a hardware acceleration flag is defined, this macro expands to an additional parameter, "hwAccelDescr
hwAccelCtx". Otherwise, this macro resolves to nothing. |
ctx | AES-CTR context, previously created by CreateAESCTRCtx(). |
data | Data to be encrypted or decrypted. |
dataLength | Number of octets of data to encrypt or decrypt (data ). |
encrypt | TRUE to encrypt the data; FALSE to decrypt the data. |
iv | Usually NULL, optionally used to pass in a new counter block of AES_BLOCK_SIZE. |
- Returns
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.
aes_ctr.h
MOC_EXTERN MSTATUS DoAesCtr |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
ctx, |
|
|
ubyte * |
data, |
|
|
sbyte4 |
dataLength, |
|
|
sbyte4 |
encrypt, |
|
|
ubyte * |
iv |
|
) |
| |
This function AES-CTR encrypts or decrypts a data buffer. Before calling this function, your application must call the CreateAESCTRCtx() function to dynamically create a valid AES-CTR context. IV parameter must not be null, and must be at least 8 octets long. Note only first 8 bytes will be used. Counter block is incremented for each block that is encrypted/decrypted. AES in CTR mode does not require that the submitted data buffer be an even multiple of the AES block size (128 bits). Therefore, no padding is required, which makes this mode compatible with stream data.
FIPS Approved |
|
Suite B Algorithm |
|
Flowchart | AES-CTR |
There are no flag dependencies to enable this function.
aes_ctr.h
- Parameters
-
hwAccelCtx | If a hardware acceleration flag is defined, this macro expands to an additional parameter, "hwAccelDescr
hwAccelCtx". Otherwise, this macro resolves to nothing. |
ctx | AES-CTR context, previously created by CreateAesCtrCtx(). |
data | Data to be encrypted or decrypted. |
dataLength | Number of octets of data to encrypt or decrypt (data ). |
encrypt | TRUE to encrypt the data; FALSE to decrypt the data. |
iv | Must be 8 octets, will not override nonce or counter. |
- Returns
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.
aes_ctr.h
MOC_EXTERN MSTATUS DoAESCTREx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
ctx, |
|
|
ubyte * |
data, |
|
|
sbyte4 |
dataLength, |
|
|
sbyte4 |
encrypt, |
|
|
ubyte * |
iv, |
|
|
sbyte4 |
limit |
|
) |
| |
This function AES-CTR encrypts or decrypts a data buffer. Before calling this function, your application must call the CreateAESCTRCtx() function to dynamically create a valid AES-CTR context. For RFC 3686 usage, the IV should be NULL. If the IV parameter is not NULL, the contents of the IV are copied to counter block context within AES-CTR context. The internal counter block is incremented for each block that is encrypted/decrypted. AES in CTR mode does not require that the submitted data buffer be an even multiple of the AES block size (128 bits). Therefore, no padding is required, which makes this mode compatible with stream data.
FIPS Approved |
|
Suite B Algorithm |
|
Flowchart | AES-CTR |
There are no flag dependencies to enable this function.
aes_ctr.h
- Parameters
-
hwAccelCtx | If a hardware acceleration flag is defined, this macro expands to an additional parameter, "hwAccelDescr
hwAccelCtx". Otherwise, this macro resolves to nothing. |
ctx | AES-CTR context, previously created by CreateAESCTRCtx(). |
data | Data to be encrypted or decrypted. |
dataLength | Number of octets of data to encrypt or decrypt (data ). |
encrypt | TRUE to encrypt the data; FALSE to decrypt the data. |
iv | Usually NULL, optionally used to pass in a new counter block of AES_BLOCK_SIZE. |
limit | Specifies the last byte to increment -> AES_BLOCK_SIZE -> all bytes will be incremented 0 -> no bytes will be incremented |
- Returns
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.
aes_ctr.h
MOC_EXTERN MSTATUS DoAesCtrEx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
ctx, |
|
|
ubyte * |
data, |
|
|
sbyte4 |
dataLength, |
|
|
sbyte4 |
encrypt, |
|
|
ubyte * |
iv |
|
) |
| |
This function AES-CTR encrypts or decrypts a data buffer. Before calling this function, your application must call the CreateAESCTRCtx() function to dynamically create a valid AES-CTR context. IV parameter must not be null, and must be at least 8 octets long. Note only first 8 bytes will be used. Counter will be reset to 1 and offset will be reset to 0 before encrypt/derypt operation. AES in CTR mode does not require that the submitted data buffer be an even multiple of the AES block size (128 bits). Therefore, no padding is required, which makes this mode compatible with stream data.
FIPS Approved |
|
Suite B Algorithm |
|
Flowchart | AES-CTR |
There are no flag dependencies to enable this function.
aes_ctr.h
- Parameters
-
hwAccelCtx | If a hardware acceleration flag is defined, this macro expands to an additional parameter, "hwAccelDescr
hwAccelCtx". Otherwise, this macro resolves to nothing. |
ctx | AES-CTR context, previously created by CreateAesCtrCtx(). |
data | Data to be encrypted or decrypted. |
dataLength | Number of octets of data to encrypt or decrypt (data ). |
encrypt | TRUE to encrypt the data; FALSE to decrypt the data. |
iv | Must be 8 octets, will not override nonce or counter. |
- Returns
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.
aes_ctr.h