blake2s.h File Reference

BLAKE2 cryptographic hash and MAC (BLAKE2s variant) More...

#include "core/crypto.h"

Go to the source code of this file.

Data Structures

struct  Blake2sContext
 BLAKE2s algorithm context. More...
 

Macros

#define BLAKE2S_BLOCK_SIZE   64
 

Functions

error_t blake2sCompute (const void *key, size_t keyLen, const void *data, size_t dataLen, uint8_t *digest, size_t digestLen)
 Digest a message using BLAKE2s. More...
 
error_t blake2sInit (Blake2sContext *context, const void *key, size_t keyLen, size_t digestLen)
 Initialize BLAKE2s message digest context. More...
 
void blake2sUpdate (Blake2sContext *context, const void *data, size_t length)
 Update the BLAKE2s context with a portion of the message being hashed. More...
 
void blake2sFinal (Blake2sContext *context, uint8_t *digest)
 Finish the BLAKE2s message digest. More...
 
void blake2sProcessBlock (Blake2sContext *context, bool_t last)
 Compression function F. More...
 

Detailed Description

BLAKE2 cryptographic hash and MAC (BLAKE2s variant)

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneCrypto Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file blake2s.h.

Macro Definition Documentation

◆ BLAKE2S_BLOCK_SIZE

#define BLAKE2S_BLOCK_SIZE   64

Definition at line 36 of file blake2s.h.

Function Documentation

◆ blake2sCompute()

error_t blake2sCompute ( const void *  key,
size_t  keyLen,
const void *  data,
size_t  dataLen,
uint8_t *  digest,
size_t  digestLen 
)

Digest a message using BLAKE2s.

Parameters
[in]keyPointer to the key
[in]keyLenLength of the key
[in]dataPointer to the message being hashed
[in]dataLenLength of the message
[out]digestPointer to the calculated digest
[in]digestLenExpected length of the digest
Returns
Error code

Definition at line 96 of file blake2s.c.

◆ blake2sFinal()

void blake2sFinal ( Blake2sContext context,
uint8_t *  digest 
)

Finish the BLAKE2s message digest.

Parameters
[in]contextPointer to the BLAKE2s context
[out]digestCalculated digest (optional parameter)

Definition at line 241 of file blake2s.c.

◆ blake2sInit()

error_t blake2sInit ( Blake2sContext context,
const void *  key,
size_t  keyLen,
size_t  digestLen 
)

Initialize BLAKE2s message digest context.

Parameters
[in]contextPointer to the BLAKE2s context to initialize
[in]keyPointer to the key
[in]keyLenLength of the key
[in]digestLenExpected length of the digest
Returns
Error code

Definition at line 143 of file blake2s.c.

◆ blake2sProcessBlock()

void blake2sProcessBlock ( Blake2sContext context,
bool_t  last 
)

Compression function F.

Parameters
[in]contextPointer to the BLAKE2s context
[in]lastFlag indicating the last block

Definition at line 274 of file blake2s.c.

◆ blake2sUpdate()

void blake2sUpdate ( Blake2sContext context,
const void *  data,
size_t  length 
)

Update the BLAKE2s context with a portion of the message being hashed.

Parameters
[in]contextPointer to the BLAKE2s context
[in]dataPointer to the buffer being hashed
[in]lengthLength of the buffer

Definition at line 203 of file blake2s.c.