blake2s256.h File Reference

BLAKE2s-256 hash function. More...

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

Go to the source code of this file.

Macros

#define BLAKE2S256_BLOCK_SIZE   64
 
#define BLAKE2S256_DIGEST_SIZE   32
 
#define BLAKE2S256_OID   blake2s256Oid
 
#define BLAKE2S256_HASH_ALGO   (&blake2s256HashAlgo)
 

Typedefs

typedef Blake2sContext Blake2s256Context
 BLAKE2s-256 algorithm context. More...
 

Functions

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...
 

Variables

const uint8_t blake2s256Oid [11]
 
const HashAlgo blake2s256HashAlgo
 

Detailed Description

BLAKE2s-256 hash function.

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 blake2s256.h.

Macro Definition Documentation

◆ BLAKE2S256_BLOCK_SIZE

#define BLAKE2S256_BLOCK_SIZE   64

Definition at line 37 of file blake2s256.h.

◆ BLAKE2S256_DIGEST_SIZE

#define BLAKE2S256_DIGEST_SIZE   32

Definition at line 39 of file blake2s256.h.

◆ BLAKE2S256_HASH_ALGO

#define BLAKE2S256_HASH_ALGO   (&blake2s256HashAlgo)

Definition at line 43 of file blake2s256.h.

◆ BLAKE2S256_OID

#define BLAKE2S256_OID   blake2s256Oid

Definition at line 41 of file blake2s256.h.

Typedef Documentation

◆ Blake2s256Context

BLAKE2s-256 algorithm context.

Definition at line 55 of file blake2s256.h.

Function Documentation

◆ blake2s256Compute()

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

Digest a message using BLAKE2s-256.

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

Definition at line 66 of file blake2s256.c.

◆ blake2s256Final()

void blake2s256Final ( Blake2s256Context context,
uint8_t *  digest 
)

Finish BLAKE2s-256 hash computation.

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

Definition at line 105 of file blake2s256.c.

◆ blake2s256Init()

void blake2s256Init ( Blake2s256Context context)

Initialize BLAKE2s-256 hash computation.

Parameters
[in]contextPointer to the BLAKE2s context to initialize

Definition at line 78 of file blake2s256.c.

◆ blake2s256Update()

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

Update BLAKE2s-256 hash computation.

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

Definition at line 92 of file blake2s256.c.

Variable Documentation

◆ blake2s256HashAlgo

const HashAlgo blake2s256HashAlgo

Definition at line 43 of file blake2s256.c.

◆ blake2s256Oid

const uint8_t blake2s256Oid[11]

Definition at line 40 of file blake2s256.c.