blake2s128.h File Reference

BLAKE2s-128 hash function. More...

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

Go to the source code of this file.


#define BLAKE2S128_BLOCK_SIZE   64
#define BLAKE2S128_DIGEST_SIZE   16
#define BLAKE2S128_MIN_PAD_SIZE   0
#define BLAKE2S128_OID   blake2s128Oid
#define BLAKE2S128_HASH_ALGO   (&blake2s128HashAlgo)


typedef Blake2sContext Blake2s128Context
 BLAKE2s-128 algorithm context. More...


error_t blake2s128Compute (const void *data, size_t length, uint8_t *digest)
 Digest a message using BLAKE2s-128. More...
void blake2s128Init (Blake2s128Context *context)
 Initialize BLAKE2s-128 hash computation. More...
void blake2s128Update (Blake2s128Context *context, const void *data, size_t length)
 Update BLAKE2s-128 hash computation. More...
void blake2s128Final (Blake2s128Context *context, uint8_t *digest)
 Finish BLAKE2s-128 hash computation. More...


const uint8_t blake2s128Oid [11]
const HashAlgo blake2s128HashAlgo

Detailed Description

BLAKE2s-128 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 blake2s128.h.

Macro Definition Documentation


#define BLAKE2S128_BLOCK_SIZE   64

Definition at line 39 of file blake2s128.h.


#define BLAKE2S128_DIGEST_SIZE   16

Definition at line 41 of file blake2s128.h.


#define BLAKE2S128_HASH_ALGO   (&blake2s128HashAlgo)

Definition at line 47 of file blake2s128.h.


#define BLAKE2S128_MIN_PAD_SIZE   0

Definition at line 43 of file blake2s128.h.


#define BLAKE2S128_OID   blake2s128Oid

Definition at line 45 of file blake2s128.h.

Typedef Documentation

◆ Blake2s128Context

BLAKE2s-128 algorithm context.

Definition at line 59 of file blake2s128.h.

Function Documentation

◆ blake2s128Compute()

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

Digest a message using BLAKE2s-128.

[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 blake2s128.c.

◆ blake2s128Final()

void blake2s128Final ( Blake2s128Context context,
uint8_t *  digest 

Finish BLAKE2s-128 hash computation.

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

Definition at line 110 of file blake2s128.c.

◆ blake2s128Init()

void blake2s128Init ( Blake2s128Context context)

Initialize BLAKE2s-128 hash computation.

[in]contextPointer to the BLAKE2s context to initialize

Definition at line 83 of file blake2s128.c.

◆ blake2s128Update()

void blake2s128Update ( Blake2s128Context context,
const void *  data,
size_t  length 

Update BLAKE2s-128 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 blake2s128.c.

Variable Documentation

◆ blake2s128HashAlgo

const HashAlgo blake2s128HashAlgo

Definition at line 45 of file blake2s128.c.

◆ blake2s128Oid

const uint8_t blake2s128Oid[11]

Definition at line 42 of file blake2s128.c.