github.com/ethereum/go-ethereum@v1.14.3/tests/fuzzers/bls12381/bls12381_test.go (about)

     1  // Copyright 2023 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  //go:build cgo
    18  // +build cgo
    19  
    20  package bls
    21  
    22  import "testing"
    23  
    24  func FuzzCrossPairing(f *testing.F) {
    25  	f.Fuzz(func(t *testing.T, data []byte) {
    26  		fuzzCrossPairing(data)
    27  	})
    28  }
    29  
    30  func FuzzCrossG1Add(f *testing.F) {
    31  	f.Fuzz(func(t *testing.T, data []byte) {
    32  		fuzzCrossG1Add(data)
    33  	})
    34  }
    35  
    36  func FuzzCrossG2Add(f *testing.F) {
    37  	f.Fuzz(func(t *testing.T, data []byte) {
    38  		fuzzCrossG2Add(data)
    39  	})
    40  }
    41  
    42  func FuzzCrossG1MultiExp(f *testing.F) {
    43  	f.Fuzz(func(t *testing.T, data []byte) {
    44  		fuzzCrossG1MultiExp(data)
    45  	})
    46  }
    47  
    48  func FuzzG1Add(f *testing.F) {
    49  	f.Fuzz(func(t *testing.T, data []byte) {
    50  		fuzz(blsG1Add, data)
    51  	})
    52  }
    53  
    54  func FuzzG1Mul(f *testing.F) {
    55  	f.Fuzz(func(t *testing.T, data []byte) {
    56  		fuzz(blsG1Mul, data)
    57  	})
    58  }
    59  
    60  func FuzzG1MultiExp(f *testing.F) {
    61  	f.Fuzz(func(t *testing.T, data []byte) {
    62  		fuzz(blsG1MultiExp, data)
    63  	})
    64  }
    65  
    66  func FuzzG2Add(f *testing.F) {
    67  	f.Fuzz(func(t *testing.T, data []byte) {
    68  		fuzz(blsG2Add, data)
    69  	})
    70  }
    71  
    72  func FuzzG2Mul(f *testing.F) {
    73  	f.Fuzz(func(t *testing.T, data []byte) {
    74  		fuzz(blsG2Mul, data)
    75  	})
    76  }
    77  
    78  func FuzzG2MultiExp(f *testing.F) {
    79  	f.Fuzz(func(t *testing.T, data []byte) {
    80  		fuzz(blsG2MultiExp, data)
    81  	})
    82  }
    83  
    84  func FuzzPairing(f *testing.F) {
    85  	f.Fuzz(func(t *testing.T, data []byte) {
    86  		fuzz(blsPairing, data)
    87  	})
    88  }
    89  
    90  func FuzzMapG1(f *testing.F) {
    91  	f.Fuzz(func(t *testing.T, data []byte) {
    92  		fuzz(blsMapG1, data)
    93  	})
    94  }
    95  
    96  func FuzzMapG2(f *testing.F) {
    97  	f.Fuzz(func(t *testing.T, data []byte) {
    98  		fuzz(blsMapG2, data)
    99  	})
   100  }
   101  
   102  func FuzzG1SubgroupChecks(f *testing.F) {
   103  	f.Fuzz(func(t *testing.T, data []byte) {
   104  		fuzzG1SubgroupChecks(data)
   105  	})
   106  }
   107  
   108  func FuzzG2SubgroupChecks(f *testing.F) {
   109  	f.Fuzz(func(t *testing.T, data []byte) {
   110  		fuzzG2SubgroupChecks(data)
   111  	})
   112  }