v / vlib / crypto / blake2b / testdata / blake2b.awk
7 lines · 7 sloc · 404 bytes · e6a30dc4efec3e8cd3eb0b12c2f21b9d1e281849
Raw
1/\[/ { print ("const vectors = [") }
2/]/ { print ("]") }
3/"hash": "blake2b"/ { print ("\tTestVector{") }
4/"in":/ { gsub(/"|,/, "", $2); print ("\t\tinput: '" $2 "',") }
5/"key":/ { gsub(/"|,/, "", $2); print ("\t\tkey: '" $2 "',") }
6/"out":/ { gsub(/"|,/, "", $2); print ("\t\toutput: '" $2 "',") }
7/}/ { print (" },") }
8