package
0.0.0-20240920015501-4d0a1e4e5de4
Repository: https://github.com/cloudflare/opaque-core.git
Documentation: pkg.go.dev
# Functions
DecryptCredentials decrypts the encrypted envelope.
EncryptCredentials encrypts the given Credentials under a key derived from rwd, the randomized password.
GetTestUserRecord returns a new test user record for the given domain, username and password.
GetTestUserRecords returns numRecords dummy user records with unique usernames and passwords: (user1, password1),...,(userN,...,passwordN).
NewAuthenticatedOneTimePad returns a new AOTP cipher initialized with the given key and nonce.
NewClient returns a new OPAQUE client.
NewInMemoryUserRecordTable returns a new empty in-memory user record table.
NewServer returns a new OPAQUE server with the RECOMMENDED credential encoding policy.
NewServerConfig returns a ServerConfig struct containing a fresh signing key and an empty lookup table.
NewTestServerConfig returns a ServerConfig struct containing a test record table of the desired size, with dummy usernames and user records, and a function to get a user record from a username.
ProtocolMessageFromBody reconstructs a ProtocolMessage from its body.
RunLocalOPRF returns the randomized password for the given server, username and password.
TestMarshalUnmarshal is a test helper that errors if Marshal/Unmarshal for the type of data and empty is not working.
UnmarshalCredentialRequestJSON decodes to a CredentialRequest.
UnmarshalCredentialResponseJSON decodes to a CredentialResponse.
UnmarshalRegistrationRequestJSON decodes to a RegistrationRequest.
UnmarshalRegistrationResponseJSON decodes to a RegistrationResponse.
UnmarshalRegistrationUploadJSON decodes to a RegistrationRequest.
# Constants
Credential types.
Credential types.
Credential types.
Credential types.
Credential types.
OPAQUE protocol message types.
OPAQUE protocol message types.
OPAQUE protocol message types.
OPAQUE protocol message types.
OPAQUE protocol message types.
# Variables
ProtocolMessageTypeToStringMap maps the Protocol Message Type to its string equivalent.
# Structs
AuthenticatedOneTimePad is a cipher for encrypting/decrypting OPAQUE credentials.
Client holds state for the client role in OPAQUE.
CredentialEncodingPolicy indicates which user credentials are stored, and whether they are held encrypted or in cleartext.
A CredentialExtension is a piece of data that may be included in client Credentials.
A CredentialRequest is the first message sent by the client to initiate OPAQUE.
A CredentialResponse is the message sent by the server in response to the Client's initial OPAQUE message.
Credentials holds the decrypted user-specific envelope contents.
Envelope is the data encrypted under the randomized password which is stored encrypted and sent to to the user.
A ProtocolMessage is a bundle containing all OPAQUE data sent in a flow between parties (during registration or login).
RegistrationRequest is the first message sent by the client to register a new OPAQUE identity with that server
struct { opaque id<0..2^16-1>; opaque data<1..2^16-1>; } RegistrationRequest;
2 2 | userIDLen | userID | oprfDataLen | oprfData |.
RegistrationResponse is the first message sent by the Server in response to the client's registration request.
RegistrationUpload is the second and final message sent by the client to register a new identity with a server.
Server holds state for an instance of the server role in OPAQUE.
ServerConfig holds long term state for the server.
UserRecord holds the data stored by the server about the user.
# Interfaces
ProtocolMessageBody is an interface implemented by all protocol messages.
UserRecordTable is an interface for password storage and lookup.
# Type aliases
CredentialExtensionList is a list of credential extensions.
CredentialType indicates the type of an OPAQUE credential extension struct.
InMemoryUserRecordTable is a map from usernames to user records to mimic a database.
ProtocolMessageType indicates the OPAQUE protocol message type
enum { registration_request(1), registration_response(2), registration_upload(3), credential_request(4), credential_response(5), (255) } ProtocolMessageType;.