@@ -668,6 +668,29 @@ void run_silentpayments_test_vector_receive(const struct bip352_test_vector *tes
668
668
}
669
669
}
670
670
671
+ static void silentpayments_sha256_tag_test (void ) {
672
+ secp256k1_sha256 sha ;
673
+ {
674
+ /* "BIP0352/Inputs" */
675
+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'I' ,'n' ,'p' ,'u' ,'t' ,'s' };
676
+ secp256k1_silentpayments_sha256_init_inputs (& sha );
677
+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
678
+ }
679
+ {
680
+ /* "BIP0352/SharedSecret" */
681
+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'S' ,'h' ,'a' ,'r' ,'e' ,'d' , 'S' ,'e' ,'c' ,'r' ,'e' ,'t' };
682
+ secp256k1_silentpayments_sha256_init_sharedsecret (& sha );
683
+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
684
+ }
685
+ {
686
+ /* "BIP0352/Label" */
687
+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'L' ,'a' ,'b' ,'e' ,'l' };
688
+ secp256k1_silentpayments_sha256_init_label (& sha );
689
+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
690
+ }
691
+ }
692
+
693
+
671
694
void run_silentpayments_test_vectors (void ) {
672
695
size_t i ;
673
696
@@ -685,6 +708,7 @@ void run_silentpayments_tests(void) {
685
708
test_label_api ();
686
709
test_recipient_api ();
687
710
run_silentpayments_test_vectors ();
711
+ silentpayments_sha256_tag_test ();
688
712
}
689
713
690
714
#endif
0 commit comments