GNUnet  0.18.1
gnunet-chk.AESKey Class Reference
Inheritance diagram for gnunet-chk.AESKey:
[legend]
Collaboration diagram for gnunet-chk.AESKey:
[legend]

Public Member Functions

def __init__ (self, passphrase)
 

Static Public Attributes

 key = None
 
 iv = None
 
 cipher = None
 
int KEY_SIZE = 32
 
 IV_SIZE = AES.block_size
 

Detailed Description

Class for AES Keys. Contains the main key and the initialization
vector. 

Definition at line 92 of file gnunet-chk.py.

Constructor & Destructor Documentation

◆ __init__()

def gnunet-chk.AESKey.__init__ (   self,
  passphrase 
)
Creates a new AES key.

passphrase: string containing the passphrase to get the AES key and
initialization vector

Definition at line 102 of file gnunet-chk.py.

102  def __init__(self, passphrase):
103  """Creates a new AES key.
104 
105  passphrase: string containing the passphrase to get the AES key and
106  initialization vector
107  """
108  passphrase = bytearray(passphrase)
109  self.key = bytearray(self.KEY_SIZE)
110  self.iv = bytearray(self.IV_SIZE)
111  if (len(passphrase) > self.KEY_SIZE):
112  self.key = passphrase[:self.KEY_SIZE]
113  passphrase = passphrase[self.KEY_SIZE:]
114  if (len(passphrase) > self.IV_SIZE):
115  self.iv = passphrase[:self.IV_SIZE]
116  else:
117  self.iv[0:len(passphrase)] = passphrase
118  else:
119  self.key[0:len(passphrase)] = passphrase
120  self.key = str(self.key)
121  self.iv = str(self.iv)
122  assert (len(self.key) == self.KEY_SIZE)
123  assert (len(self.iv) == self.IV_SIZE)
124 
125 
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...

References gnunet-chk.AESKey.iv, TransportDVBoxMessage.iv, gnunet-chk.AESKey.IV_SIZE, gnunet-chk.AESKey.key, gnunet-chk.Chk.key, SetEntry.key, TaskEntry.key, ReferendumEntry.key, DiffEntry.key, GetClosestContext.key, HandleResultContext.key, GetKeyMessage.key, DataMessage.key, DataRecord.key, Value.key, GNUNET_DHT_ClientGetStopMessage.key, GNUNET_DHT_ClientGetMessage.key, GNUNET_DHT_ClientGetResultSeenMessage.key, GNUNET_DHT_ClientResultMessage.key, GNUNET_DHT_ClientPutMessage.key, GNUNET_DHT_MonitorPutMessage.key, GNUNET_DHT_MonitorStartStopMessage.key, GNUNET_DHT_MonitorGetMessage.key, GNUNET_DHT_MonitorGetRespMessage.key, GNUNET_DHT_GetHandle.key, GNUNET_DHT_MonitorHandle.key, ClientMonitorRecord.key, GetActionContext.key, ClientQueryRecord.key, GetRequestContext.key, PeerPutMessage.key, PeerResultMessage.key, PeerGetMessage.key, RecentRequest.key, ContentHashKey.key, GNUNET_FS_SearchResult.key, ProxyCA.key, ProxyGNSCertificate.key, KeyCacheLine.key, RegexAcceptBlock.key, GNUNET_CRYPTO_AuthKey.key, GNUNET_DATACACHE_Block.key, GNUNET_MESSENGER_MessageJoin.key, GNUNET_MESSENGER_MessageKey.key, GNUNET_MESSENGER_MessageInvite.key, GNUNET_MESSENGER_MessageFile.key, GNUNET_MESSENGER_MessagePrivate.key, GNUNET_MESSENGER_MessageBody.key, GNUNET_MESSENGER_RoomEntryRecord.key, GNUNET_PEERSTORE_Record.key, GNUNET_SCALARPRODUCT_Element.key, GNUNET_UriParam.key, GNUNET_MESSENGER_RoomMessage.key, GNUNET_MESSENGER_MemberMessage.key, GNUNET_MESSENGER_SendMessage.key, GNUNET_MESSENGER_GetMessage.key, GNUNET_MESSENGER_RecvMessage.key, GNUNET_MESSENGER_SrvRoom.key, GNUNET_MESSENGER_Room.key, RequestData.key, MarkedRecord.key, Zone.key, GNUNET_PEERSTORE_StoreContext.key, GNUNET_PEERSTORE_IterateContext.key, MpiElement.key, GNUNET_SCALARPRODUCT_ComputationHandle.key, GNUNET_TESTBED_Barrier.key, Plugin.key, ConfigEntry.key, BigMapEntry.key, SmallMapEntry.key, MapEntry.key, DestinationEntry.key, gnunet-chk.AESKey.KEY_SIZE, and len.

Field Documentation

◆ key

gnunet-chk.AESKey.key = None
static

◆ iv

gnunet-chk.AESKey.iv = None
static

Definition at line 97 of file gnunet-chk.py.

Referenced by gnunet-chk.AESKey.__init__().

◆ cipher

gnunet-chk.AESKey.cipher = None
static

Definition at line 98 of file gnunet-chk.py.

◆ KEY_SIZE

int gnunet-chk.AESKey.KEY_SIZE = 32
static

Definition at line 99 of file gnunet-chk.py.

Referenced by gnunet-chk.AESKey.__init__().

◆ IV_SIZE

gnunet-chk.AESKey.IV_SIZE = AES.block_size
static

Definition at line 100 of file gnunet-chk.py.

Referenced by gnunet-chk.AESKey.__init__().


The documentation for this class was generated from the following file: