Bouffalo SDK  1.0
Bouffalolab Software Development Kit
SEC_SHA
Collaboration diagram for SEC_SHA:

Data Structures

struct  bflb_sha1_ctx_s
 
struct  bflb_sha256_ctx_s
 
struct  bflb_sha512_ctx_s
 
struct  bflb_sha_link_s
 
struct  bflb_sha1_link_ctx_s
 
struct  bflb_sha256_link_ctx_s
 
struct  bflb_sha512_link_ctx_s
 

Macros

#define SHA_MODE_SHA256   0
 
#define SHA_MODE_SHA224   1
 
#define SHA_MODE_SHA1   2
 
#define SHA_MODE_SHA512   4
 
#define SHA_MODE_SHA384   5
 
#define SHA_MODE_SHA512T224   6
 
#define SHA_MODE_SHA512T256   7
 

Functions

void bflb_sha_init (struct bflb_device_s *dev, uint8_t mode)
 
void bflb_sha1_start (struct bflb_device_s *dev, struct bflb_sha1_ctx_s *ctx)
 
void bflb_sha256_start (struct bflb_device_s *dev, struct bflb_sha256_ctx_s *ctx)
 
void bflb_sha512_start (struct bflb_device_s *dev, struct bflb_sha512_ctx_s *ctx)
 
int bflb_sha1_update (struct bflb_device_s *dev, struct bflb_sha1_ctx_s *ctx, const uint8_t *input, uint32_t len)
 
int bflb_sha256_update (struct bflb_device_s *dev, struct bflb_sha256_ctx_s *ctx, const uint8_t *input, uint32_t len)
 
int bflb_sha512_update (struct bflb_device_s *dev, struct bflb_sha512_ctx_s *ctx, const uint8_t *input, uint64_t len)
 
void bflb_sha1_finish (struct bflb_device_s *dev, struct bflb_sha1_ctx_s *ctx, uint8_t *output)
 
void bflb_sha256_finish (struct bflb_device_s *dev, struct bflb_sha256_ctx_s *ctx, uint8_t *output)
 
void bflb_sha512_finish (struct bflb_device_s *dev, struct bflb_sha512_ctx_s *ctx, uint8_t *output)
 
void bflb_sha_link_init (struct bflb_device_s *dev)
 
void bflb_sha_link_deinit (struct bflb_device_s *dev)
 
void bflb_sha1_link_start (struct bflb_device_s *dev, struct bflb_sha1_link_ctx_s *ctx)
 
void bflb_sha256_link_start (struct bflb_device_s *dev, struct bflb_sha256_link_ctx_s *ctx, int is224)
 
void bflb_sha512_link_start (struct bflb_device_s *dev, struct bflb_sha512_link_ctx_s *ctx, int is384)
 
int bflb_sha1_link_update (struct bflb_device_s *dev, struct bflb_sha1_link_ctx_s *ctx, const uint8_t *input, uint32_t len)
 
int bflb_sha256_link_update (struct bflb_device_s *dev, struct bflb_sha256_link_ctx_s *ctx, const uint8_t *input, uint32_t len)
 
int bflb_sha512_link_update (struct bflb_device_s *dev, struct bflb_sha512_link_ctx_s *ctx, const uint8_t *input, uint64_t len)
 
void bflb_sha1_link_finish (struct bflb_device_s *dev, struct bflb_sha1_link_ctx_s *ctx, uint8_t *output)
 
void bflb_sha256_link_finish (struct bflb_device_s *dev, struct bflb_sha256_link_ctx_s *ctx, uint8_t *output)
 
void bflb_sha512_link_finish (struct bflb_device_s *dev, struct bflb_sha512_link_ctx_s *ctx, uint8_t *output)
 
void bflb_group0_request_sha_access (struct bflb_device_s *dev)
 
void bflb_group0_release_sha_access (struct bflb_device_s *dev)
 

Detailed Description

Macro Definition Documentation

◆ SHA_MODE_SHA1

#define SHA_MODE_SHA1   2

Definition at line 16 of file bflb_sec_sha.h.

◆ SHA_MODE_SHA224

#define SHA_MODE_SHA224   1

Definition at line 15 of file bflb_sec_sha.h.

◆ SHA_MODE_SHA256

#define SHA_MODE_SHA256   0

Definition at line 14 of file bflb_sec_sha.h.

◆ SHA_MODE_SHA384

#define SHA_MODE_SHA384   5

Definition at line 18 of file bflb_sec_sha.h.

◆ SHA_MODE_SHA512

#define SHA_MODE_SHA512   4

Definition at line 17 of file bflb_sec_sha.h.

◆ SHA_MODE_SHA512T224

#define SHA_MODE_SHA512T224   6

Definition at line 19 of file bflb_sec_sha.h.

◆ SHA_MODE_SHA512T256

#define SHA_MODE_SHA512T256   7

Definition at line 20 of file bflb_sec_sha.h.

Function Documentation

◆ bflb_group0_release_sha_access()

void bflb_group0_release_sha_access ( struct bflb_device_s dev)
Parameters
[in]dev

◆ bflb_group0_request_sha_access()

void bflb_group0_request_sha_access ( struct bflb_device_s dev)
Parameters
[in]dev

◆ bflb_sha1_finish()

void bflb_sha1_finish ( struct bflb_device_s dev,
struct bflb_sha1_ctx_s ctx,
uint8_t *  output 
)
Parameters
[in]dev
[in]ctx
[in]output

◆ bflb_sha1_link_finish()

void bflb_sha1_link_finish ( struct bflb_device_s dev,
struct bflb_sha1_link_ctx_s ctx,
uint8_t *  output 
)
Parameters
[in]dev
[in]ctx
[in]output

◆ bflb_sha1_link_start()

void bflb_sha1_link_start ( struct bflb_device_s dev,
struct bflb_sha1_link_ctx_s ctx 
)
Parameters
[in]dev
[in]ctx
[in]link

◆ bflb_sha1_link_update()

int bflb_sha1_link_update ( struct bflb_device_s dev,
struct bflb_sha1_link_ctx_s ctx,
const uint8_t *  input,
uint32_t  len 
)
Parameters
[in]dev
[in]ctx
[in]input
[in]len
Returns
int

◆ bflb_sha1_start()

void bflb_sha1_start ( struct bflb_device_s dev,
struct bflb_sha1_ctx_s ctx 
)
Parameters
[in]dev
[in]ctx

◆ bflb_sha1_update()

int bflb_sha1_update ( struct bflb_device_s dev,
struct bflb_sha1_ctx_s ctx,
const uint8_t *  input,
uint32_t  len 
)
Parameters
[in]dev
[in]ctx
[in]input
[in]len
Returns
int

◆ bflb_sha256_finish()

void bflb_sha256_finish ( struct bflb_device_s dev,
struct bflb_sha256_ctx_s ctx,
uint8_t *  output 
)
Parameters
[in]dev
[in]ctx
[in]output

◆ bflb_sha256_link_finish()

void bflb_sha256_link_finish ( struct bflb_device_s dev,
struct bflb_sha256_link_ctx_s ctx,
uint8_t *  output 
)
Parameters
[in]dev
[in]ctx
[in]output

◆ bflb_sha256_link_start()

void bflb_sha256_link_start ( struct bflb_device_s dev,
struct bflb_sha256_link_ctx_s ctx,
int  is224 
)
Parameters
[in]dev
[in]ctx
[in]link

◆ bflb_sha256_link_update()

int bflb_sha256_link_update ( struct bflb_device_s dev,
struct bflb_sha256_link_ctx_s ctx,
const uint8_t *  input,
uint32_t  len 
)
Parameters
[in]dev
[in]ctx
[in]input
[in]len
Returns
int

◆ bflb_sha256_start()

void bflb_sha256_start ( struct bflb_device_s dev,
struct bflb_sha256_ctx_s ctx 
)
Parameters
[in]dev
[in]ctx

◆ bflb_sha256_update()

int bflb_sha256_update ( struct bflb_device_s dev,
struct bflb_sha256_ctx_s ctx,
const uint8_t *  input,
uint32_t  len 
)
Parameters
[in]dev
[in]ctx
[in]input
[in]len
Returns
int

◆ bflb_sha512_finish()

void bflb_sha512_finish ( struct bflb_device_s dev,
struct bflb_sha512_ctx_s ctx,
uint8_t *  output 
)
Parameters
[in]dev
[in]ctx
[in]output

◆ bflb_sha512_link_finish()

void bflb_sha512_link_finish ( struct bflb_device_s dev,
struct bflb_sha512_link_ctx_s ctx,
uint8_t *  output 
)
Parameters
[in]dev
[in]ctx
[in]output

◆ bflb_sha512_link_start()

void bflb_sha512_link_start ( struct bflb_device_s dev,
struct bflb_sha512_link_ctx_s ctx,
int  is384 
)
Parameters
[in]dev
[in]ctx
[in]link

◆ bflb_sha512_link_update()

int bflb_sha512_link_update ( struct bflb_device_s dev,
struct bflb_sha512_link_ctx_s ctx,
const uint8_t *  input,
uint64_t  len 
)
Parameters
[in]dev
[in]ctx
[in]input
[in]len
Returns
int

◆ bflb_sha512_start()

void bflb_sha512_start ( struct bflb_device_s dev,
struct bflb_sha512_ctx_s ctx 
)
Parameters
[in]dev
[in]ctx

◆ bflb_sha512_update()

int bflb_sha512_update ( struct bflb_device_s dev,
struct bflb_sha512_ctx_s ctx,
const uint8_t *  input,
uint64_t  len 
)
Parameters
[in]dev
[in]ctx
[in]input
[in]len
Returns
int

◆ bflb_sha_init()

void bflb_sha_init ( struct bflb_device_s dev,
uint8_t  mode 
)
Parameters
[in]dev
[in]mode

◆ bflb_sha_link_deinit()

void bflb_sha_link_deinit ( struct bflb_device_s dev)
Parameters
[in]dev

◆ bflb_sha_link_init()

void bflb_sha_link_init ( struct bflb_device_s dev)
Parameters
[in]dev