Curve448 elliptic curve (constant-time implementation) More...
#include "core/crypto.h"Go to the source code of this file.
| Macros | |
| #define | CURVE448_SPEED_OPTIMIZATION_LEVEL 2 | 
| #define | CURVE448_BIT_LEN 448 | 
| #define | CURVE448_BYTE_LEN 56 | 
| #define | CURVE448_WORD_LEN 14 | 
| #define | CURVE448_A24 39082 | 
| Functions | |
| void | curve448SetInt (int32_t *a, int32_t b) | 
| Set integer value.  More... | |
| void | curve448Add (int32_t *r, const int32_t *a, const int32_t *b) | 
| Modular addition.  More... | |
| void | curve448AddInt (int32_t *r, const int32_t *a, int32_t b) | 
| Modular addition.  More... | |
| void | curve448Sub (int32_t *r, const int32_t *a, const int32_t *b) | 
| Modular subtraction.  More... | |
| void | curve448SubInt (int32_t *r, const int32_t *a, int32_t b) | 
| Modular subtraction.  More... | |
| void | curve448Mul (int32_t *r, const int32_t *a, const int32_t *b) | 
| Modular multiplication.  More... | |
| void | curve448MulInt (int32_t *r, const int32_t *a, int32_t b) | 
| Modular multiplication.  More... | |
| void | curve448Sqr (int32_t *r, const int32_t *a) | 
| Modular squaring.  More... | |
| void | curve448Pwr2 (int32_t *r, const int32_t *a, uint_t n) | 
| Raise an integer to power 2^n.  More... | |
| void | curve448Inv (int32_t *r, const int32_t *a) | 
| Modular multiplicative inverse.  More... | |
| uint32_t | curve448Sqrt (int32_t *r, const int32_t *a, const int32_t *b) | 
| Compute the square root of (A / B) modulo p.  More... | |
| void | curve448Canonicalize (int32_t *r, const int32_t *a) | 
| Reduce non-canonical value.  More... | |
| void | curve448Copy (int32_t *a, const int32_t *b) | 
| Copy an integer.  More... | |
| void | curve448Swap (int32_t *a, int32_t *b, uint32_t c) | 
| Conditional swap.  More... | |
| void | curve448Select (int32_t *r, const int32_t *a, const int32_t *b, uint32_t c) | 
| Select an integer.  More... | |
| uint32_t | curve448Comp (const int32_t *a, const int32_t *b) | 
| Compare integers.  More... | |
| void | curve448Import (int32_t *a, const uint8_t *data) | 
| Import an octet string.  More... | |
| void | curve448Export (int32_t *a, uint8_t *data) | 
| Export an octet string.  More... | |
Detailed Description
Curve448 elliptic curve (constant-time implementation)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 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.
- Version
- 2.5.4
Definition in file curve448.h.
Macro Definition Documentation
◆ CURVE448_A24
| #define CURVE448_A24 39082 | 
Definition at line 50 of file curve448.h.
◆ CURVE448_BIT_LEN
| #define CURVE448_BIT_LEN 448 | 
Definition at line 45 of file curve448.h.
◆ CURVE448_BYTE_LEN
| #define CURVE448_BYTE_LEN 56 | 
Definition at line 46 of file curve448.h.
◆ CURVE448_SPEED_OPTIMIZATION_LEVEL
| #define CURVE448_SPEED_OPTIMIZATION_LEVEL 2 | 
Definition at line 39 of file curve448.h.
◆ CURVE448_WORD_LEN
| #define CURVE448_WORD_LEN 14 | 
Definition at line 47 of file curve448.h.
Function Documentation
◆ curve448Add()
| void curve448Add | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| const int32_t * | b | ||
| ) | 
Modular addition.
- Parameters
- 
  [out] r Resulting integer R = (A + B) mod p [in] a An integer such as 0 <= A < p [in] b An integer such as 0 <= B < p 
Definition at line 72 of file curve448.c.
◆ curve448AddInt()
| void curve448AddInt | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| int32_t | b | ||
| ) | 
Modular addition.
- Parameters
- 
  [out] r Resulting integer R = (A + B) mod p [in] a An integer such as 0 <= A < p [in] b An integer such as 0 <= B < (2^28 - 1) 
Definition at line 156 of file curve448.c.
◆ curve448Canonicalize()
| void curve448Canonicalize | ( | int32_t * | r, | 
| const int32_t * | a | ||
| ) | 
Reduce non-canonical value.
- Parameters
- 
  [out] r Resulting integer R = A mod p [in] a An integer such as 0 <= A < (2^448 - 1) 
Definition at line 861 of file curve448.c.
◆ curve448Comp()
| uint32_t curve448Comp | ( | const int32_t * | a, | 
| const int32_t * | b | ||
| ) | 
Compare integers.
- Parameters
- 
  [in] a Pointer to the first integer [in] b Pointer to the second integer 
- Returns
- The function returns 0 if the A = B, else 1
Definition at line 984 of file curve448.c.
◆ curve448Copy()
| void curve448Copy | ( | int32_t * | a, | 
| const int32_t * | b | ||
| ) | 
Copy an integer.
- Parameters
- 
  [out] a Pointer to the destination integer [in] b Pointer to the source integer 
Definition at line 912 of file curve448.c.
◆ curve448Export()
| void curve448Export | ( | int32_t * | a, | 
| uint8_t * | data | ||
| ) | 
Export an octet string.
- Parameters
- 
  [in] a Pointer to the integer to be exported [out] data Octet string resulting from the conversion 
Definition at line 1038 of file curve448.c.
◆ curve448Import()
| void curve448Import | ( | int32_t * | a, | 
| const uint8_t * | data | ||
| ) | 
Import an octet string.
- Parameters
- 
  [out] a Pointer to resulting integer [in] data Octet string to be converted 
Definition at line 1010 of file curve448.c.
◆ curve448Inv()
| void curve448Inv | ( | int32_t * | r, | 
| const int32_t * | a | ||
| ) | 
Modular multiplicative inverse.
- Parameters
- 
  [out] r Resulting integer R = A^-1 mod p [in] a An integer such as 0 <= A < p 
Definition at line 731 of file curve448.c.
◆ curve448Mul()
| void curve448Mul | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| const int32_t * | b | ||
| ) | 
Modular multiplication.
- Parameters
- 
  [out] r Resulting integer R = (A * B) mod p [in] a An integer such as 0 <= A < p [in] b An integer such as 0 <= B < p 
Definition at line 444 of file curve448.c.
◆ curve448MulInt()
| void curve448MulInt | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| int32_t | b | ||
| ) | 
Modular multiplication.
- Parameters
- 
  [out] r Resulting integer R = (A * B) mod p [in] a An integer such as 0 <= A < p [in] b An integer such as 0 <= B < (2^28 - 1) 
Definition at line 671 of file curve448.c.
◆ curve448Pwr2()
| void curve448Pwr2 | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| uint_t | n | ||
| ) | 
Raise an integer to power 2^n.
- Parameters
- 
  [out] r Resulting integer R = (A ^ (2^n)) mod p [in] a An integer such as 0 <= A < p [in] n An integer such as n >= 1 
Definition at line 710 of file curve448.c.
◆ curve448Select()
| void curve448Select | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| const int32_t * | b, | ||
| uint32_t | c | ||
| ) | 
Select an integer.
- Parameters
- 
  [out] r Pointer to the destination integer [in] a Pointer to the first source integer [in] b Pointer to the second source integer [in] c Condition variable 
Definition at line 959 of file curve448.c.
◆ curve448SetInt()
| void curve448SetInt | ( | int32_t * | a, | 
| int32_t | b | ||
| ) | 
Set integer value.
- Parameters
- 
  [out] a Pointer to the integer to be initialized [in] b An integer such as 0 <= B < (2^28 - 1) 
Definition at line 50 of file curve448.c.
◆ curve448Sqr()
| void curve448Sqr | ( | int32_t * | r, | 
| const int32_t * | a | ||
| ) | 
Modular squaring.
- Parameters
- 
  [out] r Resulting integer R = (A ^ 2) mod p [in] a An integer such as 0 <= A < p 
Definition at line 696 of file curve448.c.
◆ curve448Sqrt()
| uint32_t curve448Sqrt | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| const int32_t * | b | ||
| ) | 
Compute the square root of (A / B) modulo p.
- Parameters
- 
  [out] r Resulting integer R = (A / B)^(1 / 2) mod p [in] a An integer such as 0 <= A < p [in] b An integer such as 0 < B < p 
- Returns
- The function returns 0 if the square root exists, else 1
Definition at line 780 of file curve448.c.
◆ curve448Sub()
| void curve448Sub | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| const int32_t * | b | ||
| ) | 
Modular subtraction.
- Parameters
- 
  [out] r Resulting integer R = (A - B) mod p [in] a An integer such as 0 <= A < p [in] b An integer such as 0 <= B < p 
Definition at line 182 of file curve448.c.
◆ curve448SubInt()
| void curve448SubInt | ( | int32_t * | r, | 
| const int32_t * | a, | ||
| int32_t | b | ||
| ) | 
Modular subtraction.
- Parameters
- 
  [out] r Resulting integer R = (A - B) mod p [in] a An integer such as 0 <= A < p [in] b An integer such as 0 <= B < (2^28 - 1) 
Definition at line 266 of file curve448.c.
◆ curve448Swap()
| void curve448Swap | ( | int32_t * | a, | 
| int32_t * | b, | ||
| uint32_t | c | ||
| ) | 
Conditional swap.
- Parameters
- 
  [in,out] a Pointer to the first integer [in,out] b Pointer to the second integer [in] c Condition variable 
Definition at line 931 of file curve448.c.
