@@ -364,6 +364,7 @@ class Signature(ct.Structure):
364364 ("alg_version" , ct .c_char_p ),
365365 ("claimed_nist_level" , ct .c_ubyte ),
366366 ("euf_cma" , ct .c_ubyte ),
367+ ("sig_with_ctx_support" , ct .c_ubyte ),
367368 ("length_public_key" , ct .c_size_t ),
368369 ("length_secret_key" , ct .c_size_t ),
369370 ("length_signature" , ct .c_size_t ),
@@ -394,6 +395,7 @@ def __init__(self, alg_name, secret_key=None):
394395 "version" : self ._sig .contents .alg_version .decode (),
395396 "claimed_nist_level" : int (self ._sig .contents .claimed_nist_level ),
396397 "is_euf_cma" : bool (self ._sig .contents .euf_cma ),
398+ "sig_with_ctx_support" : bool (self ._sig .contents .sig_with_ctx_support ),
397399 "length_public_key" : int (self ._sig .contents .length_public_key ),
398400 "length_secret_key" : int (self ._sig .contents .length_secret_key ),
399401 "length_signature" : int (self ._sig .contents .length_signature ),
@@ -440,6 +442,7 @@ def sign(self, message):
440442
441443 # Initialize to maximum signature size
442444 signature_len = ct .c_int (self ._sig .contents .length_signature )
445+
443446 rv = native ().OQS_SIG_sign (
444447 self ._sig ,
445448 ct .byref (my_signature ),
@@ -462,13 +465,12 @@ def verify(self, message, signature, public_key):
462465 # Provide length to avoid extra null char
463466 my_message = ct .create_string_buffer (message , len (message ))
464467 message_len = ct .c_int (len (my_message ))
465-
466- # Provide length to avoid extra null char in sig
467468 my_signature = ct .create_string_buffer (signature , len (signature ))
468469 signature_len = ct .c_int (len (my_signature ))
469470 my_public_key = ct .create_string_buffer (
470471 public_key , self ._sig .contents .length_public_key
471472 )
473+
472474 rv = native ().OQS_SIG_verify (
473475 self ._sig ,
474476 my_message ,
@@ -496,6 +498,7 @@ def sign_with_ctx_str(self, message, context):
496498
497499 # Initialize to maximum signature size
498500 signature_len = ct .c_int (self ._sig .contents .length_signature )
501+
499502 rv = native ().OQS_SIG_sign_with_ctx_str (
500503 self ._sig ,
501504 ct .byref (my_signature ),
@@ -525,10 +528,10 @@ def verify_with_ctx_str(self, message, signature, context, public_key):
525528 signature_len = ct .c_int (len (my_signature ))
526529 my_context = ct .create_string_buffer (context , len (context ))
527530 context_len = ct .c_int (len (my_context ))
528-
529531 my_public_key = ct .create_string_buffer (
530532 public_key , self ._sig .contents .length_public_key
531533 )
534+
532535 rv = native ().OQS_SIG_verify_with_ctx_str (
533536 self ._sig ,
534537 my_message ,
0 commit comments