/* * netsniff-ng - the packet sniffing beast * Copyright 2011 - 2013 Daniel Borkmann. * Subject to the GPL, version 2. */ #ifndef CURVE_H #define CURVE_H #include #include #include "locking.h" #include "built_in.h" #include "ioops.h" #include "rnd.h" #include "taia.h" #include "crypto.h" static struct taia tolerance_taia = { .sec.x = 0, .nano = 700000000ULL, .atto = 0, }; struct curve25519_proto { unsigned char enonce[crypto_box_noncebytes] __aligned_16; unsigned char dnonce[crypto_box_noncebytes] __aligned_16; unsigned char key[crypto_box_noncebytes] __aligned_16; }; struct curve25519_struct { unsigned char *enc_buf; unsigned char *dec_buf; size_t enc_buf_size; size_t dec_buf_size; struct spinlock enc_lock; struct spinlock dec_lock; }; extern void curve25519_selftest(void); extern void curve25519_alloc_or_maybe_die(struct curve25519_struct *curve); extern void curve25519_free(void *curve); extern int curve25519_pubkey_hexparse_32(unsigned char *bin, size_t blen, const char *ascii, size_t alen); extern int curve25519_proto_init(struct curve25519_proto *proto, unsigned char *pubkey_remote, size_t len, char *home, int server); extern ssize_t curve25519_encode(struct curve25519_struct *curve, struct curve25519_proto *proto, unsigned char *plaintext, size_t size, unsigned char **chipertext); extern ssize_t curve25519_decode(struct curve25519_struct *curve, struct curve25519_proto *proto, unsigned char *chipertext, size_t size, unsigned char **plaintext, struct taia *arrival_taia); static inline int is_good_taia(struct taia *arrival_taia, struct taia *packet_taia) { int is_ts_good = 0; struct taia sub_res; if (taia_less(arrival_taia, packet_taia)) { taia_sub(&sub_res, packet_taia, arrival_taia); if (taia_less(&sub_res, &tolerance_taia)) is_ts_good = 1; else is_ts_good = 0; } else { taia_sub(&sub_res, arrival_taia, packet_taia); if (taia_less(&sub_res, &tolerance_taia)) is_ts_good = 1; else is_ts_good = 0; } return is_ts_good; } #endif /* CURVE_H */ inux/net-next.git/commit/include/math-emu/op-2.h?h=nds-private-remove&id=83280e90ef001f77a64e2ce59c25ab66e47ab1f0'>commitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-08 11:42:04 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-08 11:42:04 -0800
commit83280e90ef001f77a64e2ce59c25ab66e47ab1f0 (patch)
treeec0a5842e2fbc0f4abaff55299acac397b8da5c3 /include/math-emu/op-2.h
parentcc250e267bd56c531b0bee455fc724d50af83fac (diff)
parent0a8fd1346254974c3a852338508e4a4cddbb35f1 (diff)
Merge tag 'usb-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are a bunch of USB fixes for 4.10-rc3. Yeah, it's a lot, an artifact of the holiday break I think. Lots of gadget and the usual XHCI fixups for reported issues (one day that driver will calm down...) Also included are a bunch of usb-serial driver fixes, and for good measure, a number of much-reported MUSB driver issues have finally been resolved. All of these have been in linux-next with no reported issues" * tag 'usb-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (72 commits) USB: fix problems with duplicate endpoint addresses usb: ohci-at91: use descriptor-based gpio APIs correctly usb: storage: unusual_uas: Add JMicron JMS56x to unusual device usb: hub: Move hub_port_disable() to fix warning if PM is disabled usb: musb: blackfin: add bfin_fifo_offset in bfin_ops usb: musb: fix compilation warning on unused function usb: musb: Fix trying to free already-free IRQ 4 usb: musb: dsps: implement clear_ep_rxintr() callback usb: musb: core: add clear_ep_rxintr() to musb_platform_ops USB: serial: ti_usb_3410_5052: fix NULL-deref at open USB: serial: spcp8x5: fix NULL-deref at open USB: serial: quatech2: fix sleep-while-atomic in close USB: serial: pl2303: fix NULL-deref at open USB: serial: oti6858: fix NULL-deref at open USB: serial: omninet: fix NULL-derefs at open and disconnect USB: serial: mos7840: fix misleading interrupt-URB comment USB: serial: mos7840: remove unused write URB USB: serial: mos7840: fix NULL-deref at open USB: serial: mos7720: remove obsolete port initialisation USB: serial: mos7720: fix parallel probe ...
Diffstat (limited to 'include/math-emu/op-2.h')