Skip to content

Instantly share code, notes, and snippets.

View seb-m's full-sized avatar

Sébastien Martini seb-m

View GitHub Profile
--- a/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c
+++ b/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c
@@ -5,6 +5,20 @@
#include "portable-jane.h"
+static uint32_t INLINE fU8TO32_LE_SLOW(const uint8_t *p) {
+ return (((uint32_t)(p[0]) ) |
+ ((uint32_t)(p[1]) << 8) |
+ ((uint32_t)(p[2]) << 16) |
@seb-m
seb-m / gist:2119404
Created March 19, 2012 17:03
Pyinotify's output
mkdir -p /tmp/base; mkdir -p /tmp/base/d1; mkdir -p /tmp/base/d2; touch /tmp/base/d1/foo; mv /tmp/base/d1 /tmp/base/d2; rm -f /tmp/base/d2/d1/foo;
ookoi@mysterion:~$ python -m pyinotify -v -a -r /tmp
[2012-03-19 18:24:03,916 pyinotify DEBUG] Event queue size: 32
[2012-03-19 18:24:03,916 pyinotify DEBUG] <_RawEvent cookie=0 mask=0x40000100 name=base wd=1 >
[2012-03-19 18:24:03,917 pyinotify DEBUG] New <Watch wd=3 path=/tmp/base mask=4095 proc_fun=None auto_add=True exclude_filter=<function <lambda> at 0x87a164c> dir=True >
<Event dir=True mask=0x40000100 maskname=IN_CREATE|IN_ISDIR name=base path=/tmp pathname=/tmp/base wd=1 >
[2012-03-19 18:24:03,918 pyinotify DEBUG] Event queue size: 96
[2012-03-19 18:24:03,919 pyinotify DEBUG] <_RawEvent cookie=0 mask=0x40000020 name=base wd=1 >
[2012-03-19 18:24:03,919 pyinotify DEBUG] <_RawEvent cookie=0 mask=0x40000020 name='' wd=3 >
@seb-m
seb-m / xpathquery_leak.patch
Created September 26, 2011 20:24
XPathQuery leak
--- /Volumes/Sam500/Download/XPathQuery.m 2011-09-26 22:17:18.000000000 +0200
+++ Hpple/XPathQuery.m 2011-09-26 22:14:07.000000000 +0200
@@ -121,6 +121,7 @@
xpathObj = xmlXPathEvalExpression((xmlChar *)[query cStringUsingEncoding:NSUTF8StringEncoding], xpathCtx);
if(xpathObj == NULL) {
NSLog(@"Unable to evaluate XPath.");
+ xmlXPathFreeContext(xpathCtx);
return nil;
}
@seb-m
seb-m / disable_referrer.patch
Created January 30, 2011 15:12
Disable sending referrers in Chrome
---
url_request.cc | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
Index: src/net/url_request/url_request.cc
===================================================================
--- src.orig/net/url_request/url_request.cc
+++ src/net/url_request/url_request.cc
@@ -323,16 +323,7 @@
}
@seb-m
seb-m / trace.txt
Created January 23, 2011 00:19
Comparison between Python2.[4-7], Python3.1 and PyPy 1.4.1 on an Python ECDSA implementation
# These timings represent pairs of ECDSA signature/verification involving
# commons field operations.
#
# See the ECDSA example from wcurve:
# - https://github.com/seb-m/wcurve
# - https://github.com/seb-m/wcurve/blob/master/examples/ecdsa.py
#
# System: Ubuntu 10.10 32bits, intel core i7 920
#
#!/bin/sh
# Usage: ./generate_keyset.sh keyset_location
# Example: ./generate_keyset.sh /home/foobar
# Will create /home/foobar/rsa_sign and /home/foobar/rsa_sign.pub
BASE_PATH=$1
RSA_PRIV=$BASE_PATH/rsa_sign
RSA_PUB=$BASE_PATH/rsa_sign.pub