From 311644f39b3e8394298bc95580f5146aa4b8bd09 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 30 Aug 2015 17:42:52 +0200 Subject: [PATCH] PPP, PPPoS, remove magic_randomize() from PPPoS, it is already called in ppp_input() There is no point of calling magic_randomize() for each pppos_input() call, making magic_randomize() potentially called for each serial input byte which is quite a bad idea since magic_randomize() is quite intensive in processing time (MD5 computation) compared to HDLC frame parsing. There is no entropy added when being called for each input byte rather than for each valid input packet because byte input is a monotonic event at the packet level. Well, if packet arrival time is a valid entropy source even so, which I doubt a lot, but we don't really have anything else and we really need random for PPP authentication layers. --- src/netif/ppp/pppos.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index 88e30b01..dc418e9a 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -49,7 +49,6 @@ #include "netif/ppp/ppp_impl.h" #include "netif/ppp/pppos.h" -#include "netif/ppp/magic.h" #include "netif/ppp/vj.h" /* callbacks called from PPP core */ @@ -716,8 +715,6 @@ pppos_input(ppp_pcb *ppp, u8_t *s, int l) pppos->in_fcs = PPP_FCS(pppos->in_fcs, cur_char); } } /* while (l-- > 0), all bytes processed */ - - magic_randomize(); } #if PPP_INPROC_IRQ_SAFE