Documentation ¶
Overview ¶
包 db 包含共用的sql操作方法
Index ¶
- func CreateCKKSKeyTable() string
- func CreateECDSAKeyTable() string
- func CreateSwitchingKeyTable() string
- func CreateTransactionTable() string
- func CreateUserTable() string
- func GetCKKSKeyByUserUUID(db *sql.DB, UserUUID uuid.UUID) (keyChain *key.CKKSKeyChain, err error)
- func GetECDSAKeyByUserUUID(db *sql.DB, UserUUID uuid.UUID) (keyChain *key.ECDSAKeyChain, err error)
- func GetSwitchingKeyPKInPKOut(db *sql.DB, pkIDIn, pkIDOut uuid.UUID) (swk *rlwe.SwitchingKey, err error)
- func GetSwitchingKeyUserIDInOut(db *sql.DB, UserIDIn, UserIDOut uuid.UUID) (swk *rlwe.SwitchingKey, err error)
- func GetTransaction(db *sql.DB, txUUID uuid.UUID) (tx *transaction.Transaction, err error)
- func GetUser(db *sql.DB, UserUUID uuid.UUID) (user *users.User, err error)
- func GetUserBalance(db *sql.DB, UserUUID uuid.UUID) (balance *rlwe.Ciphertext, err error)
- func PutCKKSPublicKeyColumn(db *sql.DB, keyID, userID uuid.UUID, pk *rlwe.PublicKey) (err error)
- func PutECDSAPublicKeyColumn(db *sql.DB, keyID, userID uuid.UUID, pk *ecdsa.PublicKey) (err error)
- func PutSwitchingKeyColumnByUserInUserOut(db *sql.DB, keyID, userIn, userOut uuid.UUID, swk *rlwe.SwitchingKey) (err error)
- func PutUserColumn(db *sql.DB, u *users.User, balance *rlwe.Ciphertext) (err error)
- func UpdateBalance(db *sql.DB, userUUID uuid.UUID, balance *rlwe.Ciphertext) (err error)
- func WriteTransaction(db *sql.DB, tx *transaction.Transaction) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSwitchingKeyTable ¶
func CreateSwitchingKeyTable() string
table SwitchingKey uuid TEXT PRIMARY KEY userIn TEXT, as FOREIGN KEY Users(uuid) userOut TEXT, as FOREIGN KEY to Users(uuid) pkIn, pkOut BLOB, as FOREIGN KEY to CKKSKeyChains(uuid) SwitchingKey BLOB
func CreateUserTable ¶
func CreateUserTable() string
table Users: uuid TEXT PRIMARY KEY, userName TEXT balance BLOB <- []byte 被 rlwe.CipherText.Marshall编码 primary{ECDSA, CKKS}Key <- uuid, TEXT
func GetCKKSKeyByUserUUID ¶
func GetECDSAKeyByUserUUID ¶
func GetTransaction ¶
func GetTransaction(db *sql.DB, txUUID uuid.UUID) (tx *transaction.Transaction, err error)
func GetUserBalance ¶
查询用户余额
func PutCKKSPublicKeyColumn ¶
PutCKKSPublicKeyColumn 创建新的CKKS公钥行
func PutECDSAPublicKeyColumn ¶
PutECDSAPublicKeyColumn 创建新的ECDSA公钥行
func PutSwitchingKeyColumnByUserInUserOut ¶
func PutSwitchingKeyColumnByUserInUserOut(db *sql.DB, keyID, userIn, userOut uuid.UUID, swk *rlwe.SwitchingKey) (err error)
PutSwitchingKeyColumnByUserInUserOut 创建新的SwitchingKey行
func PutUserColumn ¶
添加新的用户
func UpdateBalance ¶
UpdateBalance 更新数据库中用户余额
func WriteTransaction ¶
func WriteTransaction(db *sql.DB, tx *transaction.Transaction) (err error)
WriteTransaction 将交易写入/更新至数据库
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.