mbedtls ported to mbed-classic

Fork of mbedtls by Christopher Haster

Embed: (wiki syntax)

« Back to documentation index

aesni.h File Reference

aesni.h File Reference

AES-NI for hardware AES acceleration on some Intel processors. More...

Go to the source code of this file.

Functions

int mbedtls_aesni_has_support (unsigned int what)
 AES-NI features detection routine.
int mbedtls_aesni_crypt_ecb (mbedtls_aes_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
 AES-NI AES-ECB block en(de)cryption.
void mbedtls_aesni_gcm_mult (unsigned char c[16], const unsigned char a[16], const unsigned char b[16])
 GCM multiplication: c = a * b in GF(2^128)
void mbedtls_aesni_inverse_key (unsigned char *invkey, const unsigned char *fwdkey, int nr)
 Compute decryption round keys from encryption round keys.
int mbedtls_aesni_setkey_enc (unsigned char *rk, const unsigned char *key, size_t bits)
 Perform key expansion (for encryption)

Detailed Description

AES-NI for hardware AES acceleration on some Intel processors.

Copyright (C) 2006-2015, ARM Limited, All Rights Reserved SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

This file is part of mbed TLS (https://tls.mbed.org)

Definition in file aesni.h.


Function Documentation

int mbedtls_aesni_crypt_ecb ( mbedtls_aes_context ctx,
int  mode,
const unsigned char  input[16],
unsigned char  output[16] 
)

AES-NI AES-ECB block en(de)cryption.

Parameters:
ctxAES context
modeMBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
input16-byte input block
output16-byte output block
Returns:
0 on success (cannot fail)

Definition at line 95 of file aesni.c.

void mbedtls_aesni_gcm_mult ( unsigned char  c[16],
const unsigned char  a[16],
const unsigned char  b[16] 
)

GCM multiplication: c = a * b in GF(2^128)

Parameters:
cResult
aFirst operand
bSecond operand
Note:
Both operands and result are bit strings interpreted as elements of GF(2^128) as per the GCM spec.

Definition at line 141 of file aesni.c.

int mbedtls_aesni_has_support ( unsigned int  what )

AES-NI features detection routine.

Parameters:
whatThe feature to detect (MBEDTLS_AESNI_AES or MBEDTLS_AESNI_CLMUL)
Returns:
1 if CPU has support for the feature, 0 otherwise

Definition at line 48 of file aesni.c.

void mbedtls_aesni_inverse_key ( unsigned char *  invkey,
const unsigned char *  fwdkey,
int  nr 
)

Compute decryption round keys from encryption round keys.

Parameters:
invkeyRound keys for the equivalent inverse cipher
fwdkeyOriginal round keys (for encryption)
nrNumber of rounds (that is, number of round keys minus one)

Definition at line 252 of file aesni.c.

int mbedtls_aesni_setkey_enc ( unsigned char *  rk,
const unsigned char *  key,
size_t  bits 
)

Perform key expansion (for encryption)

Parameters:
rkDestination buffer where the round keys are written
keyEncryption key
bitsKey size in bits (must be 128, 192 or 256)
Returns:
0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH

Definition at line 447 of file aesni.c.