kyber768.h File Reference

Kyber-768 KEM. More...

#include "core/crypto.h"

Go to the source code of this file.

Macros

#define KYBER768_PUBLIC_KEY_LEN   1184
 
#define KYBER768_SECRET_KEY_LEN   2400
 
#define KYBER768_CIPHERTEXT_LEN   1088
 
#define KYBER768_SHARED_SECRET_LEN   32
 
#define KYBER768_KEM_ALGO   (&kyber768KemAlgo)
 

Functions

error_t kyber768GenerateKeyPair (const PrngAlgo *prngAlgo, void *prngContext, uint8_t *pk, uint8_t *sk)
 Key pair generation. More...
 
error_t kyber768Encapsulate (const PrngAlgo *prngAlgo, void *prngContext, uint8_t *ct, uint8_t *ss, const uint8_t *pk)
 Encapsulation algorithm. More...
 
error_t kyber768Decapsulate (uint8_t *ss, const uint8_t *ct, const uint8_t *sk)
 Decapsulation algorithm. More...
 

Variables

const KemAlgo kyber768KemAlgo
 

Detailed Description

Kyber-768 KEM.

License

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

Copyright (C) 2010-2024 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
2.4.0

Definition in file kyber768.h.

Macro Definition Documentation

◆ KYBER768_CIPHERTEXT_LEN

#define KYBER768_CIPHERTEXT_LEN   1088

Definition at line 42 of file kyber768.h.

◆ KYBER768_KEM_ALGO

#define KYBER768_KEM_ALGO   (&kyber768KemAlgo)

Definition at line 47 of file kyber768.h.

◆ KYBER768_PUBLIC_KEY_LEN

#define KYBER768_PUBLIC_KEY_LEN   1184

Definition at line 38 of file kyber768.h.

◆ KYBER768_SECRET_KEY_LEN

#define KYBER768_SECRET_KEY_LEN   2400

Definition at line 40 of file kyber768.h.

◆ KYBER768_SHARED_SECRET_LEN

#define KYBER768_SHARED_SECRET_LEN   32

Definition at line 44 of file kyber768.h.

Function Documentation

◆ kyber768Decapsulate()

error_t kyber768Decapsulate ( uint8_t *  ss,
const uint8_t *  ct,
const uint8_t *  sk 
)

Decapsulation algorithm.

Parameters
[out]ssShared secret
[in]ctCiphertext
[in]skSecret key
Returns
Error code

Definition at line 111 of file kyber768.c.

◆ kyber768Encapsulate()

error_t kyber768Encapsulate ( const PrngAlgo prngAlgo,
void *  prngContext,
uint8_t *  ct,
uint8_t *  ss,
const uint8_t *  pk 
)

Encapsulation algorithm.

Parameters
[in]prngAlgoPRNG algorithm
[in]prngContextPointer to the PRNG context
[out]ctCiphertext
[out]ssShared secret
[in]pkPublic key
Returns
Error code

Definition at line 90 of file kyber768.c.

◆ kyber768GenerateKeyPair()

error_t kyber768GenerateKeyPair ( const PrngAlgo prngAlgo,
void *  prngContext,
uint8_t *  pk,
uint8_t *  sk 
)

Key pair generation.

Parameters
[in]prngAlgoPRNG algorithm
[in]prngContextPointer to the PRNG context
[out]pkPublic key
[out]skSecret key
Returns
Error code

Definition at line 67 of file kyber768.c.

Variable Documentation

◆ kyber768KemAlgo

const KemAlgo kyber768KemAlgo
extern

Definition at line 45 of file kyber768.c.