• This repository has been archived on 20/Jan/2022
  • Stars
    star
    70
  • Rank 447,840 (Top 9 %)
  • Language
    Erlang
  • License
    Other
  • Created over 14 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

sfmt-erlang: SIMD-oriented Fast Mersenne Twister (SFMT) for Erlang

sfmt-erlang: SIMD-oriented Fast Mersenne Twister (SFMT) for Erlang

This software is no longer maintained

CAUTION: this software is no longer maintained. Migrate to the default rand module for OTP 18 and later because they are well-supported and use faster and better algorithms.

Version and credit information

  • Version 0.14.0 15-MAY-2021
  • Edited and written by Kenji Rikitake (Kenji Rikitake Professional Engineer's Office)
  • Email contact: [email protected]

Build and test commands

  • Building: rebar3 compile
  • C NIF Documentation: doxygen (requires Doxygen 1.9.1 or later)
  • Erlang Documentation: rebar3 edoc
  • Testing: rebar3 ct
  • Execution speed benchmark: execute rebar3 shell and run sfmt_tests:test_speed() and sfmt_pure_tests:test_speed()
  • Cleaning up: rebar3 clean

Use rebar3 to build since 0.14.0

  • Since 14.0, erlang.mk and mix.exs are removed. Use rebar3 to build.

Use 0.13.2 and later for OTP 23

  • erlang.mk is updated to stop using -lerl_interface. This is required for a successful build in OTP 23.

Security notice regarding the PHP mt_seed() vulnerability

Ambionics Security published an internal state retrieval algorithm of PHP mt_rand() on 6-JAN-2020. sfmt-erlang uses the same seed-to-internal-state initialization algorithm at the function init_gen_rand/1.

For reducting the possibility of the internal state revelation, use init_by_list32/1 instead, better combined with rand:uniform/1. Raimo Niskanen published a piece of code for this purpose.

Note well that sfmt-erlang has no cryptographic security guarantee and MUST NOT be used for security purposes such as password generation.

Also: Version 0.13.0 and 0.13.1 Erlang and C code files are identical. Users have no need to upgrade.

Thanks to Shiro Kawai for the notification of the seed initialization algorithm issue.

License

Copyright (c) 2010-2021 Kenji Rikitake and Kyoto University. All rights reserved.

Copyright (c) 2006,2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima University. All rights reserved.

See the file LICENSE for the license (new/simplified BSD license).

Details of SFMT algorithm

This software is based on SFMT ver. 1.3.3 (SIMD oriented Fast Mersenne Twister(SFMT)) by Mutsuo Saito (Hiroshima University) and Makoto Matsumoto (Hiroshima University). See http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html for the further details.

Note well: only (2^19937 - 1) period is supported.

Available modules

  • module sfmt: SFMT with C NIFs
  • module sfmt_pure: SFMT with pure Erlang
  • See CHANGES.md for the detail of miscellaneous changes

C NIFs

  • Compiler requirement: C99 support (modern Clang and gcc will do): <inttypes.h> required
  • See c_src/sfmt_nif.c for the details
  • Also refer to sfmt-extstate at http://github.com/jj1bdx/sfmt-extstate
  • The version number of this NIF is 101 (see NIF_LOAD_INFO macro value)

Tested platforms

  • macOS 10.15.7 with Erlang/OTP 24.0
  • Ubuntu 20.10 with Erlang/OTP 24.0
  • sfmt-erlang will work with older OTP versions

hex.pm support

  • hex is supported through rebar3_hex plugin
  • NIF building errors fixed (0.12.7 and later)
  • Package name: sfmt
  • Note: all builds including C and Erlang source compilation are done with rebar3

API compatible with the rand module

seed/3, uniform/0, uniform/1, uniform_s/1, uniform_s/3 

On HiPE usage

  • HiPE is removed from OTP 24, no longer configured
  • sfmt module is NIFnized so does not coexist with HiPE
  • On the other hand, sfmt_pure module can be compiled with HiPE or +native "+{hipe, [o3]}" erlc compile option, which will result in 40% to 100% speedup on 64-bit machines

TODO

  • No more new feature; more load testing needed
  • More documentation
  • Code upgrading/reloading behavior check

Code authors:

  • Kenji Rikitake
  • Mutsuo Saito
  • Makoto Matsumoto
  • Dan Gudmundsson
  • Michael Truog
  • Michael Chmielewski
  • David Whitlock
  • Pierre Fenoll

THANKS to:

  • Dave "dizzyd" Smith
  • Tuncer Ayaz
  • Tim Bates (random_mt.erl implementator of Mersenne Twister)
  • Richard O'Keefe
  • Yurii Rashkovskii
  • Kostis Sagonas
  • Michael Gebetsroither
  • Shunichi Shinohara
  • Loïc Hoguin
  • @timCF of GitHub
  • Shiro Kawai

ACKNOWLEDGMENTS

During the compatibility test of this software, Kenji Rikitake used the supercomputer service provided by Academic Center for Computing and Media Studies (ACCMS), Kyoto University.

Erlang Solutions kindly gave Kenji Rikitake an opportunity to give a presentation about this software at Erlang Factory SF Bay 2011.

Pepabo R&D Institute of GMO Pepabo, Inc. kindly gives the financial support for this project.

More Repositories

1

airspy-fmradion

Software decoder for FM/AM broadcast radio with AirSpy R2 / Mini, Airspy HF+, and RTL-SDR
C++
137
star
2

sshrpc

Erlang SSH RPC module (experimental)
Erlang
39
star
3

tinymt-erlang

This software is no longer maintained. For archive/reference use only. -- Tiny Mersenne Twister (TinyMT) for Erlang
Erlang
26
star
4

erltrek

An Erlang Star Trek game
Erlang
16
star
5

arduino-atmega16u2

Arduino ATmega16U2 USB chip firmware for DFU and USB Serial
C
11
star
6

macos-audio-streaming-tips

macOS to Linux audio streaming tips including PyAudio, PortAudio, gstreamer, ffmpeg
Python
11
star
7

dbskkd-cdb

SKK dictionary server based on cdb
C
11
star
8

avrhwrng

Hardware Random Number Generator with Arduino
C
10
star
9

emprng

Erlang/OTP rand module prototype repository until OTP 20 (for reference use only) - multiple PRNG suite
Erlang
9
star
10

rtl_power-fm-multipath

FM broadcasting multipath distortion estimation by D/U ratio measurement with rtl_power
Python
9
star
11

bsdtrek

BSD Star Trek game
C
8
star
12

exs64

Xorshift64star for Erlang
Erlang
7
star
13

WWV

WWV/WWVH emulator. Full format including 100 Hz timecode. Speech by local OS's synthesizer; OSX is best (originally forked from ka9q/WWV, but the original is gone)
C
7
star
14

nsplit

Erlang mapping function library splitting a job to n-process concurrent execution
Erlang
7
star
15

v6hex

IPv6 hex address library for Erlang
Erlang
6
star
16

neug

An unofficial clone of FST NeuG
C
6
star
17

ent

ENT - A Pseudorandom Number Sequence Test Program
C
6
star
18

freebsd-dev-trng

An entropy injection device driver for FreeBSD
C
6
star
19

wspr

WSPR for Lubuntu/Ubuntu
Python
6
star
20

xorshiftplus-c

Xorshift*/Xorshift+ public domain C code archive
C
6
star
21

ads-b-analysis

dump1090 data analysis scripts in Python and Geographiclib
Python
5
star
22

wspr-cui

WSPR command-line tools
C
5
star
23

chopstx

STM32F0 / STM32F103 thread library chopstx: unofficial private clone
C
5
star
24

sd-erlang-public

Software Design誌連載「Erlangで学ぶ並行プログラミング」のサポートページ
Erlang
5
star
25

plug_static_ls

Serving directory Index for Plug/Phoenix Static Assets
Elixir
5
star
26

bearfort

Project Bearfort repository for Erlang Factory SF Bay 2016
C
4
star
27

exsplus128

Xorshift128plus for Erlang
Erlang
4
star
28

xorshiftplus

Archive of Sebastiano Vigna's xorshift+ and xorshift*
C
4
star
29

infnoise-windows

Infinity Noise TRNG Program for Windows and Visual Studio
C
4
star
30

exs1024

Xorshift1024star for Erlang
Erlang
4
star
31

apresse

APRS software for Erlang and Elixir (for Code BEAM STO 2018)
JavaScript
4
star
32

sfmt-extstate

SIMD-oriented Fast Mersenne Twister code, rewritten to handle internal state table explicitly
C
4
star
33

dump1090-airspy-experimental

Dump1090 is a Mode S decoder for Software Defined Radio (SDR) devices including RTL-SDR and Airspy.
C
4
star
34

TinyMT

Tiny Mersenne Twister original code with TinyMT-Jump
C++
4
star
35

soxr-code

Sox Resampling Library (forked)
C
4
star
36

tinymtdc-longbatch

TinyMT pre-calculated parameter list. See https://zenodo.org/record/5834954 for an alternative archive.
Shell
4
star
37

openbox-clearlooks-solarized

Solarized-colored Clearlooks Theme for Openbox
3
star
38

FourQlib

unofficial clone of Microsoft FourQlib
C
3
star
39

dot-kerlrc

Configuration files for kerl
Shell
3
star
40

erlang-freebsd-port

Tentative private FreeBSD Erlang Port for 18.2
Makefile
3
star
41

sudoku-erlang

Sudoku solver in Erlang
Erlang
3
star
42

infnoise-freebsd

Infinity Noise TRNG Program for FreeBSD
C
3
star
43

avrdice

Arduino Uno R3 C++ code showing random dice number sequence
C++
3
star
44

plug_url_redirector

URL redirector for Plug/Phoenix
Elixir
2
star
45

luatrek

Star Trek in Lua
Lua
2
star
46

cmoy-bdx

Chu Moy headphone amplifier schematics and etc.
2
star
47

sphinxconjp2014-examples

LaTeX documentation example for SphinxCon JP 2014
Python
2
star
48

bash-3.2-osx-fix

OS X bash-3.2 fix (with import-functions patch)
C
2
star
49

fraucheky

GNU GPL container for embedded devices
C
2
star
50

cowboy_beam_status

An Erlang Cowboy example program
Erlang
2
star
51

freebsd-gnu-libiconv-hack

This port is for FreeBSD 10 only. Not applicable for FreeBSD 11. -- GNU libiconv LD_PRELOAD hack for solving possible i18n/m17n problems in FreeBSD 10 and later
Shell
2
star
52

tew

This archive is no longer maintained - Tokyo Erlang Workshop public repository for Kenji Rikitake
1
star
53

dj1yfk-dxcc

DJ1YFK's DXCC Lookup Utility (forked)
Perl
1
star
54

tqsllib-freebsd-port

FreeBSD port for tqsllib (now WITHOUT GUI tqsl/tqslcert)
C++
1
star
55

indexme

links files into an HTML index for viewing and easy overview
Perl
1
star
56

kichijoji.pm-19

Kichijoji.pm 19 presentation, 2-AUG-2019
XS
1
star
57

efsfbay2015-slides

Erlang Factory SF Bay 2015 slides
1
star
58

infnoise-linux

Infinity Noise TRNG Program for Linux
C
1
star
59

sphinx-latex-table-test

Sphinx LaTeX multirow and multicolumn table creation bug example
TeX
1
star
60

emacs-gift-generic-mode

Emacs Moodle GIFT file format Generic Mode
Emacs Lisp
1
star
61

oueees-201606-public

Slides and figures of my talks on computer networks and information security, at Osaka University, {14, 21, 28} -JUN-2016
1
star
62

euc2016-erlang-prng

Erlang User Conference 2016 presentation source for "Fifteen Ways to Leave Your Random Module"
1
star
63

oueees-201706-public

Slides and figures of my talks on computer networks and information security, at Osaka University, {13, 20, 27} -JUN-2017
1
star
64

avr_md5

AVR/Arduino ATmega168/328 (Arduino Uno compatible) MD5 optimized assembly implementation
C
1
star
65

ipsj-tokai-20121029-public

Slides and figures of my talk on Erlang/OTP and Information Security, at Nagoya University, 29-OCT-2012
1
star
66

erlang-elixir-color-logo

Erlang and Elixir Color Logo. Licensed CC BY-NC-SA
1
star
67

adif_io

ADIF parsing library for Python (forked from Gitlab)
Python
1
star
68

oueees-202106-public

Slides and figures of my talks on computer networks and information security, at Osaka University, June 2021
1
star
69

poudriere_elixir_web

Web server for viewing Poudriere results
Elixir
1
star
70

sd_ep06_eqc

A QuickCheck-CI example for sd-erlang episode 6
Erlang
1
star
71

goadiftools

Go tools for amateur radio ADIF files
Go
1
star
72

gonnet-math-accuracy

Error analysis of system mathematical functions, by Gaston H. Gonnet, ETH, Informatik
C
1
star
73

hamsci-202012-freqdata

HamSCI December 2020 Eclipse Festival of Frequency Measurement result at the radio station JJ1BDX
R
1
star
74

gossn

Solar activity data retriever
Go
1
star
75

writing-otp-modules

Repository for "Writing A New Erlang/OTP Module for Beginners" (Erlang and Elixir Factory SF Bay Area 2017)
HTML
1
star
76

ctydat-entitycode

Conversion tables between CTY.DAT Main Prefixes and ARRL DXCC Entity Codes
Raku
1
star