@@ -20,14 +20,14 @@ const MAX_ITERATIONS = 100;
2020export function sign ( message : Uint8Array , secretKey : Uint8Array ) {
2121 for ( let i = 0 ; i < MAX_ITERATIONS ; i ++ ) {
2222 const signature = genSignature ( message , secretKey ) ;
23+ /* v8 ignore else -- @preserve */
2324 if ( signature ) return signature ;
24- /* v8 ignore start */
2525 }
2626
2727 // This branch is ignored in the coverage report because it depends on randomness.
28+ /* v8 ignore next -- @preserve */
2829 throw new FleetError ( "Failed to generate signature" ) ;
2930}
30- /* v8 ignore stop */
3131
3232/**
3333 * Generates a Schnorr signature for the given message using the provided secret key.
@@ -45,14 +45,14 @@ export function genSignature(message: Uint8Array, secretKey: Uint8Array): undefi
4545 const c = fiatShamirHash ( genCommitment ( pk , w , message ) ) ;
4646
4747 // The next line is ignored in the coverage report because it depends on randomness.
48- /* v8 ignore next */
48+ /* v8 ignore next -- @preserve */
4949 if ( c === 0n ) throw new FleetError ( "Failed to generate challenge" ) ;
5050
5151 const z = umod ( sk * c + k , CURVE . n ) ;
5252 const signature = concatBytes ( bigintBE . decode ( c ) , bigintBE . decode ( z ) ) ;
5353
5454 // The next line is ignored in the coverage report because it depends on randomness.
55- /* v8 ignore next */
55+ /* v8 ignore next -- @preserve */
5656 if ( ! verify ( message , signature , pk ) ) return ;
5757
5858 return signature ;
@@ -74,7 +74,7 @@ function genRandomSecret() {
7474 }
7575
7676 // The next line is ignored in the coverage report because it depends on randomness.
77- /* v8 ignore next */
77+ /* v8 ignore next -- @preserve */
7878 if ( r === 0n ) throw new FleetError ( "Failed to generate randomness" ) ;
7979
8080 return r ;
0 commit comments