traces_database
index
/home/guilley/dpacontest/code/reference/traces_database.py

traces_database.py allows to access a PostGreSQL database through either the
# PgSQL or pgdb libraries and retrieve side-channel traces from such database.
# Copyright (C) 2008 Florent Flament (florent.flament@telecom-paristech.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

 
Modules
       
pgdb

 
Classes
       
traces_database

 
class traces_database
    Class providing database IOs
 
  Methods defined here:
__del__(self)
Automatically called method
__init__(self, table)
No arguments needed
get_trace(self)
Do not take any argument.
Returns the next triplet (message, cipher, trace), where:
 - message is an ascii string containing a 64 bits clear message in hexadecimal,
 - cipher is an ascii string containing a 64 bits ciphered message in hexadecimal,
 - trace is a float vector containing a trace during the cipher operation.

 
Functions
       
parse_binary(raw_data)
Takes a raw binary string containing data from our oscilloscope.
Returns the corresponding float vector.
test()

 
Data
        db_name = 'pgdb'