@@ -696,6 +696,29 @@ void run_silentpayments_test_vector_receive(const struct bip352_test_vector *tes
696
696
}
697
697
}
698
698
699
+ static void silentpayments_sha256_tag_test (void ) {
700
+ secp256k1_sha256 sha ;
701
+ {
702
+ /* "BIP0352/Inputs" */
703
+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'I' ,'n' ,'p' ,'u' ,'t' ,'s' };
704
+ secp256k1_silentpayments_sha256_init_inputs (& sha );
705
+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
706
+ }
707
+ {
708
+ /* "BIP0352/SharedSecret" */
709
+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'S' ,'h' ,'a' ,'r' ,'e' ,'d' , 'S' ,'e' ,'c' ,'r' ,'e' ,'t' };
710
+ secp256k1_silentpayments_sha256_init_sharedsecret (& sha );
711
+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
712
+ }
713
+ {
714
+ /* "BIP0352/Label" */
715
+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'L' ,'a' ,'b' ,'e' ,'l' };
716
+ secp256k1_silentpayments_sha256_init_label (& sha );
717
+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
718
+ }
719
+ }
720
+
721
+
699
722
void run_silentpayments_test_vectors (void ) {
700
723
size_t i ;
701
724
@@ -713,6 +736,7 @@ void run_silentpayments_tests(void) {
713
736
test_label_api ();
714
737
test_recipient_api ();
715
738
run_silentpayments_test_vectors ();
739
+ silentpayments_sha256_tag_test ();
716
740
}
717
741
718
742
#endif
0 commit comments