Documentation ¶
Index ¶
- func CalculateNumRowsAndColumns(numBlocks int, matrix bool) (numRows, numColumns int)
- func CommitScalarToIndex(x group.Scalar, j uint64, g group.Group) group.Element
- func Digest(db *LWE, rows int) *matrix.Matrix
- func Digest128(db *LWE128, rows int) *matrix.Matrix128
- func HashIndexToGroup(j uint64, g group.Group) group.Element
- func HashToIndex(id string, length int) uint32
- func MarshalGroupElements(q []group.Element, marshalledLen int) ([]byte, error)
- func PadBlock(block []byte, blockLen int) []byte
- func PadWithSignalByte(block []byte) []byte
- func UnPadBlock(block []byte) []byte
- func UnmarshalGroupElements(q []byte, g group.Group, elemSize int) ([]group.Element, error)
- type Auth
- type Bytes
- func CreateRandomBytes(rnd io.Reader, dbLen, numRows, blockLen int) *Bytes
- func CreateRandomMerkle(rnd io.Reader, dbLen, numRows, blockLen int) *Bytes
- func CreateZeroBytes(numRows, numColumns, blockLen int) *Bytes
- func GenerateRealKeyBytes(dataPaths []string, rebalanced bool) (*Bytes, error)
- func GenerateRealKeyMerkle(dataPaths []string, rebalanced bool) (*Bytes, error)
- func InitBytes(numRows, numColumns, blockLen int) *Bytes
- type DB
- type Elliptic
- type Info
- type KeyInfo
- type LWE
- type LWE128
- type Merkle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitScalarToIndex ¶
Raise the group element obtained via index hashing to the scalar
func HashIndexToGroup ¶
Take the indices (j, l) and hash them to get a group element
func HashToIndex ¶
HashToIndex hashes the given id to an index for a database of the given length
func MarshalGroupElements ¶
Marshal a slice of group elements
func PadBlock ¶
Simple ISO/IEC 7816-4 padding where 0x80 is appended to the block, then zeros to make up to blockLen
func PadWithSignalByte ¶
func UnPadBlock ¶
Types ¶
type Auth ¶
type Auth struct { DigestLWE *matrix.Matrix DigestLWE128 *matrix.Matrix128 // The global digest that is a hash of all the row digests. Public. Digest []byte // One digest per row, authenticating all the elements in that row. // also used in the integrity amplification scheme to store // all the digests SubDigests []byte // length in bytes of the subdiget SubDigestLength int // ECC group and hash algorithm used for digest computation and PIR itself Group group.Group Hash crypto.Hash // Due to lack of the size functions in the lib API, we store it in the db info ElementSize int ScalarSize int }
Auth is authentication information for the single-server setting
type Bytes ¶
func CreateRandomBytes ¶
CreateRandomBytes return a random bytes database. blockLen must be the number of bytes in a block, as a byte is the element
func CreateRandomMerkle ¶
CreateRandomMerkle blockLen is the number of byte in a block, as byte is viewed as an element in this case
func CreateZeroBytes ¶
CreateBitBytes return a random bytes database. blockLen must be the number of bytes in a block, as a byte is the element
func GenerateRealKeyBytes ¶
func GenerateRealKeyMerkle ¶
type KeyInfo ¶
type KeyInfo struct { UserId *packet.UserId CreationTime time.Time PubKeyAlgo packet.PublicKeyAlgorithm BitLength uint16 }
func GetKeyInfoFromPacket ¶
GetKeyInfoFromPacket parses packet bytes and returns information about the key
type LWE128 ¶
type LWE128 struct { Matrix *matrix.MatrixBytes Info }