Longfellow ZK
0290cb32
Loading...
Searching...
No Matches
lib
ec
p256.h
1
// Copyright 2025 Google LLC.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef PRIVACY_PROOFS_ZK_LIB_EC_P256_H_
16
#define PRIVACY_PROOFS_ZK_LIB_EC_P256_H_
17
18
/*
19
This file declares the one instance of the P256 curve and its related fields.
20
There should be only one instance of this curve in any program due to the
21
typing conventions.
22
23
This curve is also known as secp256r1 and prime256v1.
24
25
It is defined over the base field F_p for
26
p = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff
27
= 115792089210356248762697446949407573530086143415290314195533631308867097853951
28
29
and has an order of
30
0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551
31
115792089210356248762697446949407573529996955224135760342422259061068512044369
32
33
34
*/
35
36
#include "algebra/fp.h"
37
#include "algebra/fp_p256.h"
38
#include "ec/elliptic_curve.h"
39
40
namespace
proofs {
41
42
using
Fp256Base = Fp256<true>;
43
using
Fp256Scalar = Fp<4, true>;
44
using
Fp256Nat = Fp256Base::N;
45
46
// This is the base field of the curve.
47
extern
const
Fp256Base p256_base;
48
49
// Order of the curve.
50
extern
const
Fp256Nat n256_order;
51
52
// This field allows operations mod the order of the curve.
53
extern
const
Fp256Scalar p256_scalar;
54
55
typedef
EllipticCurve<Fp256Base, 4, 256>
P256;
56
57
extern
const
P256 p256;
58
}
// namespace proofs
59
60
#endif
// PRIVACY_PROOFS_ZK_LIB_EC_P256_H_
proofs::EllipticCurve
Definition
elliptic_curve.h:34
Generated by
1.15.0