Contiki-NG
cc2538 AES/SHA cryptoprocessor

Driver for the cc2538 AES/SHA cryptoprocessor. More...

Modules

 cc2538 AES
 Driver for the cc2538 AES modes of the security core.
 
 cc2538 SHA-256
 Driver for the cc2538 SHA-256 mode of the security core.
 

Files

file  crypto.c
 Implementation of the cc2538 AES/SHA cryptoprocessor driver.
 
file  crypto.h
 Header file for the cc2538 AES/SHA cryptoprocessor driver.
 

Functions

void crypto_isr (void)
 The AES/SHA cryptoprocessor ISR. More...
 

Crypto functions

void crypto_init (void)
 Enables and resets the AES/SHA cryptoprocessor.
 
void crypto_enable (void)
 Enables the AES/SHA cryptoprocessor.
 
void crypto_disable (void)
 Disables the AES/SHA cryptoprocessor. More...
 
void crypto_register_process_notification (struct process *p)
 Registers a process to be notified of the completion of a crypto operation. More...
 

Crypto drivers return codes

#define CRYPTO_PENDING   (-1)
 
#define CRYPTO_SUCCESS   0
 
#define CRYPTO_INVALID_PARAM   1
 
#define CRYPTO_NULL_ERROR   2
 
#define CRYPTO_RESOURCE_IN_USE   3
 
#define CRYPTO_DMA_BUS_ERROR   4
 

Crypto macros

#define CRYPTO_IS_ENABLED()   (!!(REG(SYS_CTRL_RCGCSEC) & SYS_CTRL_RCGCSEC_AES))
 Indicates whether the AES/SHA cryptoprocessor is enabled. More...
 

Detailed Description

Driver for the cc2538 AES/SHA cryptoprocessor.

Macro Definition Documentation

◆ CRYPTO_IS_ENABLED

#define CRYPTO_IS_ENABLED ( )    (!!(REG(SYS_CTRL_RCGCSEC) & SYS_CTRL_RCGCSEC_AES))

Indicates whether the AES/SHA cryptoprocessor is enabled.

Returns
Boolean value indicating whether the AES/SHA cryptoprocessor is enabled

Definition at line 69 of file crypto.h.

Function Documentation

◆ crypto_disable()

void crypto_disable ( void  )

Disables the AES/SHA cryptoprocessor.

Note
Call this function to save power when the cryptoprocessor is unused.

Definition at line 101 of file crypto.c.

◆ crypto_isr()

void crypto_isr ( void  )

The AES/SHA cryptoprocessor ISR.

  This is the interrupt service routine for the AES/SHA
  cryptoprocessor.

  This ISR is called at worst from PM0, so lpm_exit() does not need
  to be called.

Definition at line 59 of file crypto.c.

References AES_IRQn.

◆ crypto_register_process_notification()

void crypto_register_process_notification ( struct process *  p)

Registers a process to be notified of the completion of a crypto operation.

Parameters
pProcess to be polled upon IRQ
Note
This function is only supposed to be called by the crypto drivers.

Definition at line 110 of file crypto.c.