Home
last modified time | relevance | path

Searched +full:in2 +full:- (Results 1 – 25 of 152) sorted by relevance

1234567

/freebsd/crypto/openssl/crypto/ec/asm/
H A Decp_nistp521-ppc64.pl2 # Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
14 # p521 lower-level primitives for PPC64 using vector instructions.
22 while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
24 $output = "-";
29 ( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
30 ( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
31 die "can't locate ppc-xlate.pl";
60 .size ${name},.-${name}
70 my $count = $max - $min + 1;
74 stdu $sp,-16*`$count+1`($sp)
[all …]
/freebsd/crypto/libecc/src/nn/
H A Dnn_add.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
23 * o out = in1 +/- in2 if cnd is not zero.
27 * constant time for that specific factor, nor on the values of in1 and in2.
28 * It still depends on the maximal length of in1 and in2.
35 * Conditionally adds 'in2' to 'in1' according to "cnd", storing the result
38 * returns 0 on success, -1 on error.
41 * commutative, i.e. "_nn_cnd_add(cnd, out, in1, in2)" is not equivalent
42 * to "_nn_cnd_add(cnd, out, in2, in1)". It is commutative though if "cnd"
43 * is not zero or 'in1' == 'in2'.
[all …]
H A Dnn_mul.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
22 * Compute out = (in1 * in2) & (2^(WORD_BYTES * wlimits) - 1).
28 * algorithm (Karatsuba, Toom-Cook, or FFT based algorithms)
42 * The function returns 0 on succes, -1 on error.
44 ATTRIBUTE_WARN_UNUSED_RET static int _nn_mul_low(nn_t out, nn_src_t in1, nn_src_t in2, in _nn_mul_low() argument
56 for (i = 0; i < in1->wlen; i++) { in _nn_mul_low()
60 for (j = 0; j < in2->wlen; j++) { in _nn_mul_low()
77 in1->val[i], in2->val[j]); in _nn_mul_low()
88 out->val[pos] = (word_t)(out->val[pos] + prod_low); in _nn_mul_low()
[all …]
H A Dnn_mul_redc1.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
28 * - r = 2^p_rounded_bitlen mod (p), where
31 * - r_square = r^2 mod (p)
32 * - mpinv = -p^-1 mod (2^WORDSIZE).
37 * The function returns 0 on success, -1 on error. out parameters 'r',
71 /* _mpinv = 2^wlen - (modinv(prime, 2^wlen)) */ in nn_compute_redc1_coefs()
117 * and mpinv is -p^(-1) mod (2^WORDSIZE).
122 * The function returns 0 on success, -1 on error.
124 ATTRIBUTE_WARN_UNUSED_RET static int _nn_mul_redc1(nn_t out, nn_src_t in1, nn_src_t in2, nn_src_t p, in _nn_mul_redc1() argument
[all …]
/freebsd/crypto/libecc/src/fp/
H A Dfp_montgomery.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
22 /* Compute out = in1 + in2 mod p in the Montgomery form.
24 * Returns 0 on success, -1 on error.
28 int fp_add_monty(fp_t out, fp_src_t in1, fp_src_t in2) in fp_add_monty() argument
30 return fp_add(out, in1, in2); in fp_add_monty()
33 /* Compute out = in1 - in2 mod p in the Montgomery form.
35 * Returns 0 on success, -1 on error.
39 int fp_sub_monty(fp_t out, fp_src_t in1, fp_src_t in2) in fp_sub_monty() argument
41 return fp_sub(out, in1, in2); in fp_sub_monty()
[all …]
H A Dfp_add.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
20 * Compute out = in1 + in2 mod p. 'out' parameter must have been initialized
21 * by the caller. Returns 0 on success, -1 on error.
25 int fp_add(fp_t out, fp_src_t in1, fp_src_t in2) in fp_add() argument
31 ret = fp_check_initialized(in2); EG(ret, err); in fp_add()
33 MUST_HAVE(((&(in1->ctx->p)) == (&(in2->ctx->p))), ret, err); in fp_add()
34 MUST_HAVE(((&(in1->ctx->p)) == (&(out->ctx->p))), ret, err); in fp_add()
36 SHOULD_HAVE(!nn_cmp(&in1->fp_val, &(in1->ctx->p), &cmp) && (cmp < 0), ret, err); in fp_add()
37 SHOULD_HAVE(!nn_cmp(&in2->fp_val, &(in2->ctx->p), &cmp) && (cmp < 0), ret, err); in fp_add()
[all …]
H A Dfp_mul_redc1.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
20 * 0 on success, -1 on error.
25 ATTRIBUTE_WARN_UNUSED_RET static inline int _fp_mul_redc1(nn_t out, nn_src_t in1, nn_src_t in2, in _fp_mul_redc1() argument
28 return nn_mul_redc1(out, in1, in2, &(ctx->p), ctx->mpinv); in _fp_mul_redc1()
32 * Compute out = in1 * in2 mod (p) in redcified form.
35 * The function returns 0 on success, -1 on error.
39 int fp_mul_redc1(fp_t out, fp_src_t in1, fp_src_t in2) in fp_mul_redc1() argument
44 ret = fp_check_initialized(in2); EG(ret, err); in fp_mul_redc1()
47 MUST_HAVE((out->ctx == in1->ctx), ret, err); in fp_mul_redc1()
[all …]
H A Dfp.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
29 * Returns 0 on success, -1 on error.
35 MUST_HAVE(((ctx != NULL) && (ctx->magic == FP_CTX_MAGIC)), ret, err); in fp_ctx_check_initialized()
43 * - p: pointer to the prime defining Fp
44 * - p_bitlen: the bit length of p
45 * - r, r_square, mpinv: pointers to the Montgomery parameters r,
46 * (2^|p|) mod p), r^2 mod p and -p^-1 mod B (where B is the
49 * - p_shift, p_normalized and p_reciprocal are precomputed
52 * Returns 0 on success, -1 on error.
[all …]
H A Dfp_mul.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
25 * Compute out = in1 * in2 mod p. 'out' parameter must have been initialized
26 * by the caller. Returns 0 on success, -1 on error.
30 int fp_mul(fp_t out, fp_src_t in1, fp_src_t in2) in fp_mul() argument
35 ret = fp_check_initialized(in2); EG(ret, err); in fp_mul()
38 MUST_HAVE(out->ctx == in1->ctx, ret, err); in fp_mul()
39 MUST_HAVE(out->ctx == in2->ctx, ret, err); in fp_mul()
41 ret = nn_mul(&(out->fp_val), &(in1->fp_val), &(in2->fp_val)); EG(ret, err); in fp_mul()
42 ret = nn_mod_unshifted(&(out->fp_val), &(out->fp_val), &(in1->ctx->p_normalized), in fp_mul()
[all …]
/freebsd/crypto/libecc/src/curves/
H A Dprj_pt.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
30 * prj_pt_init()). Returns 0 on success, -1 on error.
36 MUST_HAVE(((in != NULL) && (in->magic == PRJ_PT_MAGIC)), ret, err); in prj_pt_check_initialized()
37 ret = ec_shortw_crv_check_initialized(in->crv); in prj_pt_check_initialized()
45 * infinity. The function returns 0 on success, -1 on error.
55 ret = fp_init(&(in->X), curve->a.ctx); EG(ret, err); in prj_pt_init()
56 ret = fp_init(&(in->Y), curve->a.ctx); EG(ret, err); in prj_pt_init()
57 ret = fp_init(&(in->Z), curve->a.ctx); EG(ret, err); in prj_pt_init()
58 in->crv = curve; in prj_pt_init()
[all …]
H A Daff_pt.c2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
22 * success, -1 otherwise.
28 MUST_HAVE(((in != NULL) && (in->magic == AFF_PT_MAGIC)), ret, err); in aff_pt_check_initialized()
29 ret = ec_shortw_crv_check_initialized(in->crv); in aff_pt_check_initialized()
37 * function on given curve. Return 0 on success, -1 on error.
47 ret = fp_init(&(in->x), curve->a.ctx); EG(ret, err); in aff_pt_init()
48 ret = fp_init(&(in->y), curve->a.ctx); EG(ret, err); in aff_pt_init()
50 in->crv = curve; in aff_pt_init()
51 in->magic = AFF_PT_MAGIC; in aff_pt_init()
[all …]
/freebsd/crypto/libecc/include/libecc/nn/
H A Dnn_add.h2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
20 ATTRIBUTE_WARN_UNUSED_RET int nn_cnd_add(int cnd, nn_t out, nn_src_t in1, nn_src_t in2);
21 ATTRIBUTE_WARN_UNUSED_RET int nn_cnd_sub(int cnd, nn_t out, nn_src_t in1, nn_src_t in2);
22 ATTRIBUTE_WARN_UNUSED_RET int nn_add(nn_t out, nn_src_t in1, nn_src_t in2);
24 ATTRIBUTE_WARN_UNUSED_RET int nn_sub(nn_t out, nn_src_t in1, nn_src_t in2);
26 ATTRIBUTE_WARN_UNUSED_RET int nn_mod_add(nn_t out, nn_src_t in1, nn_src_t in2, nn_src_t p);
28 ATTRIBUTE_WARN_UNUSED_RET int nn_mod_sub(nn_t out, nn_src_t in1, nn_src_t in2, nn_src_t p);
/freebsd/crypto/openssl/crypto/des/
H A Dxcbc_enc.c2 * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
28 register const unsigned char *in2; in DES_xcbc_encrypt() local
33 in2 = &(*inw)[0]; in DES_xcbc_encrypt()
34 c2l(in2, inW0); in DES_xcbc_encrypt()
35 c2l(in2, inW1); in DES_xcbc_encrypt()
36 in2 = &(*outw)[0]; in DES_xcbc_encrypt()
37 c2l(in2, outW0); in DES_xcbc_encrypt()
38 c2l(in2, outW1); in DES_xcbc_encrypt()
45 for (l -= 8; l >= 0; l -= 8) { in DES_xcbc_encrypt()
58 if (l != -8) { in DES_xcbc_encrypt()
[all …]
/freebsd/crypto/openssl/crypto/modes/asm/
H A Dghashp8-ppc.pl2 # Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
24 # version is ~2.1x slower than hardware-assisted AES-128-CTR, ~12x
25 # faster than "4-bit" integer-only compiler-generated 64-bit code.
32 # aggregated reduction - by 170% or 2.7x (resulting in 0.55 cpb).
59 $FRAME=6*$SIZE_T+13*16; # 13*16 is for v20-v31 offload
62 ( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
63 ( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
64 die "can't locate ppc-xlate.pl";
84 li r0,-4096
92 vspltisb $xC2,-16 # 0xf0
[all …]
/freebsd/crypto/openssl/crypto/ec/
H A Decp_nistp384.c2 * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
17 * http://www.apache.org/licenses/LICENSE-2.0
27 * Designed for 56-bit limbs by Rohan McLure <rohan.mclure@linux.ibm.com>.
41 # error "Your compiler doesn't appear to support 128-bit integer types"
48 * The underlying field. P384 operates over GF(2^384-2^128-2^96+2^32-1). We
56 * These are the parameters of P384, taken from FIPS 186-3, section D.1.2.4.
57 * These values are big-endian.
64 {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* a = -3 */
82 /*-
84 * ------------------------------------
[all …]
H A Decp_nistp521.c2 * Copyright 2011-2023 The OpenSSL Project Authors. All Rights Reserved.
17 * http://www.apache.org/licenses/LICENSE-2.0
33 * A 64-bit implementation of the NIST P-521 elliptic curve point multiplication
49 # error "Your compiler doesn't appear to support 128-bit integer types"
56 * The underlying field. P521 operates over GF(2^521-1). We can serialize an
64 * These are the parameters of P521, taken from FIPS 186-3, section D.1.2.5.
65 * These values are big-endian.
77 {0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* a = -3 */
115 /*-
117 * ------------------------------------
[all …]
/freebsd/crypto/openssl/crypto/poly1305/asm/
H A Dpoly1305-sparcv9.pl2 # Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
31 # (*) Comparison to compiler-generated code is really problematic,
34 # improvement on T4 for gcc-4.6. Well, in T4 case it's a bit
37 # (**) Pre-III performance should be even worse; floating-point
38 # performance for UltraSPARC I-IV on the other hand is reported
39 # to be 4.25 for hand-coded assembly, but they are just too old
41 # (***) Multi-process benchmark saturates at ~12.5x single-process
42 # result on 8-core processor, or ~21GBps per 2.85GHz socket.
80 save %sp,-STACK_FRAME-16,%sp
109 ldxa [$inp+%g0]0x88,$h0 ! load little-endian key
[all …]
/freebsd/crypto/libecc/include/libecc/fp/
H A Dfp_montgomery.h2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
24 ATTRIBUTE_WARN_UNUSED_RET int fp_add_monty(fp_t out, fp_src_t in1, fp_src_t in2);
25 ATTRIBUTE_WARN_UNUSED_RET int fp_sub_monty(fp_t out, fp_src_t in1, fp_src_t in2);
26 ATTRIBUTE_WARN_UNUSED_RET int fp_mul_monty(fp_t out, fp_src_t in1, fp_src_t in2);
28 ATTRIBUTE_WARN_UNUSED_RET int fp_div_monty(fp_t out, fp_src_t in1, fp_src_t in2);
/freebsd/crypto/openssl/crypto/des/asm/
H A Ddes_enc.m41 ! Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
8 ! To expand the m4 macros: m4 -B 8192 des_enc.m4 > des_enc.S
15 ! Assemble through gcc: gcc -c -mcpu=ultrasparc -o des_enc.o des_enc.S
17 ! Assemble through cc: cc -c -xarch=v8plusa -o des_enc.o des_enc.S
21 ! 32-bit build:
22 ! 23% faster than cc-5.2 -xarch=v8plus -xO5
23 ! 115% faster than gcc-3.2.1 -m32 -mcpu=ultrasparc -O5
24 ! 64-bit build:
25 ! 50% faster than cc-5.2 -xarch=v9 -xO5
26 ! 100% faster than gcc-3.2.1 -m64 -mcpu=ultrasparc -O5
[all …]
/freebsd/crypto/openssl/crypto/ml_dsa/
H A Dml_dsa_hash.h2 * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
23 const uint8_t *in2, size_t in2_len, uint8_t *out, size_t out_len) in shake_xof_2() argument
27 && EVP_DigestUpdate(ctx, in2, in2_len) in shake_xof_2()
33 const uint8_t *in2, size_t in2_len, in shake_xof_3() argument
38 && EVP_DigestUpdate(ctx, in2, in2_len) in shake_xof_3()
/freebsd/contrib/wireguard-tools/
H A Dcurve25519-fiat32.h1 // SPDX-License-Identifier: GPL-2.0 OR MIT
3 * Copyright (C) 2015-2016 The fiat-crypto Authors.
4 * Copyright (C) 2018-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
6 * This is a machine-generated formally verified implementation of Curve25519
7 * ECDH from: <https://github.com/mit-plv/fiat-crypto>. Though originally
9 * It is optimized for 32-bit machines and machines that cannot work efficiently
10 * with 128-bit integer types.
13 /* fe means field element. Here the field is \Z/(2^255-19). An element t,
37 h[0] = a0&((1<<26)-1); /* 26 used, 32-26 left. 26 */ in fe_frombytes_impl()
38 h[1] = (a0>>26) | ((a1&((1<<19)-1))<< 6); /* (32-26) + 19 = 6+19 = 25 */ in fe_frombytes_impl()
[all …]
/freebsd/crypto/openssl/crypto/aes/asm/
H A Daesp8-ppc.pl2 # Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
19 # The module is endian-agnostic in sense that it supports both big-
20 # and little-endian cases. Data alignment in parallelizable modes is
25 # is aligned programmatically, which in turn guarantees exception-
33 # Add XTS subroutine, 9x on little- and 12x improvement on big-endian
37 # Current large-block performance in cycles per byte processed with
38 # 128-bit key (less is better).
40 # CBC en-/decrypt CTR XTS
72 ( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
73 ( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
[all …]
H A Daesv8-armx.pl2 # Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
18 # module is endian-agnostic in sense that it supports both big- and
19 # little-endian cases. As does it support both 32- and 64-bit modes
24 # instruction latencies and issue rates. On Cortex-A53, an in-order
25 # execution core, this costs up to 10-15%, which is partially
26 # compensated by implementing dedicated code path for 128-bit
27 # CBC encrypt case. On Cortex-A57 parallelizable mode performance
32 # Key to performance of parallelize-able modes is round instruction
42 # Performance in cycles per byte processed with 128-bit key:
46 # Cortex-A53 1.32 1.17/1.29(**) 1.36/1.46
[all …]
/freebsd/crypto/openssl/providers/implementations/rands/
H A Ddrbg_hmac.c2 * Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
41 * Called twice by SP800-90Ar1 10.1.2.2 HMAC_DRBG_Update_Process.
45 * in1, in2, in3 are optional inputs that can be NULL.
49 * hmac->K = HMAC(hmac->K, hmac->V || inbyte || [in1] || [in2] || [in3])
50 * hmac->V = HMAC(hmac->K, hmac->V)
56 const unsigned char *in2, size_t in2len, in do_hmac() argument
59 EVP_MAC_CTX *ctx = hmac->ctx; in do_hmac()
61 if (!EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL) in do_hmac()
62 /* K = HMAC(K, V || inbyte || [in1] || [in2] || [in3]) */ in do_hmac()
63 || !EVP_MAC_update(ctx, hmac->V, hmac->blocklen) in do_hmac()
[all …]
/freebsd/crypto/openssl/fuzz/
H A Dslh-dsa.c12 * Test slh-dsa operation.
25 * @brief Consumes an 8-bit unsigned integer from a buffer.
27 * This function extracts an 8-bit unsigned integer from the provided buffer,
32 * @param val Pointer to store the extracted 8-bit value.
42 *len -= sizeof(uint8_t); in consume_uint8t()
95 * This function maps a selector value to a specific SLH-DSA algorithm
114 * There are 12 SLH-DSA algs with registered NIDS at the moment in select_keytype()
125 * man7/EVP_PKEY-SLH-DSA.pod in select_keytype()
155 * @brief Generates two SLH-DSA key pairs based on consumed selector values.
159 * SLH-DSA key pairs.
[all …]

1234567