@@ -706,6 +706,29 @@ void run_silentpayments_test_vector_receive(const struct bip352_test_vector *tes
706706 }
707707}
708708
709+ static void silentpayments_sha256_tag_test (void ) {
710+ secp256k1_sha256 sha ;
711+ {
712+ /* "BIP0352/Inputs" */
713+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'I' ,'n' ,'p' ,'u' ,'t' ,'s' };
714+ secp256k1_silentpayments_sha256_init_inputs (& sha );
715+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
716+ }
717+ {
718+ /* "BIP0352/SharedSecret" */
719+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'S' ,'h' ,'a' ,'r' ,'e' ,'d' , 'S' ,'e' ,'c' ,'r' ,'e' ,'t' };
720+ secp256k1_silentpayments_sha256_init_sharedsecret (& sha );
721+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
722+ }
723+ {
724+ /* "BIP0352/Label" */
725+ static const unsigned char tag [] = {'B' ,'I' ,'P' ,'0' ,'3' ,'5' ,'2' ,'/' ,'L' ,'a' ,'b' ,'e' ,'l' };
726+ secp256k1_silentpayments_sha256_init_label (& sha );
727+ test_sha256_tag_midstate (& sha , tag , sizeof (tag ));
728+ }
729+ }
730+
731+
709732void run_silentpayments_test_vectors (void ) {
710733 size_t i ;
711734
@@ -722,6 +745,7 @@ void run_silentpayments_tests(void) {
722745 test_label_api ();
723746 test_recipient_api ();
724747 run_silentpayments_test_vectors ();
748+ silentpayments_sha256_tag_test ();
725749}
726750
727751#endif
0 commit comments