Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::field_conversion_tests Namespace Reference

Classes

class  FieldConversionTest
 

Functions

 TEST_F (FieldConversionTest, FieldConversionUint32)
 Field conversion test for uint32_t.
 
 TEST_F (FieldConversionTest, FieldConversionFr)
 Field conversion test for bb::fr.
 
 TEST_F (FieldConversionTest, FieldConversionGrumpkinFr)
 Field conversion test for grumpkin::fr.
 
 TEST_F (FieldConversionTest, FieldConversionBN254AffineElement)
 Field conversion test for curve::BN254::AffineElement.
 
 TEST_F (FieldConversionTest, FieldConversionGrumpkinAffineElement)
 Field conversion test for curve::Grumpkin::AffineElement.
 
 TEST_F (FieldConversionTest, FieldConversionArrayBn254Fr)
 Field conversion test for std::array<bb::fr, N>
 
 TEST_F (FieldConversionTest, FieldConversionArrayGrumpkinFr)
 Field conversion test for std::array<grumpkin::fr, N>
 
 TEST_F (FieldConversionTest, FieldConversionUnivariateBn254Fr)
 Field conversion test for bb::Univariate<bb::fr, N>
 
 TEST_F (FieldConversionTest, FieldConversionUnivariateGrumpkinFr)
 Field conversion test for bb::Univariate<grumpkin::fr, N>
 
 TEST_F (FieldConversionTest, ConvertChallengeGrumpkinFr)
 Convert challenge test for grumpkin::fr.
 
 TEST_F (FieldConversionTest, AcceptCanonicalPointAtInfinity)
 Test that valid canonical (0, 0) is accepted as point at infinity.
 
 TEST_F (FieldConversionTest, RejectNonCanonicalFieldElements)
 Test that non-canonical field elements are rejected at deserialization boundaries.
 
 TEST_F (FieldConversionTest, RejectPointNotOnCurve)
 Test that points not on the curve are rejected.
 

Function Documentation

◆ TEST_F() [1/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
AcceptCanonicalPointAtInfinity   
)

Test that valid canonical (0, 0) is accepted as point at infinity.

This ensures we're only rejecting non-canonical aliases, not the proper encoding.

Definition at line 177 of file field_conversion.test.cpp.

◆ TEST_F() [2/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
ConvertChallengeGrumpkinFr   
)

Convert challenge test for grumpkin::fr.

Definition at line 158 of file field_conversion.test.cpp.

◆ TEST_F() [3/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionArrayBn254Fr   
)

Field conversion test for std::array<bb::fr, N>

Definition at line 98 of file field_conversion.test.cpp.

◆ TEST_F() [4/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionArrayGrumpkinFr   
)

Field conversion test for std::array<grumpkin::fr, N>

Definition at line 117 of file field_conversion.test.cpp.

◆ TEST_F() [5/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionBN254AffineElement   
)

Field conversion test for curve::BN254::AffineElement.

Definition at line 64 of file field_conversion.test.cpp.

◆ TEST_F() [6/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionFr   
)

Field conversion test for bb::fr.

Definition at line 32 of file field_conversion.test.cpp.

◆ TEST_F() [7/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionGrumpkinAffineElement   
)

Field conversion test for curve::Grumpkin::AffineElement.

Definition at line 85 of file field_conversion.test.cpp.

◆ TEST_F() [8/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionGrumpkinFr   
)

Field conversion test for grumpkin::fr.

Definition at line 45 of file field_conversion.test.cpp.

◆ TEST_F() [9/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionUint32   
)

Field conversion test for uint32_t.

Definition at line 23 of file field_conversion.test.cpp.

◆ TEST_F() [10/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionUnivariateBn254Fr   
)

Field conversion test for bb::Univariate<bb::fr, N>

Definition at line 136 of file field_conversion.test.cpp.

◆ TEST_F() [11/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
FieldConversionUnivariateGrumpkinFr   
)

Field conversion test for bb::Univariate<grumpkin::fr, N>

Definition at line 147 of file field_conversion.test.cpp.

◆ TEST_F() [12/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
RejectNonCanonicalFieldElements   
)

Test that non-canonical field elements are rejected at deserialization boundaries.

Security-critical: prevents attackers from using aliased encodings (e.g., modulus instead of 0).

Note
Skipped in WASM builds because death tests aren't supported.

Definition at line 200 of file field_conversion.test.cpp.

◆ TEST_F() [13/13]

bb::field_conversion_tests::TEST_F ( FieldConversionTest  ,
RejectPointNotOnCurve   
)

Test that points not on the curve are rejected.

Note
Skipped in WASM builds because death tests (EXPECT_DEATH) aren't supported.

Definition at line 258 of file field_conversion.test.cpp.