Home
last modified time | relevance | path

Searched refs:cksum (Results 1 – 25 of 146) sorted by relevance

123456

/freebsd/sys/gdb/
H A Dgdb_packet.c108 int c, cksum; in gdb_rx_begin() local
120 cksum = 0; in gdb_rx_begin()
127 cksum += c; in gdb_rx_begin()
130 cksum &= 0xff; in gdb_rx_begin()
146 cksum -= (C2N(c) << 4) & 0xf0; in gdb_rx_begin()
148 cksum -= C2N(c) & 0x0f; in gdb_rx_begin()
149 if (cksum == 0) { in gdb_rx_begin()
156 } while (cksum != 0); in gdb_rx_begin()
279 unsigned char c, cksum; in gdb_tx_end() local
289 cksum = 0; in gdb_tx_end()
[all …]
/freebsd/crypto/heimdal/lib/krb5/
H A Dmit_glue.c48 krb5_checksum *cksum) in krb5_c_make_checksum() argument
58 input->data, input->length, cksum); in krb5_c_make_checksum()
67 const krb5_checksum *cksum, krb5_boolean *valid) in krb5_c_verify_checksum() argument
74 ret = krb5_c_make_checksum(context, cksum->cksumtype, in krb5_c_verify_checksum()
79 if (data_cksum.cksumtype == cksum->cksumtype in krb5_c_verify_checksum()
80 && krb5_data_ct_cmp(&data_cksum.checksum, &cksum->checksum) == 0) in krb5_c_verify_checksum()
89 krb5_c_get_checksum(krb5_context context, const krb5_checksum *cksum, in krb5_c_get_checksum() argument
95 *type = cksum->cksumtype; in krb5_c_get_checksum()
101 ret = der_copy_octet_string(&cksum->checksum, *data); in krb5_c_get_checksum()
112 krb5_c_set_checksum(krb5_context context, krb5_checksum *cksum, in krb5_c_set_checksum() argument
[all …]
H A Dcrypto.c434 Checksum *cksum) in verify_checksum() argument
442 ct = _krb5_find_checksum(cksum->cksumtype); in verify_checksum()
446 cksum->cksumtype); in verify_checksum()
449 if(ct->checksumsize != cksum->checksum.length) { in verify_checksum()
454 ct->name, (unsigned)cksum->checksum.length, in verify_checksum()
491 ret = (*ct->verify)(context, dkey, data, len, usage, cksum); in verify_checksum()
510 if(krb5_data_ct_cmp(&c.checksum, &cksum->checksum) != 0) { in verify_checksum()
529 Checksum *cksum) in krb5_verify_checksum() argument
534 ct = _krb5_find_checksum(cksum->cksumtype); in krb5_verify_checksum()
538 cksum->cksumtype); in krb5_verify_checksum()
[all …]
H A Dbuild_auth.c109 Checksum *cksum, in _krb5_build_authenticator() argument
147 if (cksum) { in _krb5_build_authenticator()
148 ALLOC(auth.cksum, 1); in _krb5_build_authenticator()
149 if (auth.cksum == NULL) { in _krb5_build_authenticator()
153 ret = copy_Checksum(cksum, auth.cksum); in _krb5_build_authenticator()
157 if (auth.cksum->cksumtype == CKSUMTYPE_GSSAPI) { in _krb5_build_authenticator()
H A Dcrypto-arcfour.c134 Checksum k1_c, k2_c, k3_c, cksum; in ARCFOUR_subencrypt() local
162 cksum.checksum.length = 16; in ARCFOUR_subencrypt()
163 cksum.checksum.data = data; in ARCFOUR_subencrypt()
165 ret = _krb5_internal_hmac(NULL, c, cdata + 16, len - 16, 0, &ke, &cksum); in ARCFOUR_subencrypt()
203 Checksum k1_c, k2_c, k3_c, cksum; in ARCFOUR_subdecrypt() local
249 cksum.checksum.length = 16; in ARCFOUR_subdecrypt()
250 cksum.checksum.data = cksum_data; in ARCFOUR_subdecrypt()
252 ret = _krb5_internal_hmac(NULL, c, cdata + 16, len - 16, 0, &ke, &cksum); in ARCFOUR_subdecrypt()
260 if (ct_memcmp (cksum.checksum.data, data, 16) != 0) { in ARCFOUR_subdecrypt()
H A Drd_safe.c49 c = safe->cksum; in verify_checksum()
50 safe->cksum.cksumtype = 0; in verify_checksum()
51 safe->cksum.checksum.data = NULL; in verify_checksum()
52 safe->cksum.checksum.length = 0; in verify_checksum()
78 safe->cksum = c; in verify_checksum()
123 if (!krb5_checksum_is_keyed(context, safe.cksum.cksumtype) in krb5_rd_safe()
124 || !krb5_checksum_is_collision_proof(context, safe.cksum.cksumtype)) { in krb5_rd_safe()
H A Dpac.c527 Checksum cksum; in verify_checksum() local
529 memset(&cksum, 0, sizeof(cksum)); in verify_checksum()
539 cksum.cksumtype = type; in verify_checksum()
540 cksum.checksum.length = in verify_checksum()
542 cksum.checksum.data = malloc(cksum.checksum.length); in verify_checksum()
543 if (cksum.checksum.data == NULL) { in verify_checksum()
547 ret = krb5_storage_read(sp, cksum.checksum.data, cksum.checksum.length); in verify_checksum()
548 if (ret != (int)cksum.checksum.length) { in verify_checksum()
554 if (!krb5_checksum_is_keyed(context, cksum.cksumtype)) { in verify_checksum()
557 cksum.cksumtype); in verify_checksum()
[all …]
H A Dmk_safe.c98 s.cksum.cksumtype = 0; in krb5_mk_safe()
99 s.cksum.checksum.data = NULL; in krb5_mk_safe()
100 s.cksum.checksum.length = 0; in krb5_mk_safe()
118 &s.cksum); in krb5_mk_safe()
127 free_Checksum (&s.cksum); in krb5_mk_safe()
/freebsd/sys/netipsec/
H A Dudpencap.c321 uint16_t cksum, off; in udp_ipsec_adjust_cksum() local
333 if (sav->natt->cksum != 0) { in udp_ipsec_adjust_cksum()
335 m_copydata(m, skip + off, sizeof(cksum), in udp_ipsec_adjust_cksum()
336 (caddr_t)&cksum); in udp_ipsec_adjust_cksum()
338 if (proto == IPPROTO_UDP && cksum == 0) in udp_ipsec_adjust_cksum()
340 cksum = in_addword(cksum, sav->natt->cksum); in udp_ipsec_adjust_cksum()
364 cksum = 0; /* Reset for UDP. */ in udp_ipsec_adjust_cksum()
366 m_copyback(m, skip + off, sizeof(cksum), (caddr_t)&cksum); in udp_ipsec_adjust_cksum()
374 cksum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, in udp_ipsec_adjust_cksum()
376 m_copyback(m, skip + off, sizeof(cksum), in udp_ipsec_adjust_cksum()
[all …]
/freebsd/sys/contrib/openzfs/tests/zfs-tests/tests/functional/checksum/
H A Dfiletest_001_pos.ksh88 cksum=$(zpool status -P -v $TESTPOOL | awk -v v="$firstvdev" '$0 ~ v {print $5}')
89 log_assert "Normal file write test saw $cksum checksum errors"
90 log_must [ $cksum -eq 0 ]
108 cksum=$(zpool status -P -v $TESTPOOL | awk -v v="$firstvdev" '$0 ~ v {print $5}')
110 log_assert "Checksum '$type' caught $cksum checksum errors"
111 log_must [ $cksum -ne 0 ]
H A Dfiletest_002_pos.ksh81 cksum=$(zpool status -P -v $TESTPOOL | grep "$firstvdev" | \
84 log_assert "Checksum '$type' caught $cksum checksum errors"
85 log_must [ $cksum -ne 0 ]
/freebsd/sys/contrib/openzfs/module/zfs/
H A Dzio_checksum.c209 zio_checksum_to_feature(enum zio_checksum cksum) in zio_checksum_to_feature() argument
211 VERIFY((cksum & ~ZIO_CHECKSUM_MASK) == 0); in zio_checksum_to_feature()
213 switch (cksum) { in zio_checksum_to_feature()
319 zio_checksum_handle_crypt(zio_cksum_t *cksum, zio_cksum_t *saved, boolean_t xor) in zio_checksum_handle_crypt() argument
328 cksum->zc_word[0] ^= cksum->zc_word[2]; in zio_checksum_handle_crypt()
329 cksum->zc_word[1] ^= cksum->zc_word[3]; in zio_checksum_handle_crypt()
332 cksum->zc_word[2] = saved->zc_word[2]; in zio_checksum_handle_crypt()
333 cksum->zc_word[3] = saved->zc_word[3]; in zio_checksum_handle_crypt()
347 zio_cksum_t cksum, saved; in zio_checksum_compute() local
396 &cksum); in zio_checksum_compute()
[all …]
/freebsd/usr.bin/cksum/
H A DMakefile1 PROG= cksum
2 SRCS= cksum.c crc.c print.c sum1.c sum2.c crc32.c
3 LINKS= ${BINDIR}/cksum ${BINDIR}/sum
4 MLINKS= cksum.1 sum.1
/freebsd/contrib/elftoolchain/libpe/
H A Dpe_rich.c70 uint32_t cksum; in pe_rich_header_validate() local
83 cksum = pe->pe_rh_start - pe->pe_stub; in pe_rich_header_validate()
94 cksum += rol32((unsigned char) *p, off); in pe_rich_header_validate()
100 cksum += rol32(rh->rh_compid[i], rh->rh_cnt[i]); in pe_rich_header_validate()
103 if (cksum == rh->rh_xor) in pe_rich_header_validate()
/freebsd/tools/tools/commitsdb/
H A Dquery_commit_db20 my $cksum;
29 $cksum = $hash;
34 unless ($cksum) {
52 next unless $hash eq $cksum;
/freebsd/crypto/heimdal/lib/gssapi/krb5/
H A D8003.c175 const Checksum *cksum, in _gsskrb5_verify_8003_checksum() argument
186 if(cksum->cksumtype != CKSUMTYPE_GSSAPI || cksum->checksum.length < 24) { in _gsskrb5_verify_8003_checksum()
191 p = cksum->checksum.data; in _gsskrb5_verify_8003_checksum()
217 if (cksum->checksum.length > 24 && (*flags & GSS_C_DELEG_FLAG)) { in _gsskrb5_verify_8003_checksum()
218 if(cksum->checksum.length < 28) { in _gsskrb5_verify_8003_checksum()
232 if(cksum->checksum.length < 28 + fwd_data->length) { in _gsskrb5_verify_8003_checksum()
H A Dcfx.c1315 Checksum cksum; in _gssapi_wrap_cfx() local
1330 &cksum); in _gssapi_wrap_cfx()
1340 assert(cksum.checksum.length == cksumsize); in _gssapi_wrap_cfx()
1341 token->EC[0] = (cksum.checksum.length >> 8) & 0xFF; in _gssapi_wrap_cfx()
1342 token->EC[1] = (cksum.checksum.length >> 0) & 0xFF; in _gssapi_wrap_cfx()
1349 cksum.checksum.data, cksum.checksum.length); in _gssapi_wrap_cfx()
1352 input_message_buffer->length + cksum.checksum.length, rrc, FALSE); in _gssapi_wrap_cfx()
1356 free_Checksum(&cksum); in _gssapi_wrap_cfx()
1359 free_Checksum(&cksum); in _gssapi_wrap_cfx()
1507 Checksum cksum; in _gssapi_unwrap_cfx() local
[all …]
/freebsd/tests/sys/netinet/
H A Dip_reass_test.c62 uint32_t cksum; in update_cksum() local
67 for (cksum = 0, i = 0; i < sizeof(*ip) / sizeof(*cksump); cksump++, i++) in update_cksum()
68 cksum += ntohs(*cksump); in update_cksum()
69 cksum = (cksum >> 16) + (cksum & 0xffff); in update_cksum()
70 cksum = ~(cksum + (cksum >> 16)); in update_cksum()
71 ip->ip_sum = htons((uint16_t)cksum); in update_cksum()
/freebsd/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/
H A Dsend_encrypted_props.ksh79 typeset cksum=$(xxh128digest /$TESTPOOL/ds/$TESTFILE0)
133 log_must test "$recv_cksum" == "$cksum"
157 log_must test "$recv_cksum" == "$cksum"
175 log_must test "$recv_cksum" == "$cksum"
189 log_must test "$recv_cksum" == "$cksum"
203 log_must test "$recv_cksum" == "$cksum"
217 log_must test "$recv_cksum" == "$cksum"
/freebsd/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/
H A Dzfs_receive_corrective.ksh75 typeset cksum=$(xxh128digest $file)
76 [[ "$cksum" == "$checksum" ]] || \
77 log_fail "Checksums differ ($cksum != $checksum)"
180 typeset cksum=$(xxh128digest $file)
181 [[ "$cksum" == "$checksum" ]] || \
182 log_fail "Checksums differ ($cksum != $checksum)"
/freebsd/sys/netinet/libalias/
H A Dalias_util.c152 DifferentialChecksum(u_short *cksum, void *newp, void *oldp, int n) in DifferentialChecksum() argument
159 accumulate = *cksum; in DifferentialChecksum()
169 *cksum = (u_short)~accumulate; in DifferentialChecksum()
173 *cksum = (u_short)accumulate; in DifferentialChecksum()
/freebsd/contrib/tcpdump/
H A Dprint-vrrp.c149 uint16_t cksum; in vrrp_print() local
152 cksum = nextproto4_cksum(ndo, (const struct ip *)bp2, bp, in vrrp_print()
155 cksum = nextproto6_cksum(ndo, (const struct ip6_hdr *)bp2, bp, in vrrp_print()
157 if (cksum) in vrrp_print()
/freebsd/contrib/libarchive/libarchive/
H A Darchive_read_support_filter_lzop.c368 uint32_t cksum; in lzop_filter_read() local
420 cksum = crc32(crc32(0, NULL, 0), b, state->compressed_size); in lzop_filter_read()
422 cksum = adler32(adler32(0, NULL, 0), b, state->compressed_size); in lzop_filter_read()
424 cksum = state->compressed_cksum; in lzop_filter_read()
425 if (cksum != state->compressed_cksum) { in lzop_filter_read()
466 cksum = crc32(crc32(0, NULL, 0), state->out_block, in lzop_filter_read()
469 cksum = adler32(adler32(0, NULL, 0), state->out_block, in lzop_filter_read()
472 cksum = state->uncompressed_cksum; in lzop_filter_read()
473 if (cksum != state->uncompressed_cksum) { in lzop_filter_read()
/freebsd/usr.sbin/makefs/zfs/
H A Dvdev.c49 uint64_t fill, enum zio_checksum cksumt, zio_cksum_t *cksum) in blkptr_set() argument
70 memcpy(&bp->blk_cksum, cksum, sizeof(*cksum)); in blkptr_set()
116 zio_cksum_t cksum; in vdev_pwrite_data() local
120 fletcher_4_native(data, sz, NULL, &cksum); in vdev_pwrite_data()
121 blkptr_set(bp, loc, sz, datatype, level, fill, cksumtype, &cksum); in vdev_pwrite_data()
147 zio_cksum_t cksum; in vdev_label_set_checksum() local
155 zio_checksum_SHA256(buf, size, NULL, &cksum); in vdev_label_set_checksum()
156 eck->zec_cksum = cksum; in vdev_label_set_checksum()
/freebsd/usr.sbin/uefisign/
H A Dpe.c314 uint32_t cksum = 0; in compute_checksum() local
334 cksum += tmp; in compute_checksum()
335 cksum += cksum >> 16; in compute_checksum()
336 cksum &= 0xffff; in compute_checksum()
339 cksum += cksum >> 16; in compute_checksum()
340 cksum &= 0xffff; in compute_checksum()
342 cksum += x->x_len; in compute_checksum()
344 return (cksum); in compute_checksum()

123456