CryptoAuthLib
Atmel CryptoAuthentication Library
sha1_routines.h File Reference

Software implementation of the SHA1 algorithm. More...

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  CL_HashContext
 

Macros

#define U8   uint8_t
 
#define U16   uint16_t
 
#define U32   uint32_t
 
#define memcpy_P   memmove
 
#define strcpy_P   strcpy
 
#define _WDRESET()
 
#define _NOP()
 
#define leftRotate(x, n)   (x) = (((x) << (n)) | ((x) >> (32 - (n))))
 

Functions

void shaEngine (U32 *buf, U32 *h)
 
void CL_hashInit (CL_HashContext *ctx)
 
void CL_hashUpdate (CL_HashContext *ctx, const U8 *src, int nbytes)
 
void CL_hashFinal (CL_HashContext *ctx, U8 *dest)
 
void CL_hash (U8 *msg, int msgBytes, U8 *dest)
 

Detailed Description

Software implementation of the SHA1 algorithm.

Copyright (c) 2015 Atmel Corporation. All rights reserved.

Macro Definition Documentation

#define _NOP ( )
#define _WDRESET ( )
#define leftRotate (   x,
 
)    (x) = (((x) << (n)) | ((x) >> (32 - (n))))
#define memcpy_P   memmove
#define strcpy_P   strcpy
#define U16   uint16_t
#define U32   uint32_t
#define U8   uint8_t

Function Documentation

void CL_hash ( U8 msg,
int  msgBytes,
U8 dest 
)
void CL_hashFinal ( CL_HashContext ctx,
U8 dest 
)
void CL_hashInit ( CL_HashContext ctx)
void CL_hashUpdate ( CL_HashContext ctx,
const U8 src,
int  nbytes 
)
void shaEngine ( U32 buf,
U32 h 
)