package
module
Version:
v0.0.0-...-6fab2fb
Opens a new window with list of versions in this module.
Published: Aug 10, 2023
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
cryptopals
Answers to the Matasano Cryptopals challenges.
Run go test ./solutions
to check all solutions.
This code is extremely unsuited for production use — don't copy from it.
Documentation
¶
Package cryptopals contains utility functions for the Cryptopals challenges.
Blocks returns consecutive subslices of b of length n, except for the final
block which may be shorter than n.
func HammingDistance(a, b []byte) int
HammingDistance returns the Hamming distance between a and b.
If len(a) != len(b), it panics.
ProbabilityIsEnglish returns the probability that b is English text.
XOR returns x ^ y.
If len(x) != len(y), it panics.
XORByte returns the result of xor'ing each byte of x with y.
XORRepeat returns x ^ y, repeating y if it's too short.
The result has length len(x).
Source Files
¶
Directories
¶
Package alias implements memory aliasing tests.
|
Package alias implements memory aliasing tests. |
|
|
Package ecb implements the electronic codebook (ECB) block cipher mode.
|
Package ecb implements the electronic codebook (ECB) block cipher mode. |
|
|
|
|
Click to show internal directories.
Click to hide internal directories.