@@ -364,6 +364,7 @@ class Signature(ct.Structure):
364
364
("alg_version" , ct .c_char_p ),
365
365
("claimed_nist_level" , ct .c_ubyte ),
366
366
("euf_cma" , ct .c_ubyte ),
367
+ ("sig_with_ctx_support" , ct .c_ubyte ),
367
368
("length_public_key" , ct .c_size_t ),
368
369
("length_secret_key" , ct .c_size_t ),
369
370
("length_signature" , ct .c_size_t ),
@@ -394,6 +395,7 @@ def __init__(self, alg_name, secret_key=None):
394
395
"version" : self ._sig .contents .alg_version .decode (),
395
396
"claimed_nist_level" : int (self ._sig .contents .claimed_nist_level ),
396
397
"is_euf_cma" : bool (self ._sig .contents .euf_cma ),
398
+ "sig_with_ctx_support" : bool (self ._sig .contents .sig_with_ctx_support ),
397
399
"length_public_key" : int (self ._sig .contents .length_public_key ),
398
400
"length_secret_key" : int (self ._sig .contents .length_secret_key ),
399
401
"length_signature" : int (self ._sig .contents .length_signature ),
@@ -440,6 +442,7 @@ def sign(self, message):
440
442
441
443
# Initialize to maximum signature size
442
444
signature_len = ct .c_int (self ._sig .contents .length_signature )
445
+
443
446
rv = native ().OQS_SIG_sign (
444
447
self ._sig ,
445
448
ct .byref (my_signature ),
@@ -462,13 +465,12 @@ def verify(self, message, signature, public_key):
462
465
# Provide length to avoid extra null char
463
466
my_message = ct .create_string_buffer (message , len (message ))
464
467
message_len = ct .c_int (len (my_message ))
465
-
466
- # Provide length to avoid extra null char in sig
467
468
my_signature = ct .create_string_buffer (signature , len (signature ))
468
469
signature_len = ct .c_int (len (my_signature ))
469
470
my_public_key = ct .create_string_buffer (
470
471
public_key , self ._sig .contents .length_public_key
471
472
)
473
+
472
474
rv = native ().OQS_SIG_verify (
473
475
self ._sig ,
474
476
my_message ,
@@ -496,6 +498,7 @@ def sign_with_ctx_str(self, message, context):
496
498
497
499
# Initialize to maximum signature size
498
500
signature_len = ct .c_int (self ._sig .contents .length_signature )
501
+
499
502
rv = native ().OQS_SIG_sign_with_ctx_str (
500
503
self ._sig ,
501
504
ct .byref (my_signature ),
@@ -525,10 +528,10 @@ def verify_with_ctx_str(self, message, signature, context, public_key):
525
528
signature_len = ct .c_int (len (my_signature ))
526
529
my_context = ct .create_string_buffer (context , len (context ))
527
530
context_len = ct .c_int (len (my_context ))
528
-
529
531
my_public_key = ct .create_string_buffer (
530
532
public_key , self ._sig .contents .length_public_key
531
533
)
534
+
532
535
rv = native ().OQS_SIG_verify_with_ctx_str (
533
536
self ._sig ,
534
537
my_message ,
0 commit comments