22
33import biscuit .format .schema .Schema ;
44import io .vavr .Tuple2 ;
5- import org .biscuitsec .biscuit .crypto .BlockBuffer ;
5+ import org .biscuitsec .biscuit .crypto .BlockSignatureBuffer ;
66import org .biscuitsec .biscuit .crypto .KeyDelegate ;
77import org .biscuitsec .biscuit .crypto .KeyPair ;
88import org .biscuitsec .biscuit .crypto .PublicKey ;
@@ -239,7 +239,7 @@ static public Either<Error.FormatError, SerializedBiscuit> make(final org.biscui
239239 b .writeTo (stream );
240240 byte [] block = stream .toByteArray ();
241241 org .biscuitsec .biscuit .crypto .PublicKey next_key = next .public_key ();
242- byte [] payload = BlockBuffer .getBufferSignature (next_key , block );
242+ byte [] payload = BlockSignatureBuffer .getBufferSignature (next_key , block );
243243 byte [] signature = rootSigner .sign (payload );
244244 SignedBlock signedBlock = new SignedBlock (block , next_key , signature , Option .none ());
245245 Proof proof = new Proof (next );
@@ -265,7 +265,7 @@ public Either<Error.FormatError, SerializedBiscuit> append(final org.biscuitsec.
265265 KeyPair secretKey = this .proof .secretKey .get ();
266266 org .biscuitsec .biscuit .crypto .PublicKey next_key = next .public_key ();
267267
268- byte [] payload = BlockBuffer .getBufferSignature (next_key , block , externalSignature .toJavaOptional ());
268+ byte [] payload = BlockSignatureBuffer .getBufferSignature (next_key , block , externalSignature .toJavaOptional ());
269269 byte [] signature = this .proof .secretKey .get ().sign (payload );
270270
271271 SignedBlock signedBlock = new SignedBlock (block , next_key , signature , externalSignature );
@@ -335,7 +335,7 @@ public Either<Error, Void> verify(org.biscuitsec.biscuit.crypto.PublicKey root)
335335 org .biscuitsec .biscuit .crypto .PublicKey next_key = b .key ;
336336 byte [] signature = b .signature ;
337337
338- byte [] payload = BlockBuffer .getBufferSealedSignature (next_key , block , signature );
338+ byte [] payload = BlockSignatureBuffer .getBufferSealedSignature (next_key , block , signature );
339339
340340 if (KeyPair .verify (current_key , payload , finalSignature )) {
341341 return Right (null );
@@ -370,13 +370,13 @@ static Either<Error, org.biscuitsec.biscuit.crypto.PublicKey> verifyBlockSignatu
370370 }
371371 sgr .update (algo_buf );
372372 sgr .update (next_key .toBytes ());
373- byte [] payload = BlockBuffer .getBufferSignature (next_key , block , signedBlock .externalSignature .toJavaOptional ());
373+ byte [] payload = BlockSignatureBuffer .getBufferSignature (next_key , block , signedBlock .externalSignature .toJavaOptional ());
374374 if (!KeyPair .verify (publicKey , payload , signature )) {
375375 return Left (new Error .FormatError .Signature .InvalidSignature ("signature error: Verification equation was not satisfied" ));
376376 }
377377
378378 if (signedBlock .externalSignature .isDefined ()) {
379- byte [] externalPayload = BlockBuffer .getBufferSignature (publicKey , block );
379+ byte [] externalPayload = BlockSignatureBuffer .getBufferSignature (publicKey , block );
380380 ExternalSignature externalSignature = signedBlock .externalSignature .get ();
381381
382382 if (!KeyPair .verify (externalSignature .key , externalPayload , externalSignature .signature )) {
@@ -448,7 +448,7 @@ public Either<Error, Void> seal() throws InvalidKeyException, NoSuchAlgorithmExc
448448 }
449449
450450 KeyPair secretKey = this .proof .secretKey .get ();
451- byte [] payload = BlockBuffer .getBufferSealedSignature (block .key , block .block , block .signature );
451+ byte [] payload = BlockSignatureBuffer .getBufferSealedSignature (block .key , block .block , block .signature );
452452 byte [] signature = secretKey .sign (payload );
453453
454454 this .proof .secretKey = Option .none ();
0 commit comments