/freebsd/crypto/openssl/crypto/ec/asm/ |
H A D | ecp_nistp521-ppc64.pl | 2 # 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 D | nn_add.c | 2 * 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 D | nn_mul.c | 2 * 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 D | nn_mul_redc1.c | 2 * 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 D | fp_montgomery.c | 2 * 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 D | fp_add.c | 2 * 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 D | fp_mul_redc1.c | 2 * 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 D | fp.c | 2 * 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 D | fp_mul.c | 2 * 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 D | prj_pt.c | 2 * 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 D | aff_pt.c | 2 * 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 D | nn_add.h | 2 * 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 D | xcbc_enc.c | 2 * 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 D | ghashp8-ppc.pl | 2 # 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/poly1305/asm/ |
H A D | poly1305-sparcv9.pl | 2 # 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 D | fp_montgomery.h | 2 * 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 D | des_enc.m4 | 1 ! 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/providers/implementations/rands/ |
H A D | drbg_hmac.c | 2 * Copyright 2011-2024 The OpenSSL Project Authors. All Rights Reserved. 44 * Called twice by SP800-90Ar1 10.1.2.2 HMAC_DRBG_Update_Process. 48 * in1, in2, in3 are optional inputs that can be NULL. 52 * hmac->K = HMAC(hmac->K, hmac->V || inbyte || [in1] || [in2] || [in3]) 53 * hmac->V = HMAC(hmac->K, hmac-> 59 do_hmac(PROV_DRBG_HMAC * hmac,unsigned char inbyte,const unsigned char * in1,size_t in1len,const unsigned char * in2,size_t in2len,const unsigned char * in3,size_t in3len) do_hmac() argument 96 drbg_hmac_update(PROV_DRBG * drbg,const unsigned char * in1,size_t in1len,const unsigned char * in2,size_t in2len,const unsigned char * in3,size_t in3len) drbg_hmac_update() argument [all...] |
/freebsd/crypto/openssl/crypto/ec/ |
H A D | ecp_nistp521.c | 2 * Copyright 2011-2021 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/contrib/wireguard-tools/ |
H A D | curve25519-fiat32.h | 1 // 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 D | aesv8-armx.pl | 2 # Copyright 2014-2023 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 …]
|
H A D | aesp8-ppc.pl | 2 # Copyright 2014-2024 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 …]
|
/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/ |
H A D | tst.general.d | 25 #define IN2(vala, valb) \ macro 42 TST("one-element array: integer"); 47 SEL("-1"); 49 TST("one-element array: hex integer (not in spec, not supported)"); 53 TST("one-element array: float"); 57 TST("one-element array: float + exponent"); 61 TST("one-element array: integer + whitespace"); 65 TST("one-element array: integer + exponent + whitespace"); 69 TST("one-element array: string"); 73 TST("alternative first-element indexing"); [all …]
|
/freebsd/crypto/openssl/test/recipes/ |
H A D | 04-test_conf.t | 2 # Copyright 2017-2024 The OpenSSL Project Authors. All Rights Reserved. 33 my $result_path = "test_conf-$_-stdout"; 41 my $in2 = $_[1]; 43 $in2 =~ s/\r\n/\n/g; 44 $in1 ne $in2}), 0,
|
/freebsd/contrib/llvm-project/libcxx/include/__algorithm/ |
H A D | in_in_result.h | 1 // -*- C++ -*- 2 //===------ 30 _LIBCPP_NO_UNIQUE_ADDRESS _InIter2 in2; global() member [all...] |