pub fn append_with_keypair(
        &self,
        keypair: &KeyPair,
        block_builder: BlockBuilder,
    ) -> Result<Self, error::Token> {
        let block = block_builder.build(self.symbols.clone());

        let h1 = self.symbols.symbols.iter().collect::<HashSet<_>>();
        let h2 = block.symbols.symbols.iter().collect::<HashSet<_>>();

        if !h1.is_disjoint(&h2) {
            return Err(error::Token::SymbolTableOverlap);
        }

        let authority = self.authority.clone();
        let mut blocks = self.blocks.clone();
        let mut symbols = self.symbols.clone();

        let container = self.container.append(keypair, &block)?;

        symbols
            .symbols
            .extend(block.symbols.symbols.iter().cloned());
        blocks.push(block);

        Ok(UnverifiedBiscuit {
            authority,
            blocks,
            symbols,
            container,
        })
    }
/// adds a new block to the token, using the provided CSPRNG
///
/// since the public key is integrated into the token, the keypair can be
/// discarded right after calling this function
adds a new block to the token, using the provided CSPRNG
since the public key is integrated into the token, the keypair can be
discarded right after calling this function
adds a new block to the token using the provided CSPRNG since the public key is integrated into the token the keypair can be discarded right after calling this function
pub fn append_with_keypair(
        &self,
        keypair: &KeyPair,
        block_builder: BlockBuilder,
    ) -> Result<Self, error::Token> {
        let block = block_builder.build(self.symbols.clone());
        let h1 = self.symbols.symbols.iter().collect::<HashSet<_>>();
        let h2 = block.symbols.symbols.iter().collect::<HashSet<_>>();
        if !h1.is_disjoint(&h2) {
            return Err(error::Token::SymbolTableOverlap);
        }
        let authority = self.authority.clone();
        let mut blocks = self.blocks.clone();
        let mut symbols = self.symbols.clone();
        let container = self.container.append(keypair, &block)?;
        symbols
            .symbols
            .extend(block.symbols.symbols.iter().cloned());
        blocks.push(block);
        Ok(UnverifiedBiscuit {
            authority,
            blocks,
            symbols,
            container,
        })
    }
pub fn append_with_keypair ( & self , keypair : & KeyPair , block_builder : BlockBuilder , ) -> Result < Self , error :: Token > { let block = block_builder . build ( self . symbols . clone ( ) ) ; let h1 = self . symbols . symbols . iter ( ) . collect :: < HashSet < _ > > ( ) ; let h2 = block . symbols . symbols . iter ( ) . collect :: < HashSet < _ > > ( ) ; if ! h1 . is_disjoint ( & h2 ) { return Err ( error :: Token :: SymbolTableOverlap ) ; } let authority = self . authority . clone ( ) ; let mut blocks = self . blocks . clone ( ) ; let mut symbols = self . symbols . clone ( ) ; let container = self . container . append ( keypair , & block ) ? ; symbols . symbols . extend ( block . symbols . symbols . iter ( ) . cloned ( ) ) ; blocks . push ( block ) ; Ok ( UnverifiedBiscuit { authority , blocks , symbols , container , } ) }
adds a new block to the token, using the provided CSPRNG
since the public key is integrated into the token, the keypair can be
discarded right after calling this function
adds a new block to the token using the provided CSPRNG since the public key is integrated into the token the keypair can be discarded right after calling this function
&self
keypair
&KeyPair
block_builder
BlockBuilder
&self
keypair
&KeyPair
block_builder
BlockBuilder