storj/pkg/encryption/password_test.go
Jeff Wendling 81f1bc19dc add functions for password/root key derivation (#2294)
This commit adds two functions that implement the algorithms
described in the password key derivation design document. They
will be used during setup to derive bucket level root keys or
default passwords to use when buckets do not have their own
independent key.

Change-Id: Ie7fb2d8d549ba7465d0722716a2c1ac0ad907286
2019-06-21 18:21:16 -04:00

25 lines
621 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package encryption
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestDeriveRootKey(t *testing.T) {
// ensure that we can derive with no errors
_, err := DeriveRootKey([]byte("password"), []byte("salt"), "")
assert.NoError(t, err)
_, err = DeriveRootKey([]byte("password"), []byte("salt"), "any/path")
assert.NoError(t, err)
}
func TestDeriveDefaultPassword(t *testing.T) {
// ensure that we can derive with no errors
_, err := DeriveDefaultPassword([]byte("password"), []byte("salt"))
assert.NoError(t, err)
}