blake2s256.c File Reference

BLAKE2s-256 hash function. More...

#include "core/crypto.h"
#include "hash/blake2s256.h"

Go to the source code of this file.




error_t blake2s256Compute (const void *data, size_t length, uint8_t *digest)
 Digest a message using BLAKE2s-256. More...
void blake2s256Init (Blake2s256Context *context)
 Initialize BLAKE2s-256 hash computation. More...
void blake2s256Update (Blake2s256Context *context, const void *data, size_t length)
 Update BLAKE2s-256 hash computation. More...
void blake2s256Final (Blake2s256Context *context, uint8_t *digest)
 Finish BLAKE2s-256 hash computation. More...


const uint8_t blake2s256Oid [11] = {0x43, 0x06, 0x01, 0x04, 0x01, 0x8D, 0x3A, 0x0C, 0x02, 0x02, 0x08}
const HashAlgo blake2s256HashAlgo

Detailed Description

BLAKE2s-256 hash function.


SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2020 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.

Oryx Embedded SARL (

Definition in file blake2s256.c.

Macro Definition Documentation



Definition at line 32 of file blake2s256.c.

Function Documentation

◆ blake2s256Compute()

error_t blake2s256Compute ( const void *  data,
size_t  length,
uint8_t *  digest 

Digest a message using BLAKE2s-256.

[in]dataPointer to the message being hashed
[in]lengthLength of the message
[out]digestPointer to the calculated digest
Error code

Definition at line 71 of file blake2s256.c.

◆ blake2s256Final()

void blake2s256Final ( Blake2s256Context context,
uint8_t *  digest 

Finish BLAKE2s-256 hash computation.

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

Definition at line 110 of file blake2s256.c.

◆ blake2s256Init()

void blake2s256Init ( Blake2s256Context context)

Initialize BLAKE2s-256 hash computation.

[in]contextPointer to the BLAKE2s context to initialize

Definition at line 83 of file blake2s256.c.

◆ blake2s256Update()

void blake2s256Update ( Blake2s256Context context,
const void *  data,
size_t  length 

Update BLAKE2s-256 hash computation.

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

Definition at line 97 of file blake2s256.c.

Variable Documentation

◆ blake2s256HashAlgo

◆ blake2s256Oid

const uint8_t blake2s256Oid[11] = {0x43, 0x06, 0x01, 0x04, 0x01, 0x8D, 0x3A, 0x0C, 0x02, 0x02, 0x08}

Definition at line 42 of file blake2s256.c.

void(* HashAlgoInit)(void *context)
Definition: crypto.h:1028
void(* HashAlgoUpdate)(void *context, const void *data, size_t length)
Definition: crypto.h:1029
error_t blake2s256Compute(const void *data, size_t length, uint8_t *digest)
Digest a message using BLAKE2s-256.
Definition: blake2s256.c:71
#define FALSE
Definition: os_port.h:46
void blake2s256Final(Blake2s256Context *context, uint8_t *digest)
Finish BLAKE2s-256 hash computation.
Definition: blake2s256.c:110
Definition: blake2s256.h:43
Definition: blake2s256.h:41
BLAKE2s algorithm context.
Definition: blake2s.h:50
void(* HashAlgoFinal)(void *context, uint8_t *digest)
Definition: crypto.h:1030
const uint8_t blake2s256Oid[11]
Definition: blake2s256.c:42
void blake2s256Update(Blake2s256Context *context, const void *data, size_t length)
Update BLAKE2s-256 hash computation.
Definition: blake2s256.c:97
error_t(* HashAlgoCompute)(const void *data, size_t length, uint8_t *digest)
Definition: crypto.h:1027
void blake2s256Init(Blake2s256Context *context)
Initialize BLAKE2s-256 hash computation.
Definition: blake2s256.c:83
Definition: blake2s256.h:39