Home
last modified time | relevance | path

Searched refs:sig_len (Results 1 – 25 of 28) sorted by relevance

12

/openssl/demos/signature/
H A DEVP_EC_Signature_demo.c74 size_t sig_len; in demo_sign() local
117 if (!EVP_DigestSignFinal(sign_context, NULL, &sig_len)) { in demo_sign()
121 if (sig_len <= 0) { in demo_sign()
125 sig_value = OPENSSL_malloc(sig_len); in demo_sign()
130 if (!EVP_DigestSignFinal(sign_context, sig_value, &sig_len)) { in demo_sign()
134 *sig_out_len = sig_len; in demo_sign()
137 BIO_dump_indent_fp(stdout, sig_value, sig_len, 2); in demo_sign()
151 size_t sig_len, unsigned char *sig_value) in demo_verify() argument
209 size_t sig_len = 0; in main() local
218 if (!demo_sign(libctx, sig_name, &sig_len, &sig_value)) { in main()
[all …]
H A DEVP_ED_Signature_demo.c35 size_t sig_len; in demo_sign() local
60 if (!EVP_DigestSign(sign_context, NULL, &sig_len, tbs, tbs_len)) { in demo_sign()
64 sig_value = OPENSSL_malloc(sig_len); in demo_sign()
70 if (!EVP_DigestSign(sign_context, sig_value, &sig_len, tbs, tbs_len)) { in demo_sign()
74 *sig_out_len = sig_len; in demo_sign()
76 BIO_dump_indent_fp(stdout, sig_value, sig_len, 2); in demo_sign()
89 const unsigned char *sig_value, size_t sig_len, in demo_verify() argument
114 if (!EVP_DigestVerify(verify_context, sig_value, sig_len, in demo_verify()
173 size_t sig_len = 0; in main() local
189 &sig_value, &sig_len)) { in main()
[all …]
H A Drsa_pss_hash.c33 static int sign(OSSL_LIB_CTX *libctx, unsigned char **sig, size_t *sig_len) in sign() argument
80 if (EVP_DigestSignFinal(mctx, NULL, sig_len) == 0) { in sign()
86 *sig = OPENSSL_malloc(*sig_len); in sign()
93 if (EVP_DigestSignFinal(mctx, *sig, sig_len) == 0) { in sign()
114 static int verify(OSSL_LIB_CTX *libctx, const unsigned char *sig, size_t sig_len) in verify() argument
158 if (EVP_DigestVerifyFinal(mctx, sig, sig_len) == 0) { in verify()
176 size_t sig_len = 0; in main() local
178 if (sign(libctx, &sig, &sig_len) == 0) in main()
181 if (verify(libctx, sig, sig_len) == 0) in main()
H A Drsa_pss_direct.c38 static int sign(OSSL_LIB_CTX *libctx, unsigned char **sig, size_t *sig_len) in sign() argument
88 if (EVP_PKEY_sign(ctx, NULL, sig_len, in sign()
95 *sig = OPENSSL_malloc(*sig_len); in sign()
102 if (EVP_PKEY_sign(ctx, *sig, sig_len, in sign()
124 static int verify(OSSL_LIB_CTX *libctx, const unsigned char *sig, size_t sig_len) in verify() argument
171 if (EVP_PKEY_verify(ctx, sig, sig_len, in verify()
191 size_t sig_len = 0; in main() local
193 if (sign(libctx, &sig, &sig_len) == 0) in main()
196 if (verify(libctx, sig, sig_len) == 0) in main()
H A DEVP_DSA_Signature_demo.c168 size_t sig_len = 0; in demo_sign() local
196 if (EVP_DigestSignFinal(ctx, NULL, &sig_len) != 1) in demo_sign()
198 if (sig_len == 0) in demo_sign()
201 sig_value = OPENSSL_malloc(sig_len); in demo_sign()
206 if (EVP_DigestSignFinal(ctx, sig_value, &sig_len) != 1) in demo_sign()
214 sig_len = 0; in demo_sign()
217 *p_sig_len = sig_len; in demo_sign()
223 BIO_dump_indent_fp(stdout, sig_value, sig_len, 2); in demo_sign()
258 if (EVP_DigestVerifyFinal(ctx, sig_value, sig_len) != 1) in demo_verify()
277 size_t sig_len = 0; in main() local
[all …]
/openssl/crypto/ct/
H A Dct_sct.c163 void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len) in SCT_set0_signature() argument
167 sct->sig_len = sig_len; in SCT_set0_signature()
171 int SCT_set1_signature(SCT *sct, const unsigned char *sig, size_t sig_len) in SCT_set1_signature() argument
175 sct->sig_len = 0; in SCT_set1_signature()
178 if (sig != NULL && sig_len > 0) { in SCT_set1_signature()
179 sct->sig = OPENSSL_memdup(sig, sig_len); in SCT_set1_signature()
182 sct->sig_len = sig_len; in SCT_set1_signature()
234 return sct->sig_len; in SCT_get0_signature()
252 sct->sig != NULL && sct->sig_len > 0; in SCT_signature_is_complete()
H A Dct_oct.c87 int sig_len; in o2i_SCT() local
126 sig_len = o2i_SCT_signature(sct, &p, len); in o2i_SCT()
127 if (sig_len <= 0) { in o2i_SCT()
131 len -= sig_len; in o2i_SCT()
173 len = 4 + sct->sig_len; in i2o_SCT_signature()
188 s2n(sct->sig_len, p); in i2o_SCT_signature()
189 memcpy(p, sct->sig, sct->sig_len); in i2o_SCT_signature()
214 len = 43 + sct->ext_len + 4 + sct->sig_len; in i2o_SCT()
H A Dct_prn.c111 BIO_hex_string(out, indent + 16, 16, sct->sig, sct->sig_len); in SCT_print()
H A Dct_vfy.c133 ret = EVP_DigestVerifyFinal(ctx, sct->sig, sct->sig_len); in SCT_CTX_verify()
H A Dct_local.h76 size_t sig_len; member
/openssl/test/
H A Decdsatest.c195 size_t sig_len; in test_builtin() local
247 || !TEST_ptr(sig = OPENSSL_malloc(sig_len = (size_t)temp)) in test_builtin()
251 || !TEST_true(EVP_DigestSign(mctx, sig, &sig_len, tbs, sizeof(tbs))) in test_builtin()
252 || !TEST_int_le(sig_len, ECDSA_size(eckey)) in test_builtin()
257 || !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 0) in test_builtin()
267 || !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 1) in test_builtin()
275 || !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 0) in test_builtin()
282 || !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 1) in test_builtin()
312 offset = tbs[0] % sig_len; in test_builtin()
317 || !TEST_int_ne(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 1) in test_builtin()
[all …]
H A Dacvp_test.c102 size_t sig_len; in sig_gen() local
106 sig_len = sz; in sig_gen()
114 *sig_out_len = sig_len; in sig_gen()
279 size_t sig_len = 0, rlen = 0, slen = 0; in ecdsa_siggen_test() local
288 &sig, &sig_len)) in ecdsa_siggen_test()
309 size_t sig_len; in ecdsa_sigver_test() local
788 size_t sig_len = 0, rlen = 0, slen = 0; in dsa_siggen_test() local
798 &sig, &sig_len)) in dsa_siggen_test()
819 size_t sig_len; in dsa_sigver_test() local
1407 size_t sig_len = 0, n_len = 0, e_len = 0; in rsa_siggen_test() local
[all …]
H A Devp_extra_test.c1504 size_t sig_len = 0, shortsig_len = 1; in test_EVP_PKEY_sign() local
1538 sig = OPENSSL_malloc(sig_len); in test_EVP_PKEY_sign()
1571 size_t sig_len = 0, shortsig_len = 1; in test_EVP_PKEY_sign_with_app_method() local
1613 sig = OPENSSL_malloc(sig_len); in test_EVP_PKEY_sign_with_app_method()
1722 size_t sig_len = 0, sig2_len = 0, shortsig_len = 1; in test_EVP_DigestSignInit() local
1792 || !TEST_ptr(sig = OPENSSL_malloc(sig_len))) in test_EVP_DigestSignInit()
1812 || !TEST_ptr(sig = OPENSSL_malloc(sig_len)) in test_EVP_DigestSignInit()
1861 if (!TEST_mem_eq(sig, sig_len, sig2, sig2_len)) in test_EVP_DigestSignInit()
2379 size_t sig_len = 0; in test_EVP_SM2() local
2450 if (!TEST_ptr(sig = OPENSSL_malloc(sig_len))) in test_EVP_SM2()
[all …]
H A Devp_extra_test2.c1298 size_t sig_len = 0; in test_rsa_pss_sign() local
1310 && TEST_int_gt(EVP_PKEY_sign(pctx, NULL, &sig_len, mdbuf, in test_rsa_pss_sign()
1312 && TEST_int_gt(sig_len, 0) in test_rsa_pss_sign()
1313 && TEST_ptr(sig = OPENSSL_malloc(sig_len)) in test_rsa_pss_sign()
1314 && TEST_int_gt(EVP_PKEY_sign(pctx, sig, &sig_len, mdbuf, in test_rsa_pss_sign()
/openssl/util/perl/TLSProxy/
H A DServerKeyExchange.pm86 my $sig_len = unpack('n', substr($self->data, $ptr));
87 if (defined $sig_len) {
89 $sig = substr($self->data, $ptr, $sig_len);
90 $ptr += $sig_len;
/openssl/crypto/ec/
H A Decdsa_vrf.c42 const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) in ECDSA_verify() argument
45 return eckey->meth->verify(type, dgst, dgst_len, sigbuf, sig_len, in ECDSA_verify()
H A Dec_kmeth.c251 int sig_len, EC_KEY *eckey), in EC_KEY_METHOD_set_verify() argument
329 int sig_len, EC_KEY *eckey), in EC_KEY_METHOD_get_verify() argument
H A Decdsa_ossl.c420 const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) in ossl_ecdsa_verify() argument
431 if (d2i_ECDSA_SIG(&s, &p, sig_len) == NULL) in ossl_ecdsa_verify()
435 if (derlen != sig_len || memcmp(sigbuf, der, derlen) != 0) in ossl_ecdsa_verify()
/openssl/crypto/cmp/
H A Dcmp_protect.c59 size_t sig_len; in ossl_cmp_calc_protection() local
92 &protection, &sig_len)) in ossl_cmp_calc_protection()
99 if (!ASN1_BIT_STRING_set(prot, protection, sig_len)) { in ossl_cmp_calc_protection()
/openssl/doc/man7/
H A DEVP_SIGNATURE-ED25519.pod143 size_t sig_len;
157 EVP_DigestSign(md_ctx, NULL, &sig_len, msg, msg_len);
158 sig = OPENSSL_zalloc(sig_len);
160 EVP_DigestSign(md_ctx, sig, &sig_len, msg, msg_len);
H A DEVP_PKEY-SM2.pod78 EVP_DigestVerifyFinal(mctx, sig, sig_len)
/openssl/crypto/sm2/
H A Dsm2_sign.c497 const unsigned char *sig, int sig_len, in ossl_sm2_internal_verify() argument
512 if (d2i_ECDSA_SIG(&s, &p, sig_len) == NULL) { in ossl_sm2_internal_verify()
518 if (derlen != sig_len || memcmp(sig, der, derlen) != 0) { in ossl_sm2_internal_verify()
/openssl/doc/man3/
H A DSCT_new.pod66 void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len);
67 int SCT_set1_signature(SCT *sct, const unsigned char *sig, size_t sig_len);
/openssl/include/openssl/
H A Dec.h1519 int sig_len, EC_KEY *eckey),
1563 int sig_len, EC_KEY *eckey),
/openssl/apps/
H A Dspeed.c1495 size_t sig_len = tempargs->sig_max_sig_len[testnum]; in SIG_sign_loop() local
1496 int ret = EVP_PKEY_sign(ctx, sig, &sig_len, md, md_len); in SIG_sign_loop()
1513 size_t sig_len = tempargs->sig_act_sig_len[testnum]; in SIG_verify_loop() local
1520 int ret = EVP_PKEY_verify(ctx, sig, sig_len, md, md_len); in SIG_verify_loop()
4258 size_t max_sig_len, sig_len; in speed_main() local
4330 sig = app_malloc(sig_len = max_sig_len, "signature buffer"); in speed_main()
4335 if (EVP_PKEY_sign(sig_sign_ctx, sig, &sig_len, md, md_len) <= 0) { in speed_main()
4354 if (EVP_PKEY_verify(sig_verify_ctx, sig, sig_len, md, md_len) <= 0) { in speed_main()
4358 if (EVP_PKEY_verify(sig_verify_ctx, sig, sig_len, md, md_len) <= 0) { in speed_main()
4366 loopargs[i].sig_act_sig_len[testnum] = sig_len; in speed_main()

Completed in 89 milliseconds

12