@@ -391,163 +391,6 @@ pub trait Scheme: Clone + Debug + Send + Sync + 'static {
391391 fn certificate_codec_config_unbounded ( ) -> <Self :: Certificate as Read >:: Cfg ;
392392}
393393
394- impl < S : Scheme > Scheme for Arc < S > {
395- type Subject < ' a , D : Digest > = S :: Subject < ' a , D > ;
396- type PublicKey = S :: PublicKey ;
397- type Signature = S :: Signature ;
398- type Certificate = S :: Certificate ;
399-
400- fn me ( & self ) -> Option < Participant > {
401- self . as_ref ( ) . me ( )
402- }
403-
404- fn participants ( & self ) -> & Set < Self :: PublicKey > {
405- self . as_ref ( ) . participants ( )
406- }
407-
408- fn sign < D : Digest > ( & self , subject : Self :: Subject < ' _ , D > ) -> Option < Attestation < Self > > {
409- self . as_ref ( ) . sign ( subject) . map ( |attestation| Attestation {
410- signer : attestation. signer ,
411- signature : attestation. signature ,
412- } )
413- }
414-
415- fn verify_attestation < R , D > (
416- & self ,
417- rng : & mut R ,
418- subject : Self :: Subject < ' _ , D > ,
419- attestation : & Attestation < Self > ,
420- strategy : & impl Strategy ,
421- ) -> bool
422- where
423- R : CryptoRngCore ,
424- D : Digest ,
425- {
426- let attestation = Attestation :: < S > {
427- signer : attestation. signer ,
428- signature : attestation. signature . clone ( ) ,
429- } ;
430- self . as_ref ( )
431- . verify_attestation ( rng, subject, & attestation, strategy)
432- }
433-
434- fn verify_attestations < R , D , I > (
435- & self ,
436- rng : & mut R ,
437- subject : Self :: Subject < ' _ , D > ,
438- attestations : I ,
439- strategy : & impl Strategy ,
440- ) -> Verification < Self >
441- where
442- R : CryptoRngCore ,
443- D : Digest ,
444- I : IntoIterator < Item = Attestation < Self > > ,
445- I :: IntoIter : Send ,
446- {
447- let Verification { verified, invalid } = self . as_ref ( ) . verify_attestations :: < R , D , _ > (
448- rng,
449- subject,
450- attestations
451- . into_iter ( )
452- . map ( |attestation| Attestation :: < S > {
453- signer : attestation. signer ,
454- signature : attestation. signature ,
455- } ) ,
456- strategy,
457- ) ;
458- let verified = verified
459- . into_iter ( )
460- . map ( |attestation| Attestation :: < Self > {
461- signer : attestation. signer ,
462- signature : attestation. signature ,
463- } )
464- . collect ( ) ;
465- Verification :: new ( verified, invalid)
466- }
467-
468- fn assemble < I , M > ( & self , attestations : I , strategy : & impl Strategy ) -> Option < Self :: Certificate >
469- where
470- I : IntoIterator < Item = Attestation < Self > > ,
471- I :: IntoIter : Send ,
472- M : Faults ,
473- {
474- self . as_ref ( ) . assemble :: < _ , M > (
475- attestations
476- . into_iter ( )
477- . map ( |attestation| Attestation :: < S > {
478- signer : attestation. signer ,
479- signature : attestation. signature ,
480- } ) ,
481- strategy,
482- )
483- }
484-
485- fn verify_certificate < R , D , M > (
486- & self ,
487- rng : & mut R ,
488- subject : Self :: Subject < ' _ , D > ,
489- certificate : & Self :: Certificate ,
490- strategy : & impl Strategy ,
491- ) -> bool
492- where
493- R : CryptoRngCore ,
494- D : Digest ,
495- M : Faults ,
496- {
497- self . as_ref ( )
498- . verify_certificate :: < _ , _ , M > ( rng, subject, certificate, strategy)
499- }
500-
501- fn verify_certificates < ' a , R , D , I , M > (
502- & self ,
503- rng : & mut R ,
504- certificates : I ,
505- strategy : & impl Strategy ,
506- ) -> bool
507- where
508- R : CryptoRngCore ,
509- D : Digest ,
510- I : Iterator < Item = ( Self :: Subject < ' a , D > , & ' a Self :: Certificate ) > ,
511- M : Faults ,
512- {
513- self . as_ref ( )
514- . verify_certificates :: < R , D , I , M > ( rng, certificates, strategy)
515- }
516-
517- fn verify_certificates_bisect < ' a , R , D , M > (
518- & self ,
519- rng : & mut R ,
520- certificates : & [ ( Self :: Subject < ' a , D > , & ' a Self :: Certificate ) ] ,
521- strategy : & impl Strategy ,
522- ) -> Vec < bool >
523- where
524- R : CryptoRngCore ,
525- D : Digest ,
526- Self :: Subject < ' a , D > : Copy ,
527- Self :: Certificate : ' a ,
528- M : Faults ,
529- {
530- self . as_ref ( )
531- . verify_certificates_bisect :: < R , D , M > ( rng, certificates, strategy)
532- }
533-
534- fn is_attributable ( ) -> bool {
535- S :: is_attributable ( )
536- }
537-
538- fn is_batchable ( ) -> bool {
539- S :: is_batchable ( )
540- }
541-
542- fn certificate_codec_config ( & self ) -> <Self :: Certificate as Read >:: Cfg {
543- self . as_ref ( ) . certificate_codec_config ( )
544- }
545-
546- fn certificate_codec_config_unbounded ( ) -> <Self :: Certificate as Read >:: Cfg {
547- S :: certificate_codec_config_unbounded ( )
548- }
549- }
550-
551394/// Supplies the signing scheme for a given scope.
552395///
553396/// This trait uses an associated `Scope` type, allowing implementations to work
0 commit comments