[client] Proper TMP renamed and commented 'SynchronisationKey()'

This commit is contained in:
xdrm-brackets 2018-04-24 18:43:20 +02:00
parent e822440581
commit e178642fea
1 changed files with 12 additions and 5 deletions

View File

@ -140,14 +140,21 @@ func (c *T) Receive(r io.Reader) error {
/* (5) TMP /* (5) Returns a synchronisation key (first server connection)
*
* @return key<[]byte> Synchronisation key
* @return err<error>
* *
---------------------------------------------------------*/ ---------------------------------------------------------*/
func (c *T) TMP() []byte { func (c *T) SynchronisationKey() ([]byte, error) {
hash, err := c.key.CurrentHash()
if err != nil { panic(err) }
/* (1) Get current hash */
hash, err := c.key.CurrentHash()
if err != nil { return nil, err }
/* (2) Decrement key so 'hash' is valid */
c.key.Decrement() c.key.Decrement()
return hash; /* (3) Return key */
return hash, nil;
} }